/* Yellow & Blue — قسم "اختر برنامجك المناسب" */
/* متجاوب مع الجوال وسطح المكتب، ولا يغيّر محتوى البطاقات */

section#main-links-1 {
  --yb-blue: #0099e5;
  --yb-yellow: #f7d40a;
  --yb-navy: #102a43;
  --yb-border: #dbe7f0;
  padding-block: 10px 18px;
}

/* منع التمدد الأفقي والفراغ الجانبي على الجوال */
@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  .s-block--photos-slider,
  #main-links-1,
  .s-block--photos-slider .s-slider-container,
  #main-links-1 .s-slider-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
}

/* ==========================================================
   فصل قسم "صور من برامجنا" عن قسم "مميزات المتجر"
   يلغي السحب للأعلى الذي يسبب التداخل على الجوال وسطح المكتب
   ========================================================== */
#square-static-images-7 + #s-home--features-8 {
  position: relative;
  clear: both;
  margin-top: 32px !important;
}

#s-home--features-8 .features-home-grid {
  margin-top: 0 !important;
  transform: none !important;
}

/* توحيد توزيع صور قسم "صور من برامجنا" وإزالة الفراغات الكبيرة */
#square-static-images-7 .square-static-images-itmes {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

#square-static-images-7 .square-static-item {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
}

@media (max-width: 767px) {
  #square-static-images-7 + #s-home--features-8 {
    margin-top: 24px !important;
  }

  #square-static-images-7 .square-static-images-itmes {
    flex-direction: column !important;
    gap: 12px !important;
  }

  #square-static-images-7 .square-static-item {
    flex: none !important;
    width: 100% !important;
  }
}

/* عنوان القسم */
section#main-links-1 .s-block__title {
  margin-bottom: 20px !important;
}

section#main-links-1 .s-block__title .center-side {
  width: 100%;
  justify-content: center;
  text-align: center;
}

section#main-links-1 .s-block__title h2 {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0 8px 11px;
  color: var(--yb-navy) !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
}

section#main-links-1 .s-block__title h2::after {
  content: "";
  position: absolute;
  right: 50%;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: var(--yb-blue);
  transform: translateX(50%);
}

/* البطاقة بالكامل قابلة للضغط */
section#main-links-1 a.itme-cat-entry {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box;
  border: 1px solid var(--yb-border);
  border-radius: 16px !important;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.12);
  text-decoration: none !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

section#main-links-1 a.itme-cat-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.16);
}

section#main-links-1 a.itme-cat-entry:active {
  transform: scale(0.985);
}

/* الصورة تبقى كما هي، مع ضبط الحواف فقط */
section#main-links-1 .itme-categories-image {
  width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 15px !important;
}

/* منطقة الاسم مثبتة داخل البطاقة بعرض كامل لمنع التداخل */
section#main-links-1 .main-links-title {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 3;
  display: flex !important;
  width: 66.6667% !important;
  max-width: 66.6667% !important;
  min-width: 0 !important;
  min-height: 76px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0 !important;
  padding: 10px 12px 11px !important;
  transform: none !important;
  border-radius: 28px 0 15px 15px !important;
  background: var(--yb-blue) !important;
  color: #fff !important;
  text-align: center !important;
  direction: rtl;
  word-break: normal !important;
  overflow-wrap: normal !important;
  transition: background-color 160ms ease, color 160ms ease;
}

section#main-links-1 .main-links-title h4 {
  display: -webkit-box !important;
  width: 100%;
  max-width: 100%;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

section#main-links-1 .main-links-title span {
  display: block !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

/* الأصفر يظهر عند التفاعل بدل الأزرق */
section#main-links-1 a.itme-cat-entry:hover .main-links-title,
section#main-links-1 a.itme-cat-entry:active .main-links-title,
section#main-links-1 a.itme-cat-entry:focus-visible .main-links-title {
  background: var(--yb-yellow) !important;
  color: var(--yb-navy) !important;
}

section#main-links-1 a.itme-cat-entry:focus-visible {
  outline: 3px solid rgba(247, 212, 10, 0.65);
  outline-offset: 3px;
}

/* ضبط الجوال */
@media (max-width: 767px) {
  section#main-links-1 {
    padding-block: 8px 14px;
  }

  section#main-links-1 .s-block__title {
    margin-bottom: 16px !important;
  }

  section#main-links-1 .s-block__title h2 {
    padding-bottom: 9px;
    font-size: 21px !important;
  }

  section#main-links-1 .s-block__title h2::after {
    width: 50px;
    height: 3px;
  }

  section#main-links-1 .main-links-title {
    min-height: 70px;
    padding: 8px 9px 9px !important;
  }

  section#main-links-1 .main-links-title h4 {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  section#main-links-1 .main-links-title span {
    font-size: 12px !important;
  }

}

/* لا يبقى تأثير hover عالقًا على شاشات اللمس */
@media (max-width: 767px) and (hover: none) {
  section#main-links-1 a.itme-cat-entry:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(16, 42, 67, 0.12);
  }

  section#main-links-1 a.itme-cat-entry:hover .main-links-title {
    background: var(--yb-blue) !important;
    color: #fff !important;
  }

  section#main-links-1 a.itme-cat-entry:active .main-links-title {
    background: var(--yb-yellow) !important;
    color: var(--yb-navy) !important;
  }
}

/* ==========================================================
   مميزات المتجر: صف منظم على سطح المكتب وسحب أفقي على الجوال
   ========================================================== */
@media (min-width: 768px) {
  #s-home--features-8 .features-home-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100% !important;
  }

  #s-home--features-8 .features-home-grid > * {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
}

/* ==========================================================
   سلايدر مقدمة الصفحة: حجم أصغر دون التأثير على بقية الثيم
   ========================================================== */
.s-block--photos-slider #photos-0-slider {
  display: block !important;
  width: 100% !important;
}

.s-block--photos-slider #photos-0-slider .s-slider-container {
  width: 100% !important;
  overflow: hidden !important;
}

.s-block--photos-slider #photos-0-slider .swiper-wrapper {
  align-items: center !important;
}

.s-block--photos-slider #photos-0-slider .swiper-slide {
  width: 82% !important;
  margin-inline: 12px !important;
  box-sizing: border-box !important;
}

.s-block--photos-slider #photos-0-slider .swiper-slide > a,
.s-block--photos-slider #photos-0-slider .swiper-slide img {
  display: block !important;
  width: 100% !important;
}

.s-block--photos-slider #photos-0-slider .swiper-slide > a {
  box-sizing: border-box !important;
  border: 2px solid #f7d40a !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

.s-block--photos-slider #photos-0-slider .swiper-slide img {
  height: auto !important;
  object-fit: contain !important;
  border-radius: 16px !important;
}

section#main-links-1 {
  margin-top: 32px !important;
}

@media (max-width: 767px) {
  .s-block--photos-slider #photos-0-slider .swiper-slide {
    width: calc(100% - 20px) !important;
    margin-inline: 10px !important;
    padding-inline: 0 !important;
  }

  .s-block--photos-slider #photos-0-slider .swiper-slide > a {
    /* زيادة طفيفة في ارتفاع الإطار دون تداخل الشرائح أو قص النص */
    padding-block: 5px !important;
    background: #fffdf2 !important;
    border-radius: 20px !important;
  }

  .s-block--photos-slider #photos-0-slider .swiper-slide img {
    height: auto !important;
    object-fit: contain !important;
    border-radius: 20px !important;
  }

  section#main-links-1 {
    margin-top: 24px !important;
  }
}

@media (max-width: 767px) {
  #s-home--features-8 {
    overflow: hidden !important;
  }

  #s-home--features-8 .features-home-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 16px 20px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  #s-home--features-8 .features-home-grid::-webkit-scrollbar {
    display: none;
  }

  #s-home--features-8 .features-home-grid > * {
    flex: 0 0 82% !important;
    width: 82% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}

/* إطار أصفر للبنرات الثابتة الخمسة على الجوال وسطح المكتب */
main :is(
  #s-block--fixed-banner-2,
  #s-block--fixed-banner-3,
  #s-block--fixed-banner-4,
  #s-block--fixed-banner-5,
  #s-block--fixed-banner-6
) > .container > .banner--fixed {
  box-sizing: border-box !important;
  border: 2px solid #f7d40a !important;
  border-radius: 16px !important;
}

/* البنرات الخمسة الثابتة أسفل البرامج: أصغر بنسبة 25% على سطح المكتب فقط */
@media (min-width: 768px) {
  main :is(
    #s-block--fixed-banner-2,
    #s-block--fixed-banner-3,
    #s-block--fixed-banner-4,
    #s-block--fixed-banner-5,
    #s-block--fixed-banner-6
  ) > .container > .banner--fixed {
    width: 75% !important;
    margin-inline: auto !important;
  }
}