/* =============================================================
   MS GROUP — responsive.css
   Breakpoints are authored per layout, not as a shrunk desktop.
   1440 / 1200 / 1024 / 900 / 768 / 560 / 480 / 375
   ============================================================= */

/* ---------- Large desktop 1441px+ ---------------------------- */
@media (min-width: 1441px) {
  :root { --maxw: 1320px; --gutter: 32px; }
  .hero__inner { padding-block: 108px; }
}

/* ---------- 1200px and below --------------------------------- */
@media (max-width: 1200px) {
  .footer__top { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
  .footer__col--nav { grid-column: span 1; }
}

/* ---------- Tablet landscape / small laptop: 1024px ---------- */
@media (max-width: 1024px) {
  :root { --gutter: 22px; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero__stats { max-width: 640px; }

  .certs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .pd { grid-template-columns: minmax(0, 1fr); }
  .pd__gallery { position: static; max-width: 620px; }

  .contact-grid { grid-template-columns: minmax(0, 1fr); }

  .split--reverse > :first-child { order: 0; }

  .media-stack__inset { inset-inline-end: 0; }
}

/* ---------- Nav needs the drawer before the rest of the layout
   does: brand + five links + language switch + CTA stop fitting
   on one line at about 1000px. ------------------------------- */
@media (max-width: 1080px) and (min-width: 961px) {
  .nav__link { padding-inline: 10px; font-size: 14px; }
  .nav__actions { gap: 9px; }
}

@media (max-width: 960px) {
  :root { --nav-h: 68px; }

  .nav__toggle { display: inline-flex; }
  .nav__cta { display: block; }

  .nav__menu {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 95;
    width: min(340px, 88vw);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 84px 22px 28px;
    background: var(--paper);
    border-inline-start: 1px solid var(--line);
    box-shadow: -18px 0 50px -30px rgba(20, 33, 28, .6);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .34s var(--ease), visibility .34s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  html[dir="rtl"] .nav__menu {
    border-inline-start: 0;
    border-inline-end: 1px solid var(--line);
    box-shadow: 18px 0 50px -30px rgba(20, 33, 28, .6);
    transform: translateX(-100%);
  }
  /* The RTL rule above is more specific than a lone .is-open, so the
     open state has to be stated for both directions or the Arabic
     drawer never slides in. */
  .nav__menu.is-open,
  html[dir="rtl"] .nav__menu.is-open { transform: translateX(0); visibility: visible; }

  .nav__menu .nav__link {
    padding: 15px 14px;
    font-size: 16px;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }
  .nav__menu .nav__link::after { display: none; }
  .nav__menu .nav__link[aria-current="page"] {
    background: var(--brand-tint);
    border-inline-start: 3px solid var(--brand);
    padding-inline-start: 14px;
  }
  .nav__menu .nav__cta { margin-top: 20px; }
  .nav__menu .nav__cta .btn { width: 100%; }

  .nav__actions .btn--nav { display: none; }
}

/* ---------- 900px --------------------------------------------- */
@media (max-width: 900px) {
  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__col--brand { grid-column: 1 / -1; }
  .pagehead__inner { grid-template-columns: minmax(0, 1fr); }
  .pagehead__badge { align-self: start; display: inline-flex; }
}

/* ---------- Tablet portrait: 768px ---------------------------- */
@media (max-width: 768px) {
  .topbar__inner { min-height: 0; padding-block: 9px; justify-content: center; gap: 10px 18px; }
  .topbar__list { gap: 8px 18px; justify-content: center; font-size: 12.5px; }
  .topbar__item--address { display: none; }

  .hero__eyebrow { margin-bottom: 18px; }
  .hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; margin-top: 34px; padding-top: 22px; }
  .hero__stat b { font-size: 24px; }
  .hero__stat span { font-size: 11.5px; }

  .certs__head { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 14px; }
  .certs__note { padding-bottom: 0; }

  .section-head--split { align-items: flex-start; }

  .grid-products { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

  /* flex-wrap must go with the column switch: in a wrapping column
     container, align-items:stretch sizes items to the line's content
     width, not to the container, and the search field overflows. */
  .toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .search { flex: 0 0 auto; min-width: 0; width: 100%; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; scrollbar-width: thin; }
  .chip { flex: none; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }

  .ctaband__inner { flex-direction: column; align-items: flex-start; }
  .ctaband h2 { max-width: none; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .media-stack__inset { width: 40%; inset-block-end: -18px; border-width: 5px; }
  .media-stack__rule { display: none; }
}

/* ---------- Large phone: 560px -------------------------------- */
@media (max-width: 560px) {
  :root { --gutter: 18px; }

  .topbar__item--email { display: none; }

  .brand__mark { width: 40px; height: 40px; }
  .brand__name { font-size: 16px; }
  .brand__tag { font-size: 10px; }

  .hero__inner { padding-block: 42px 48px; }

  .certs__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__cta { gap: 10px; }
  .hero__cta .btn { flex: 1 1 100%; }
  .hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero__stat b { font-size: 21px; }
  .hero__stat span { font-size: 11px; }

  .grid-products { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
  .pcard__body { padding: 15px 15px 17px; gap: 7px; }
  .pcard__name { font-size: 16.5px; }
  .pcard__desc { font-size: 13px; -webkit-line-clamp: 2; line-clamp: 2; }
  .pcard__foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .pcard__kcal { order: 2; text-align: center; }
  .pcard__foot .btn { width: 100%; }

  .steps { grid-template-columns: minmax(0, 1fr); }
  .step { padding: 24px 20px 26px; }

  .feature { padding: 24px 20px; }

  .pd__stage { aspect-ratio: 4 / 3.6; }
  .pd__thumb { width: 70px; height: 62px; }
  .nutri { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .nutri__cell { padding: 12px 13px; }
  .nutri__cell dd { font-size: 16px; }
  .pd__cta { padding: 20px; }
  .pd__cta .row .btn { width: 100%; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gitem__label { opacity: 1; transform: none; font-size: 12px; padding: 20px 11px 10px; }

  .lb-btn { width: 44px; height: 44px; }
  .lb-prev, .lb-next { top: auto; transform: none; inset-block-end: 62px; }
  .lb-prev { inset-inline-start: 16px; }
  .lb-next { inset-inline-end: 16px; }
  .lightbox__img { max-height: 62vh; }

  .infoitem, .infocard__head, .socials { padding-inline: 20px; }
  .formcard { padding: 22px 18px; }
  .form-foot .btn { width: 100%; }

  .footer__top { grid-template-columns: minmax(0, 1fr); gap: 34px; }

  /* One column: copyright first, the credit badge under it. The three
     centred tracks have no room left at this width. */
  .footer__bottom {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 18px;
  }
  .footer__bottom .devcredit {
    grid-column: 1;
    justify-self: center;
    order: 2;
  }
  .footer__copy { grid-column: 1; order: 1; }

  /* The badge is centred here, so the card centres on it rather than
     aligning to an edge. Physical `left` on purpose: once centred the
     result is identical in both directions, and it avoids having to
     flip the translate for RTL. */
  .devcard {
    inset-inline: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ---------- Small phone: 480px -------------------------------- */
@media (max-width: 480px) {
  body { font-size: 15.5px; }
  .section { padding-block: 44px; }

  .topbar__socials { display: none; }

  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .hero__stat:last-child { grid-column: 1 / -1; }

  .btn { padding: 12px 18px; font-size: 14px; }

  .section-head { margin-bottom: 26px; }
}

/* ---------- Very small phone: 375px --------------------------- */
@media (max-width: 380px) {
  :root { --gutter: 15px; }
  .grid-products { grid-template-columns: minmax(0, 1fr); }
  .pcard__desc { -webkit-line-clamp: 3; line-clamp: 3; }
  .brand__text { display: none; }
  .brand__mark { width: 38px; height: 38px; }
  .nutri { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Short landscape phones ---------------------------- */
@media (max-height: 460px) and (orientation: landscape) {
  .lightbox__img { max-height: 68vh; }
  .nav__menu { padding-top: 70px; }
}

/* ---------- Print --------------------------------------------- */
@media print {
  .topbar, .nav, .footer, .ctaband, .lightbox, .pd__cta, .skip-link { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { color: #000; }
  .hero, .pagehead { background: #fff; color: #000; }
  .hero :is(h1, h2, h3), .pagehead h1 { color: #000; }
}
