/*
 * GAINVO Storefront v0.10.4 — Native Application Foundation
 * Step 1: typography, safe areas, viewport, navigation and scrolling.
 * This layer intentionally does not redesign Home or any individual page.
 */

:root{
  --gv-safe-top: env(safe-area-inset-top, 0px);
  --gv-safe-right: env(safe-area-inset-right, 0px);
  --gv-safe-bottom: env(safe-area-inset-bottom, 0px);
  --gv-safe-left: env(safe-area-inset-left, 0px);
  --gv-viewport-height: 100dvh;
  --gv-keyboard-height: 0px;

  /* Readable, bounded type scale. rem minimums preserve browser/user scaling. */
  --gv-text-xs: clamp(.75rem, .72rem + .12vw, .8125rem);   /* 12–13px */
  --gv-text-sm: clamp(.8125rem, .79rem + .12vw, .875rem); /* 13–14px */
  --gv-text-md: clamp(.9375rem, .90rem + .14vw, 1rem);    /* 15–16px */
  --gv-text-base: 1rem;                                   /* 16px */
  --gv-text-lg: clamp(1.0625rem, 1rem + .20vw, 1.1875rem);
  --gv-title-sm: clamp(1.125rem, 1.05rem + .35vw, 1.35rem);
  --gv-title-md: clamp(1.35rem, 1.2rem + .65vw, 1.75rem);
  --gv-title-lg: clamp(1.75rem, 1.45rem + 1.2vw, 2.5rem);

  --gv-touch-min: 44px;
  --gv-mobile-nav-h: 68px;
}

html{
  min-height:100%;
  font-size:100%;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-padding-top:calc(var(--installed-header-height, 0px) + .75rem);
  background:var(--surface-2, #f6f8fb);
}

body{
  min-height:100vh;
  min-height:100svh;
  min-height:var(--gv-viewport-height, 100dvh);
  overflow-x:hidden;
  overflow-x:clip;
  font-size:var(--gv-text-base);
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

.app-shell{
  min-height:100vh;
  min-height:100svh;
  min-height:var(--gv-viewport-height, 100dvh);
  overflow-x:clip;
}

/* Native-feeling interaction: prevent delayed double-tap activation without
   disabling browser zoom or horizontal catalogue rails. */
button,
a,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"]{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

/* Global touch target floor for customer-facing controls. */
@media (pointer:coarse), (max-width:759px){
  button:not(.cart-count),
  a.primary-cta,
  a.secondary-cta,
  [role="button"]{
    min-height:var(--gv-touch-min);
  }

  .icon-button,.close-button,.pdp-back-button,.pdp-icon-button,
  .mini-add,.qty-control button,.nav-item{
    min-width:var(--gv-touch-min);
    min-height:var(--gv-touch-min);
  }
}

/* -------------------------------------------------------------------------
   GLOBAL TYPOGRAPHY NORMALISATION
   No customer-facing informational text should collapse into 7–10px text.
   Decorative badge counters are the only intentional exception.
   ------------------------------------------------------------------------- */
body,
input,
select,
textarea,
button{font-size:var(--gv-text-md)}

p,.hero-copy p,.page-title-row p,.commerce-intro p,.empty-state p,
.shop-list-body p,.account-hero p,.modal-content p{
  font-size:var(--gv-text-sm);
}

.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,
.account-highlight small,.account-highlights small,.settings-card-v2 small,
.account-signin-cta,.shop-card-v2 .shop-card-foot,.shop-card-v2 .shop-meta p,
.location-dialog-status,.merchant-link small,.config-head small,
.fulfilment-option small,.quantity-row small,.merchant-confidence p,
.auth-privacy-copy,.auth-error:not(:empty),.security-point p{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35;
}

.product-title,.result-copy h3,.shop-card-v2 .shop-meta h3,
.settings-card-v2 strong,.account-highlights strong,
.customer-order-lines,.choice-button,.fulfilment-option strong,
.option-group>label,.merchant-link strong,.config-head strong,
.customer-auth-form label,.account-editor-form label,
.auth-merge-choice strong,.editor-check strong,.auth-conversion-note strong,
.security-point strong{
  font-size:var(--gv-text-sm)!important;
}

.product-price,.modal-price{font-size:clamp(1.05rem,1rem + .25vw,1.25rem)!important}
.filter-pill,.search-summary,.result-action,.text-button,.shop-visit-cta{
  font-size:var(--gv-text-sm)!important;
}

.section-head h2,.search-group-head h2,.shop-list-body h2,
.customer-order-head h3,.sheet-head h2{
  font-size:var(--gv-title-sm)!important;
}

.page-title-row h1,.page-title-v3 h1,.page-title-row.page-title-compact h1,
.account-hero-copy h1,.account-hero h1{
  font-size:var(--gv-title-md)!important;
}

/* Inputs must stay >=16px on phones so iOS does not zoom the viewport on focus. */
@media (max-width:759px){
  input,select,textarea,
  .search-box input,.home-search-v3 input,
  .customer-auth-form input:not([type=checkbox]),
  .account-editor-form input:not([type=checkbox]),
  .location-search-box input{
    font-size:1rem!important;
  }
}

/* Bottom navigation is a stable mobile application control surface. */
@media (max-width:759px){
  .bottom-nav{
    min-height:calc(var(--gv-mobile-nav-h) + var(--gv-safe-bottom))!important;
    padding:6px max(8px,var(--gv-safe-right)) calc(6px + var(--gv-safe-bottom)) max(8px,var(--gv-safe-left))!important;
    background:rgba(255,255,255,.97)!important;
    -webkit-backdrop-filter:blur(22px) saturate(150%);
    backdrop-filter:blur(22px) saturate(150%);
    transform:translateX(-50%) translateZ(0);
    will-change:transform;
  }
  .nav-item{
    justify-content:center;
    gap:3px!important;
    padding:4px 2px!important;
    border-radius:12px!important;
  }
  .nav-item small{
    font-size:var(--gv-text-xs)!important;
    line-height:1.05;
    font-weight:760;
  }
  .main{
    padding-bottom:calc(var(--gv-mobile-nav-h) + var(--gv-safe-bottom) + 20px)!important;
  }
  body.gainvo-keyboard-open .bottom-nav{
    visibility:hidden!important;
    pointer-events:none!important;
    transform:translateX(-50%) translateY(110%)!important;
  }
}

/* Safe horizontal gutters on edge-to-edge installed iOS/Android displays. */
@media (max-width:759px){
  .main{
    padding-left:max(12px,var(--gv-safe-left))!important;
    padding-right:max(12px,var(--gv-safe-right))!important;
  }
  body.gainvo-standalone-runtime .app-shell{
    min-height:var(--gv-viewport-height,100dvh)!important;
  }
}

/* Scroll ownership: document is the primary vertical scroll surface; horizontal
   rails remain independently swipeable. */
html,body{overscroll-behavior-x:none}
.category-strip,.shop-rail,.filter-row,.order-timeline{
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
}
.screen{scroll-margin-top:calc(var(--installed-header-height,0px) + .75rem)}

/* Dynamic-viewport sheets. Avoid hidden footers behind the home indicator or
   virtual keyboard while keeping their own intentional internal scrolling. */
@media (max-width:759px){
  .cart-sheet,.checkout-sheet,.customer-account-sheet,.account-editor-sheet,
  .ios-install-sheet,.shop-map-card,.location-dialog-card{
    max-height:calc(var(--gv-viewport-height,100dvh) - var(--gv-safe-top) - 12px)!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .cart-sheet,.checkout-sheet,.customer-account-sheet,.account-editor-sheet,.ios-install-sheet{
    padding-bottom:max(16px,var(--gv-safe-bottom))!important;
  }
  .location-dialog{
    padding-top:max(12px,var(--gv-safe-top))!important;
    padding-right:max(12px,var(--gv-safe-right))!important;
    padding-bottom:max(12px,var(--gv-safe-bottom))!important;
    padding-left:max(12px,var(--gv-safe-left))!important;
  }
}

/* Focus visibility for keyboard / switch users without adding outlines to
   ordinary touch interactions. */
:focus-visible{
  outline:3px solid rgba(10,161,143,.34)!important;
  outline-offset:2px!important;
}

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

/* Large text/zoom resilience: reflow instead of squeezing type. */
@media (max-width:390px){
  .product-grid,.search-product-grid{gap:10px!important}
  .result-card{grid-template-columns:60px minmax(0,1fr)!important}
  .result-action{grid-column:2;justify-self:start}
}

@media (min-width:760px){
  .nav-item small{font-size:var(--gv-text-xs)!important}
}

/* Dark mode is semantic, not a second layout. */
html[data-theme="dark"] .bottom-nav{
  background:rgba(11,20,30,.96)!important;
}

/* -------------------------------------------------------------------------
   LEGACY MICRO-TYPE GUARDRAILS
   Historical Storefront pages accumulated page-specific 5–11px overrides.
   Step 1 neutralises those values at the foundation level. Page refinements
   may change hierarchy later, but they must not go below these readable floors.
   ------------------------------------------------------------------------- */
small{font-size:var(--gv-text-xs)!important;line-height:1.35}

.product-badge,.verified-pill,.result-verified,.result-open,.search-live-badge,
.pdp-stock-badge,.pdp-availability,.merchant-verified,.merchant-status-row>span,
.merchant-status-row-v8>span,.customer-payment-badge,.field-error,.required-copy,
.shops-live-badge,.shop-directory-status,.history-status,.customer-order-status,
.order-complete-banner p,.order-history-dot,.address-label-line span,
.account-status-line span,.cart-count{
  font-size:clamp(.6875rem,.66rem + .08vw,.75rem)!important;
  line-height:1.15;
}

.product-shop-row,.product-shop-row small,.product-card-v7 .product-meta-line,
.home-product-grid .product-shop-row,.search-product-grid .product-shop-row,
.shop-product-grid .product-shop-row,.account-saved-grid .product-shop-row,
.pdp-related-grid .product-shop-row,
.home-product-grid .product-meta-line,.search-product-grid .product-meta-line,
.shop-product-grid .product-meta-line,.account-saved-grid .product-meta-line,
.pdp-related-grid .product-meta-line,
.search-summary-v4,.marketplace-pulse,.marketplace-pulse-v4,.marketplace-pulse-v5,
.home-trust-line,.trust-ribbon small,.merchant-eyebrow,.merchant-category-tags button,
.merchant-section-head>span,.pdp-category,.pdp-unit,.pdp-zoom-hint,.pdp-media-caption,
.pdp-merchant-link small,.pdp-merchant-link em,.pdp-quick-facts span,
.pdp-quick-facts-v8 span,.pdp-accordion dt,.pdp-accordion dd,
.pdp-merchant-confidence p,.service-config-note,.configure-note-v8 span,
.pdp-dock-price small,.receipt-meta span,.receipt-payment small,.receipt-note,
.address-precision,.address-geo-status,.checkout-map-help{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35!important;
}

.category-tile strong,.category-strip-v4 .category-tile strong,
.category-strip-v5 .category-tile strong,.shop-category-tile strong,
.search-place-card>strong,.search-inspiration-copy strong,.shop-discovery-copy strong,
.shops-directory-summary strong,.merchant-service-grid strong,.merchant-trust-strip strong,
.account-saved-shop strong,.address-card strong,.account-empty-inline strong,
.preference-row strong,.account-settings-list strong,.account-trust-panel strong,
.order-history-row strong,.receipt-meta strong,.receipt-payment strong,
.checkout-location-status strong,.checkout-saved-address strong,.pickup-directions-link strong{
  font-size:var(--gv-text-sm)!important;
  line-height:1.3!important;
}

.category-tile small,.shop-category-tile small,.search-place-card>small,
.search-inspiration-copy small,.shop-discovery-copy small,.shop-discovery-copy>span,
.shops-directory-summary small,.shop-directory-chips span,.shop-live-copy,
.merchant-service-grid small,.merchant-trust-strip small,.guest-account-promise small,
.account-summary-row button span,.account-summary-24 button span,.account-summary-24 button small,
.account-summary-26 button span,.account-saved-shop small,.address-card p,
.account-empty-inline p,.preference-row small,.account-settings-list small,
.account-trust-panel p,.order-history-row small,.order-history-row time,
.checkout-saved-address span,.checkout-saved-address small,.checkout-location-status small,
.pickup-directions-link small,.checkout-total-lockup small{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35!important;
}

/* Search foundation */
.search-screen-v4 .search-primary-v4 input,
.shops-screen-v985 .shops-search-box input,
.merchant-shop-search input{
  font-size:1rem!important;
}
.search-screen-v4 .search-kind,.search-screen-v4 .search-tool-pill,
.search-screen-v4 .search-summary-v4,.search-screen-v4 .search-browse-head button,
.search-screen-v4 .search-group-head .micro,.search-screen-v4 .search-group-head>span,
.search-screen-v4 .result-copy p,.search-screen-v4 .result-open,
.search-screen-v4 .result-action,.search-screen-v4 .search-topline .micro,
.search-category-row .filter-pill,.search-kind span,.search-kind .search-kind-count,
.search-discovery-chip{
  font-size:var(--gv-text-xs)!important;
}
.search-screen-v4 .result-copy h3{font-size:var(--gv-text-sm)!important}

/* Shops / merchant foundation */
.shops-screen-v985 .shops-directory-head-v985 p,.shops-screen-v985 .shops-directory-head-v986 p,
.shops-screen-v985 .shops-section-head p,.shops-screen-v985 .shops-section-head .micro,
.shops-screen-v985 .shops-section-head .text-button,.shops-screen-v985 .shop-dir-filter,
.shops-screen-v985 .shop-category-copy,.shops-screen-v985 .shop-directory-offer,
.shops-screen-v985 .shop-list-card-v91 .shop-visit-cta,
.merchant-title-copy>p,.merchant-commerce-summary small,.merchant-section-head .micro,
.merchant-jump-link,.merchant-catalogue-heading .micro,.merchant-about-card p{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35!important;
}
.shops-screen-v985 .shop-directory-name-line h2{font-size:var(--gv-text-lg)!important}
.merchant-commerce-summary strong{font-size:var(--gv-text-sm)!important}

/* Product details foundation */
.pdp-merchant-link strong,.pdp-price small,.pdp-quick-facts strong,
.pdp-quick-facts-v8 strong,.pdp-accordion summary,.pdp-merchant-confidence strong,
.configure-note-v8 strong,.pdp-related-v8 .pdp-section-head button,
.product-modal .pdp-related-v8 .pdp-section-head button,
.product-modal .pdp-purchase-dock-v9 .pdp-add-button{
  font-size:var(--gv-text-sm)!important;
}
.pdp-accordion p{font-size:var(--gv-text-sm)!important;line-height:1.5!important}

/* Checkout / forms */
.checkout-progress,.checkout-total-lockup span,.field-help,.checkout-payment-card p,
.checkout-payment-methods span,.checkout-final-note,.checkout-attention p,.cart-closed-note,
.order-confirmation-banner p,.customer-order-help,.customer-pay-panel p,.customer-pay-email,
.checkout-live-summary p,.checkout-fields label,.checkout-reservation-note p,
.checkout-location-current,.checkout-location-input,.checkout-location-results button,
.checkout-location-results p{
  font-size:var(--gv-text-xs)!important;
  line-height:1.4!important;
}
.customer-pay-button,.order-complete-button{font-size:var(--gv-text-sm)!important}

/* Orders / receipts */
.order-step strong,.order-step small,.screen[data-screen="orders"] .order-step strong,
.screen[data-screen="orders"] .order-step small,.screen[data-screen="orders"] .orders-group-head .micro,
.screen[data-screen="orders"] .orders-group-head p,.screen[data-screen="orders"] .orders-group-head>span,
.screen[data-screen="orders"] .history-order-copy .micro,.screen[data-screen="orders"] .history-order-copy small,
.screen[data-screen="orders"] .history-detail-summary,.order-handover-card p,
.order-history-head strong,.receipt-lines>div,.receipt-total span{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35!important;
}
.screen[data-screen="orders"] .history-order-copy strong,
.screen[data-screen="orders"] .history-order-meta>strong,
.screen[data-screen="orders"] .history-detail-summary strong{
  font-size:var(--gv-text-sm)!important;
}

/* Account / authentication */
.account-screen-v8 .guest-account-hero.account-hero-25 .micro,
.account-screen-v8 .guest-account-hero.account-hero-25 .guest-account-copy>p,
.account-screen-v8 .guest-account-hero.account-hero-25 .guest-account-actions .primary-cta,
.account-screen-v8 .guest-account-hero.account-hero-25 .guest-account-actions .secondary-cta,
.account-screen-v8 .guest-account-hero.account-hero-25 .guest-account-promise strong,
.account-screen-v8 .signed-account-hero.account-hero-26 .micro,
.account-screen-v8 .signed-account-hero.account-hero-26 .account-identity-copy p,
.account-screen-v8 .signed-account-hero.account-hero-26 .account-profile-edit,
.account-screen-v8 .account-overview-26 .account-section-title .micro,
.account-section-title p,.account-section-title>button,.account-profile-edit,
.auth-mode-tabs button,.auth-merge-choice small,.editor-check small,
.auth-conversion-note small,.auth-security-intro p,.account-sync-notice small{
  font-size:var(--gv-text-xs)!important;
  line-height:1.35!important;
}

/* Utility feedback stays readable but visually secondary. */
.toast,.refresh-success,.pull-refresh-native strong,.pull-refresh-copy span,
.install-copy span,.install-action,.quiet-empty,.verified-copy,.info-pill,
.cart-line p,.cart-security-note p{
  font-size:var(--gv-text-xs)!important;
}

/* At high browser zoom / very narrow CSS viewports, reflow cards instead of
   shrinking text below the readable floor. */
@media (max-width:320px){
  .product-grid,.search-product-grid,.home-product-grid,.shop-product-grid,
  .account-saved-grid,.pdp-related-grid{grid-template-columns:1fr!important}
  .shop-list-card,.shop-list-card.shop-list-card-v2{grid-template-columns:1fr!important}
}
