/* ==========================================================================
   Young Makers — Responsive & Hero Fix Layer
   Loaded LAST so it safely overrides the legacy theme on small screens.
   ========================================================================== */

/* ---------- 1. Global overflow / sizing safety net ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, iframe, embed, object, canvas { max-width: 100%; height: auto; }
* { box-sizing: border-box; }
p, li, a, h1, h2, h3, h4, h5, span, .sec-text { word-wrap: break-word; overflow-wrap: break-word; }

/* ---------- 2. Header top bar (phone/email row) ---------- */
@media (max-width: 767px) {
  .header-top .row { row-gap: 8px; }
  .header-links.style2 ul { flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
  .header-links.style2 li { font-size: 12px; white-space: nowrap; }
  .header-links ul li { font-size: 13px; }
}
@media (max-width: 400px) {
  .header-logo img { max-height: 38px; width: auto; }
}

/* ---------- 3. Language switch pill ---------- */
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px; color: #fff !important;
  border: 1px solid rgba(255,255,255,.5); border-radius: 30px;
  padding: 5px 14px; text-decoration: none; white-space: nowrap;
}
.lang-switch:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ---------- 4. New lightweight hero (replaces LayerSlider) ---------- */
.vs-hero-modern {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  display: flex;
  align-items: center;
}
.vs-hero-modern .hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.vs-hero-modern .hero-slide.is-active { opacity: 1; }
.vs-hero-modern::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(20,6,36,.90) 0%, rgba(20,6,36,.62) 45%, rgba(20,6,36,.20) 100%);
}
[dir="ltr"] .vs-hero-modern::before {
  background: linear-gradient(270deg, rgba(20,6,36,.90) 0%, rgba(20,6,36,.62) 45%, rgba(20,6,36,.20) 100%);
}
.vs-hero-modern .hero-inner { position: relative; z-index: 2; width: 100%; }
.vs-hero-modern .hero-content { max-width: 640px; color: #fff; }
.vs-hero-modern .hero-badge {
  display: inline-block; background: #FFD600; color: #1a0b2e;
  font-weight: 700; padding: 7px 18px; border-radius: 30px;
  font-size: clamp(12px, 2vw, 14px); margin-bottom: 18px;
}
.vs-hero-modern .hero-content h1 {
  font-family: 'Fredoka', var(--title-font, sans-serif);
  font-size: clamp(28px, 5.2vw, 62px);
  line-height: 1.15; margin-bottom: 18px; color: #fff;
}
.vs-hero-modern .hero-content p {
  font-size: clamp(15px, 2vw, 19px); margin-bottom: 30px; color: #f1eefc;
}
.vs-hero-modern .hero-btns { display: flex; flex-wrap: wrap; gap: 14px; }
.vs-hero-modern .hero-dots {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: 8px;
}
.vs-hero-modern .hero-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.45); cursor: pointer; padding: 0;
}
.vs-hero-modern .hero-dots button.is-active { background: #FFD600; width: 26px; border-radius: 6px; }
@media (max-width: 991px) { .vs-hero-modern { min-height: 560px; padding: 60px 0; } }
@media (max-width: 767px) {
  .vs-hero-modern { min-height: 500px; text-align: center; }
  .vs-hero-modern .hero-content { max-width: 100%; }
  .vs-hero-modern .hero-btns { justify-content: center; }
}

/* ---------- 5. Simple breadcrumb hero (inner pages) responsive polish ---------- */
@media (max-width: 575px) {
  .breadcumb-title { font-size: 1.5rem !important; }
  .sec-title { font-size: clamp(20px, 6vw, 30px) !important; }
}

/* ---------- 6. Component robustness ---------- */
.vs-carousel, .catslider1 { overflow: hidden; }
.accordion-button { white-space: normal; text-align: start; }
.sidebar-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-thumb { flex: 1 1 90px; max-width: 110px; }
.header-links a { word-break: break-word; }
.class-style1 { height: 100%; }
.footer-social { flex-wrap: wrap; }

/* ---------- 7. Product / kit cards (new content) ---------- */
.product-badge {
  display: inline-block; background: #FFD600; color: #1a0b2e;
  font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 20px;
  margin-bottom: 10px;
}
.product-price { font-weight: 700; font-size: 1.05rem; }

/* ---------- 9. Guaranteed product grid (replaces fragile Slick-as-grid pattern) ---------- */
/* The theme's own carousel JS (Slick) only shows 4-per-row above ~1400px and silently
   breaks to 3-per-row (with a leftover 4th item) between 992-1400px. Since this section
   is meant to always show all items at once (not swipe), we lay it out with plain CSS
   Grid instead of relying on Slick to arrange it — this always works, with or without JS. */
.product-grid4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0 !important;
}
.product-grid4 > .service-style1,
.product-grid4 > .class-style1 {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding: 0 !important;
}
@media (max-width: 1400px) {
  .product-grid4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
  .product-grid4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .product-grid4 { grid-template-columns: 1fr; }
}

/* ---------- 10. Compact header (was oversized) ---------- */
.header-top { padding-top: 6px; padding-bottom: 6px; }
.sticky-active { padding-top: 10px; padding-bottom: 10px; }
.header-logo img, .sticky-active .header-logo img { max-height: 46px; width: auto; }
.main-menu.menu-style1 > ul > li { margin-inline-end: 22px; }
.main-menu.menu-style1 > ul > li:last-child { margin-inline-end: 0; }
.main-menu.menu-style1 > ul > li > a { padding: 8px 0; font-size: 15px; white-space: nowrap; }

/* Keep the whole nav row on one line: compact spacing, no wrap, shrink before breaking */
.sticky-active .row { flex-wrap: nowrap; }
.main-menu.menu-style1 { flex: 1 1 auto; min-width: 0; }
.main-menu.menu-style1 > ul { flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 1300px) {
  .main-menu.menu-style1 > ul > li { margin-inline-end: 14px; }
  .main-menu.menu-style1 > ul > li > a { font-size: 14px; }
}

#pwaInstallBanner {
  position: fixed; z-index: 9999; left: 16px; right: 16px; bottom: 16px;
  max-width: 420px; margin: 0 auto; background: #1a0b2e; color: #fff;
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: none; align-items: center; gap: 12px; font-size: 14px;
}
#pwaInstallBanner.is-visible { display: flex; }
#pwaInstallBanner button { border: none; border-radius: 8px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
#pwaInstallBanner .pwa-install-btn { background: #FFD600; color: #1a0b2e; }
#pwaInstallBanner .pwa-dismiss-btn { background: transparent; color: #fff; opacity: .7; }

/* ---------- 11. "Why it's a real course" section ---------- */
.why-course-item {
  height: 100%;
  text-align: center;
  padding: 30px 20px;
  border-radius: 16px;
  background: #faf7ff;
  transition: transform .25s ease, box-shadow .25s ease;
}
.why-course-item:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.why-course-icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #1a0b2e; color: #FFD600; font-size: 24px;
}
.why-course-title { margin-bottom: 10px; }
.why-course-text { font-size: 14px; color: #6b6478; margin: 0; }
.why-course-note { margin-top: 34px; font-size: 14px; color: #6b6478; }
.why-course-note a { font-weight: 700; color: #1a0b2e; text-decoration: underline; }

/* ---------- 12. Age-category carousel: pure CSS scroll-snap (no JS/Slick dependency) ---------- */
/* Slick's absolute positioning does not reliably respect dir="rtl" across browsers,
   which made this section silently fail to render on the Arabic page. A native
   horizontal scroll container works correctly in both directions with zero JS. */
.cat-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 6px 4px 18px;
  scrollbar-width: thin;
}
.cat-scroll-item {
  flex: 0 0 260px;
  max-width: 260px;
  scroll-snap-align: start;
}
@media (max-width: 575px) {
  .cat-scroll-item { flex-basis: 220px; max-width: 220px; }
}
