/*
 * GAINVO Storefront v0.10.42 — Phase 10 final responsive audit
 * Final authority for cross-page sizing, safe areas, fixed navigation and
 * responsive consistency. Business logic is intentionally untouched.
 */

:root{
  --gv-audit-gutter:16px;
  --gv-audit-radius:16px;
  --gv-audit-touch:44px;
  --gv-audit-body:16px;
  --gv-audit-secondary:14px;
  --gv-audit-caption:12px;
  --gv-audit-title:22px;
  --gv-audit-section:23px;
}

/* Universal resilience: prevent long commerce content from forcing overflow. */
.screen,
.screen *,
.modal-content,
.modal-content *,
.customer-account-sheet,
.customer-account-sheet *,
.account-editor-sheet,
.account-editor-sheet *{box-sizing:border-box}
.screen :where(.card,.product-card,.product-card-v7,.shop-card,.shop-list-card,.shop-list-card-v2,.shop-list-card-v91,.result-card,.result-shop-card,.customer-order-card,.customer-order-card-v2,.order-history-card,.checkout-card,.settings-card,.settings-card-v2){min-width:0}
.screen :where(h1,h2,h3,h4,p,strong,span,small,a,button){overflow-wrap:anywhere}
img{max-width:100%}

@media (max-width:759px){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:hidden}
  body{font-size:var(--gv-audit-body)!important;line-height:1.45!important;overflow-x:hidden}
  .app-shell,.screen,.main{max-width:100vw!important;overflow-x:clip}

  /* One predictable content gutter on every customer screen. */
  .main{
    padding-left:max(var(--gv-audit-gutter),env(safe-area-inset-left))!important;
    padding-right:max(var(--gv-audit-gutter),env(safe-area-inset-right))!important;
    padding-bottom:calc(84px + env(safe-area-inset-bottom))!important;
  }
  .screen{width:100%;margin-inline:auto}

  /* Typography floor: eliminate microtype left by legacy page layers. */
  .screen :where(p,.secondary,.muted,.subtle,.shop-description,.product-description){font-size:var(--gv-audit-secondary)!important;line-height:1.45!important}
  .screen :where(.micro,.eyebrow,.home-eyebrow,.hero-kicker,.promo-badge,.product-shop,.product-meta-line,.service-tag,.status,.stock-chip,.page-title-badge,.customer-order-subtitle,.customer-order-status,.merchant-eyebrow,.merchant-trust-strip small){font-size:var(--gv-audit-caption)!important;line-height:1.3!important}
  .screen :where(.page-title-row h1,.page-title h1){font-size:var(--gv-audit-title)!important;line-height:1.15!important}
  .screen :where(.section-head h2,.search-group-head h2,.shop-list-body h2){font-size:var(--gv-audit-section)!important;line-height:1.15!important}

  /* Touch targets stay accessible without visual bulk. */
  button,a.button,.icon-button,.nav-item,[role="button"]{min-height:var(--gv-audit-touch)}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px!important}

  /* Header geometry should never compete with content. */
  .topbar{
    min-height:66px!important;
    padding:9px max(var(--gv-audit-gutter),env(safe-area-inset-right)) 9px max(var(--gv-audit-gutter),env(safe-area-inset-left))!important;
  }
  .top-actions{gap:7px!important}
  .top-actions .icon-button,.icon-button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:13px!important}
  .top-actions .icon-button svg,.icon-button svg{width:21px!important;height:21px!important}

  /* Bottom nav: fixed, safe-area aware, same scale on every screen. */
  .bottom-nav{
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    min-height:68px!important;
    padding:6px 8px!important;
    border-radius:24px!important;
  }
  .nav-item{min-width:0!important;min-height:56px!important;padding:5px 2px!important;border-radius:17px!important;gap:3px!important}
  .nav-item .nav-icon,.nav-item svg{width:24px!important;height:24px!important}
  .nav-item small{font-size:12px!important;line-height:1.05!important;font-weight:700!important;white-space:nowrap!important}

  /* Common card language across all pages. */
  .screen :where(.card,.home-category-card,.product-card,.product-card-v7,.shop-card,.shop-card-v2,.shop-list-card,.shop-list-card-v2,.shop-list-card-v91,.result-card,.result-shop-card,.customer-order-card,.customer-order-card-v2,.order-history-card,.checkout-card,.settings-card,.settings-card-v2,.address-card,.preference-card){border-radius:var(--gv-audit-radius)!important}

  /* Horizontal rails are intentional and must not show half-clipped vertical content. */
  :where(.category-row,.home-category-row,.filter-row,.search-tabs,.search-chip-row,.merchant-status-row,.merchant-fulfilment-row){scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
  :where(.category-row,.home-category-row,.filter-row,.search-tabs,.search-chip-row,.merchant-status-row,.merchant-fulfilment-row)::-webkit-scrollbar{display:none}

  /* Shared product-card hierarchy: product first, merchant second. */
  :where(.product-card,.product-card-v7,.home-product-card) :where(.product-title,h3){font-size:16px!important;line-height:1.22!important;font-weight:800!important}
  :where(.product-card,.product-card-v7,.home-product-card) .product-shop{font-size:12px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  :where(.product-card,.product-card-v7,.home-product-card) .product-meta-line{font-size:12px!important;line-height:1.25!important}
  :where(.product-card,.product-card-v7,.home-product-card) .product-price{font-size:18px!important;line-height:1.1!important}

  /* Orders: timeline labels must stay readable and stable. */
  .screen[data-screen="orders"] .order-step strong{font-size:11px!important;line-height:1.15!important;overflow-wrap:normal!important}
  .screen[data-screen="orders"] .history-order-copy .micro,
  .screen[data-screen="orders"] .order-history-head .micro,
  .order-receipt-sheet .receipt-brand .micro,
  .order-receipt-sheet .receipt-meta span{font-size:11px!important}

  /* Checkout progress was too small in older layers. */
  .checkout-progress span{font-size:11px!important;line-height:1.2!important}

  /* Individual shop trust text and product metadata floor. */
  body[data-active-screen="shop"] .merchant-trust-strip small,
  body[data-active-screen="shop"] .shop-product-grid .product-meta-line,
  body[data-active-screen="shop"] .shop-product-grid .product-badge{font-size:11px!important}

  /* Sheets/dialogs must always fit the visible viewport. */
  :where(.customer-account-sheet,.account-editor-sheet,.order-receipt-sheet,.checkout-sheet,.basket-sheet){
    max-width:100%!important;
    max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - max(12px,env(safe-area-inset-bottom)))!important;
  }
}

/* Very small phones: reflow instead of shrinking typography. */
@media (max-width:359px){
  :root{--gv-audit-gutter:12px;--gv-audit-title:21px;--gv-audit-section:21px}
  .bottom-nav{left:6px!important;right:6px!important;padding-inline:5px!important}
  .nav-item small{font-size:11px!important}
  .screen :where(.product-card,.product-card-v7,.home-product-card) :where(.product-title,h3){font-size:15px!important}
}

/* Larger phones: keep density calm, do not inflate controls. */
@media (min-width:430px) and (max-width:759px){
  :root{--gv-audit-gutter:18px;--gv-audit-title:23px;--gv-audit-section:24px}
  .main{max-width:620px!important;margin-inline:auto!important}
}

/* Tablet: centre content and allow denser grids, while keeping mobile touch sizing. */
@media (min-width:760px) and (max-width:1023px){
  .main{max-width:940px;margin-inline:auto;padding-inline:24px!important}
  .screen{max-width:940px;margin-inline:auto}
  .bottom-nav{max-width:640px;left:50%!important;right:auto!important;transform:translateX(-50%)!important}
}

/* Desktop: consistent content bounds and prevent edge-to-edge cards. */
@media (min-width:1024px){
  .main{max-width:1440px;margin-inline:auto;padding-inline:28px}
  .screen{min-width:0}
  .desktop-nav{max-width:1440px;margin-inline:auto}

  /* Product/basket/checkout dialogs remain fully within the browser viewport. */
  :where(.product-modal,.basket-modal,.checkout-modal){max-width:calc(100vw - 48px)!important}
  :where(.product-modal,.basket-modal,.checkout-modal) :where(.modal-content,.product-modal-card,.basket-sheet,.checkout-sheet){max-height:calc(100dvh - 48px)!important}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
