@media (max-width: 767px) {
  /* G1 root-cause fix: quiz.css enqueues a global `body { min-width: 1440px }`
     that leaks to every page and forces 1440px horizontal overflow on mobile.
     `html body` outranks quiz.css's bare `body` selector regardless of load order. */
  html body {
    min-width: 0;
  }

  .desktop-announcement,
  .header-desktop,
  .hero-desktop,
  .hero-services-desktop,
  .benefits-strip-desktop,
  .categories-desktop,
  .promo-banners-desktop,
  .featured-products-desktop,
  .promo-cta-desktop,
  .solutions-desktop,
  .hotspot-discovery-desktop,
  .doctors-strip-desktop,
  .prebuy-content-desktop,
  .trust-proof-desktop,
  .faq-desktop,
  .site-footer-desktop {
    display: none !important;
  }

  .header-mobile,
  .hero-mobile,
  .hero-services-mobile,
  .benefits-strip-mobile,
  .categories-mobile,
  .promo-banners-mobile,
  .featured-products-mobile,
  .promo-cta-mobile,
  .solutions-mobile,
  .hotspot-discovery-mobile,
  .doctors-strip-mobile,
  .prebuy-content-mobile,
  .trust-proof-mobile,
  .faq-mobile,
  .site-footer-mobile {
    display: block;
  }

  /* The mobile announcement inner is a flex row (arrows + message). A plain
     display:block stacks its children vertically and pushes the text below the
     40px clipped bar, so it looked empty. Keep it flex on mobile. */
  .mobile-announcement {
    display: flex;
  }

  .categories-page__hero {
    height: 100px;
  }

  .categories-page__hero h1 {
    font-size: 24px;
    line-height: 32px;
  }

  .categories-page__body {
    padding: 30px 12px 24px;
  }

  .categories-page__grid {
    width: 342px;
    max-width: 100%;
    grid-template-columns: repeat(2, 161px);
    gap: 20px;
  }

  .categories-page__card {
    width: 161px;
    min-height: 259px;
  }

  .categories-page__card img {
    width: 161px;
    height: 203px;
  }

  .categories-page__name {
    width: 161px;
    margin-top: 12px;
    font-size: 16px;
    line-height: 24px;
  }

  .categories-page__count {
    width: 161px;
    margin-top: 0;
    font-size: 14px;
    line-height: 20px;
  }

  .categories-page__card--scale {
    order: 1;
  }

  .categories-page__card--mother-baby {
    order: 2;
  }

  .categories-page__card--glucose {
    order: 3;
  }

  .categories-page__card--blood-pressure {
    order: 4;
  }

  .categories-page__card--thermometers {
    order: 5;
  }

  .categories-page__card--air-pressure {
    order: 6;
  }

  .categories-page__card--breathing {
    order: 7;
  }

  .categories-page__card--nebulizer {
    order: 8;
  }

  .categories-page__card--sleep-disorders {
    order: 9;
  }

  .categories-page__card--massage {
    order: 10;
  }

  .categories-page__card--heating-pads {
    order: 11;
  }

  .categories-page__card--medical-mattresses {
    order: 12;
  }

  .categories-page__card--stethoscopes {
    order: 13;
  }

  .categories-page__card--surgical-suction {
    grid-column: auto;
    order: 14;
  }

  .plp-hero {
    height: 94px;
  }

  .plp-hero h1 {
    width: 100%;
    padding-inline: 16px;
    font-size: 0;
    line-height: 28px;
  }

  .plp-hero h1::before {
    content: attr(data-mobile-title);
    font-size: 20px;
  }

  .plp-breadcrumb {
    display: none;
  }

  .plp-content {
    padding: 20px 16px 0;
    overflow: hidden;
  }

  .plp-category-strip {
    width: calc(100% + 32px);
    margin-inline: -16px;
    padding: 0 16px 18px;
    border-bottom: 0;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    direction: rtl;
  }

  .plp-category-strip::-webkit-scrollbar {
    display: none;
  }

  .plp-category {
    width: 106px;
    min-width: 106px;
    min-height: 152px;
  }

  .plp-category--active {
    order: -1;
  }

  .plp-category img {
    width: 106px;
    height: 106px;
  }

  .plp-category__name {
    width: 106px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 20px;
  }

  .plp-category__count {
    display: none;
  }

  .plp-layout {
    width: 100%;
    margin-top: 0;
    display: block;
  }

  .plp-products {
    width: 100%;
    padding-left: 0;
  }

  .plp-toolbar,
  .plp-filter,
  .plp-pagination {
    display: none;
  }

  .plp-mobile-controls {
    height: 38px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
  }

  .plp-mobile-controls button {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--blue-850);
    font-size: 14px;
    font-weight: 700;
  }

  .plp-mobile-controls > span {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
  }

  .plp-grid {
    grid-template-columns: repeat(2, 167px);
    justify-content: center;
    gap: 20px 9px;
  }

  .plp-grid .fp-card:nth-child(n+7) {
    display: none;
  }

  .home-search {
    z-index: 99999;
  }

  .home-search__surface {
    top: 150px;
    z-index: 99999;
    min-height: calc(100vh - 150px);
    padding: 24px 17px 32px;
    display: block;
    background: #fff;
    box-shadow: none;
    direction: ltr;
  }

  .home-search__popular {
    width: 100%;
    margin: 0 0 26px;
    gap: 8px;
  }

  .home-search__popular h2 {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
  }

  .home-search__popular button {
    min-height: 16px;
    gap: 5px;
    font-size: 14px;
    line-height: 16px;
  }

  .home-search__popular button img {
    width: 16px;
    height: 16px;
  }

  .home-search__results {
    width: 100%;
  }

  .home-search__grid {
    width: 293px;
    margin-inline: auto;
    grid-template-columns: repeat(3, 87px);
    gap: 20px 16px;
  }

  .home-search__card {
    width: 87px;
    min-height: 119px;
    gap: 6px;
  }

  .home-search__photo {
    width: 87px;
    height: 86px;
    border-radius: 2px;
  }

  .home-search__photo img {
    width: 87px;
    height: 86px;
  }

  .home-search__title {
    width: 87px;
    font-size: 12px;
    line-height: 16px;
  }

  .home-search__empty {
    margin-top: 18px;
    font-size: 14px;
    line-height: 20px;
  }
}

/* =====================================================================
   Home mobile — Figma-accurate fixes (UI Design - Mobile, 375px frame)
   Each section verified against Figma node 9476:60588
   ===================================================================== */
@media (max-width: 767px) {
  /* ---- Hero mobile (9476:60591) : image 442 + offers bar 52 = 494 ---- */
  .hero-mobile,
  .hero-mobile__image { height: 442px; }

  .hero-mobile__content h1 {            /* title: GE SS Two Bold 20/28 #002363, w284, top24 */
    width: 284px;
    color: #002363;
    font-weight: 700;
    font-size: 20px;
    line-height: 28px;
  }
  .hero-mobile__content p {             /* subtitle: Medium 16/24, w299 (Figma) */
    width: 299px;
    color: rgba(0, 37, 107, 0.8);
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
  }

  /* ---- Trust/offers bar (hero "Top bar" 9476:56501) : h52, py8, base 16/24 ---- */
  .hero-services-mobile {
    padding-block: 14px !important;     /* -> ~52px tall (was 18) */
    padding-inline: 16px;
  }
  .hero-services__inner--mobile { gap: 24px; }      /* between items (Figma 24) */
  .hero-services__item--mobile { gap: 6px; }        /* icon <-> text (Figma 6, was 12) */
  .hero-services__item--mobile .hero-services__label {
    font-size: 16px;                    /* Figma base (was 14) */
    line-height: 24px;                  /* (was 20) */
    color: #002f87;
  }
}

/* =====================================================================
   Home mobile — section layout fixes (cont.)  node 9476:60588
   ===================================================================== */
@media (max-width: 767px) {
  /* ---- Stats / benefits 2x2 (9476:60593): cols 115 @ x40.5/x219.5, gap 64 ---- */
  .benefits-strip__mobile-grid {
    justify-content: center;   /* was space-between → spread cols to 79px gap */
    row-gap: 30px;             /* Figma row pitch (was 32) */
  }

  /* ---- Product cards: featured + best-sellers (9476:60739/60764) ---- */
  .fp-grid--mobile { row-gap: 20px; }                       /* Figma row2 @ +436 (was 16) */
  .fp-card--discount.fp-card--mobile { min-height: 444px; } /* Figma row2 cards h444 (was 416) */

  /* ---- Doctors strip (9476:60814): card 193, pitch 205 → gap 12 ---- */
  .doctors-strip__grid--mobile { gap: 12px; }               /* was 8 */
}

/* =====================================================================
   Mobile fixes — interior pages (PLP / Favorites)  nodes 8608:48181, 8608:49122
   ===================================================================== */
@media (max-width: 767px) {
  /* PLP hero band: Figma 100px / category card h154 (micro) */
  .plp-hero { height: 100px; }
  .plp-category { min-height: 154px; }

  /* Favorites: was 5-col 237px (desktop) with NO mobile rule -> overflowed.
     Figma Fav mobile (8608:49122) = standard product card grid 2x167, gap 9/20 */
  .favorites-grid {
    width: 343px;
    max-width: 100%;
    margin-inline: auto;
    grid-template-columns: repeat(2, 167px);
    justify-content: center;
    gap: 20px 9px;
    direction: rtl;
  }
  .favorites-card.fp-card { width: 167px; min-height: 416px; }
  .favorites-card .fp-media { height: 180px; }
  .favorites-card .fp-media-frame { height: 180px; }
  .favorites-card__remove { width: 32px; height: 32px; }
}

/* =====================================================================
   Functional components on mobile  (mini-cart drawer)
   ===================================================================== */
@media (max-width: 767px) {
  /* mini-cart drawer was fixed 385px (>375 viewport) -> cap to full width */
  .mini-cart {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
  }
}

/* =====================================================================
   Cart mobile (8608:49154) — was fixed 1304px 2-col grid (overflowed).
   Stack to single column, items above summary, full width.
   ===================================================================== */
@media (max-width: 767px) {
  .cart-shell {
    width: 100%;
    height: auto;
    margin-bottom: 24px;
    padding-inline: 16px;
    box-sizing: border-box;
  }
  .cart-heading { width: 100%; height: auto; }
  .cart-heading h1 { font-size: 20px; line-height: 28px; }
  .cart-layout {
    width: 100%;
    height: auto;
    margin-inline-start: 0;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cart-summary-panel,
  .cart-items-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
  }
  .cart-items-panel { order: -1; }   /* items above summary (Figma) */
}

@media (max-width: 767px) {
  /* favorites wrapper was fixed 1283px -> fluid */
  .favorites-content { width: 100%; max-width: 100%; box-sizing: border-box; padding-inline: 16px; }
  .favorites-count { width: auto; }
}

/* =====================================================================
   Home mobile — FULL Elementor reset + section fixes  (node 9476:60588)
   Elementor wraps every widget in section ▸ container ▸ column ▸ wrap, each
   adding width caps / padding / margin that break the mobile design. Strip all
   of it at ≤767px so the theme's own section CSS is the single source of truth.
   ===================================================================== */
@media (max-width: 767px) {
  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget-wrap,
  .elementor-widget,
  .elementor-element,
  .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }

  /* Hero variant visibility (belt-and-suspenders with the main swap block). */
  .hero-desktop { display: none !important; }
  .hero-mobile  { display: block !important; }
}

/* =====================================================================
   Home mobile — section-by-section Figma-accurate values (node 9476:60588)
   ===================================================================== */
@media (max-width: 767px) {
  /* HERO: the content block was pinned with a fixed inset-inline-start:46px,
     so it only looked centred at exactly 375px. Center it for any width. */
  .hero-mobile__content {
    inset-inline-start: 0;
    inset-inline-end: 0;
    margin-inline: auto;
    width: min(284px, calc(100% - 48px));
    text-align: center;
  }
  .hero-mobile__content h1,
  .hero-mobile__content p {
    width: 100%;            /* was fixed 284/299 → overflowed narrow phones */
    margin-inline: auto;
  }
  .hero-cta--mobile { margin-inline: auto; }

  /* NAV: mobile header action icons were 20px (too small per design). */
  .header-mobile__actions .header-icon img {
    width: 24px;
    height: 24px;
  }
  .header-mobile__actions .header-icon { flex: 0 0 32px; width: 32px; height: 32px; }
}

/* ===== Product card grids — responsive: 2 fluid cards on small tablets
   (481–767px), 1 card on phones (≤480px). Cards fill their column and the
   image frame scales by aspect-ratio so nothing distorts. ===== */
@media (max-width: 767px) {
  .plp-grid,
  .favorites-grid,
  .fp-grid--mobile {
    grid-template-columns: 1fr 1fr;
    gap: 24px;                 /* unified 24px card gap across all pages */
    justify-content: stretch;
  }
  .plp-grid,
  .favorites-grid {
    width: 100%;
    max-width: 100%;
  }
  .plp-grid .fp-card,
  .favorites-grid .fp-card,
  .favorites-grid .favorites-card.fp-card,
  .fp-grid--mobile .fp-card {
    width: 100%;
    min-width: 0;
  }
  .plp-grid .fp-media-frame,
  .favorites-grid .fp-media-frame,
  .fp-grid--mobile .fp-media-frame {
    height: auto;
    aspect-ratio: 167 / 180;
  }
}
@media (max-width: 480px) {
  .plp-grid,
  .favorites-grid,
  .fp-grid--mobile {
    grid-template-columns: 1fr;
  }
}
