/*
 * GAINVO Storefront v0.10.13 — Android/iOS certification & consistency layer
 * Step 10: final cross-platform readability, touch, focus, safe-area and
 * large-text resilience. Loaded last so legacy micro-styles cannot regress.
 */

:root{
  /* AA-contrast semantic refinements while preserving the approved brand. */
  --muted:#607389;
  --teal:#0c7f74;
  --gv-cert-touch:44px;
  --gv-cert-touch-coarse:48px;
  --gv-cert-info:clamp(.75rem,.73rem + .08vw,.8125rem);
}

/* Keyboard users get a real route past persistent app chrome. */
.gainvo-skip-link{
  position:fixed;
  top:max(10px,var(--gv-safe-top,0px));
  left:max(10px,var(--gv-safe-left,0px));
  z-index:2147483001;
  transform:translateY(-160%);
  border:2px solid currentColor;
  border-radius:12px;
  background:var(--surface,#fff);
  color:var(--ink,#10233f);
  padding:10px 14px;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  font-size:.875rem;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 12px 30px rgba(15,49,88,.18);
}
.gainvo-skip-link:focus{transform:none}

/* Final readable floor for customer-facing supporting information that still
   inherits historic 7–11px rules from app.css. Counter dots remain exempt. */
body small{font-size:var(--gv-cert-info)!important;line-height:1.35!important}
:where(.status,.product-badge,.modal-badge,.verified-copy,.verified-pill,.promo-badge,.service-tag){font-size:var(--gv-cert-info)!important;line-height:1.3!important}
.location-pill small,
.install-copy span,
.product-badge,
.modal-badge,
.verified-copy,
.fulfilment-mini span,
.shop-trust-card p,
.cart-security-note p,
.checkout-preview-card p,
.gpm-attribution,
.shop-map-note,
.shop-map-fallback span,
.install-banner .install-copy span{
  font-size:var(--gv-cert-info)!important;
  line-height:1.35!important;
}

.location-pill strong,
.shop-trust-card strong,
.fulfilment-card strong,
.checkout-preview-card h3{
  font-size:clamp(.8125rem,.79rem + .1vw,.875rem)!important;
  line-height:1.3!important;
}

.fulfilment-card span,
.result-copy p,
.merchant-link small,
.config-head small,
.fulfilment-option small,
.quantity-row small,
.merchant-confidence p{
  font-size:var(--gv-cert-info)!important;
  line-height:1.4!important;
}

/* Do not let installation/header/system controls fall below the app scale. */
.install-banner .install-copy strong{font-size:.875rem!important;line-height:1.25!important}
.install-action,.install-dismiss,.system-state-banner button{font-size:.875rem!important}
.home-brand-location strong{font-size:.8125rem!important;line-height:1.2!important}
.desktop-nav button{font-size:.875rem!important}

/* Base native target. Visual glyphs may remain smaller inside this hit area. */
.icon-button,.close-button,.glass-action,.modal-close,
.install-action,.install-dismiss,.system-state-banner button,
.home-brand-location,.location-pill,.text-button,
.primary-cta,.secondary-cta,.search-action,.clear-search,
.filter-pill,.shop-filter-row button,.category-chip,
.gpm-controls button,.gpm-marker,.shop-map-actions a,.shop-map-actions button{
  min-height:var(--gv-cert-touch)!important;
}
.icon-button,.close-button,.glass-action,.modal-close,.install-dismiss,
.gpm-controls button,.gpm-marker{
  min-width:var(--gv-cert-touch)!important;
}

/* Android accessibility guidance is 48dp; coarse pointers also cover iPhone
   finger input and are intentionally given the same generous target floor. */
@media (pointer:coarse){
  .icon-button,.close-button,.glass-action,.modal-close,
  .install-action,.install-dismiss,.system-state-banner button,
  .home-brand-location,.location-pill,.text-button,
  .primary-cta,.secondary-cta,.search-action,.clear-search,
  .filter-pill,.shop-filter-row button,.category-chip,
  .nav-item,.mini-add,.qty-control button,
  .gpm-controls button,.gpm-marker,.shop-map-actions a,.shop-map-actions button{
    min-height:var(--gv-cert-touch-coarse)!important;
  }
  .icon-button,.close-button,.glass-action,.modal-close,.install-dismiss,
  .mini-add,.qty-control button,.gpm-controls button,.gpm-marker{
    min-width:var(--gv-cert-touch-coarse)!important;
  }
}

/* Large text and narrow-window certification: reflow rather than compress. */
@media (max-width:360px){
  .install-banner{grid-template-columns:auto minmax(0,1fr) auto!important}
  .install-banner .install-dismiss{grid-column:3;grid-row:1}
  .install-banner .install-action{grid-column:2/4;width:100%;margin-top:4px}
  .fulfilment-card-row{grid-template-columns:1fr!important}
  .fulfilment-card:last-child{grid-column:auto!important}
  .shop-map-actions{grid-template-columns:1fr!important}
  .desktop-search-result{grid-template-columns:52px minmax(0,1fr)!important}
  .desktop-search-result-arrow{display:none!important}
}

@media (max-width:759px){
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{
    font-size:1rem!important;
  }
  .topbar,.main,.bottom-nav{
    padding-left:max(var(--gv-safe-left,0px),12px);
    padding-right:max(var(--gv-safe-right,0px),12px);
  }
  .bottom-nav{
    padding-bottom:max(calc(6px + var(--gv-safe-bottom,0px)),10px)!important;
  }
}

/* Edge-to-edge landscape/foldable windows keep controls out of hardware and
   system gesture regions while allowing visual surfaces to extend naturally. */
@media (orientation:landscape) and (max-height:520px){
  .topbar{padding-top:max(8px,var(--gv-safe-top,0px))!important}
  .main{padding-bottom:calc(var(--gv-mobile-nav-h,68px) + var(--gv-safe-bottom,0px) + 12px)!important}
  .cart-sheet,.checkout-sheet,.customer-account-sheet,.account-editor-sheet,
  .ios-install-sheet,.shop-map-card,.location-dialog-card,.product-modal{
    max-height:calc(var(--gv-viewport-height,100dvh) - 6px)!important;
  }
}

/* External keyboard / pointer parity: clear focus, no touch-only ambiguity. */
:where(button,a,input,select,textarea,[role="button"],[role="tab"]):focus-visible{
  outline:3px solid color-mix(in srgb,var(--teal,#0f8f82) 42%,transparent)!important;
  outline-offset:2px!important;
}
@media (hover:hover) and (pointer:fine){
  :where(button,a,[role="button"]):not(:disabled):hover{filter:brightness(.985)}
}

/* OS high-contrast settings retain visible boundaries and states. */
@media (prefers-contrast:more){
  :root{--line:#b6c4d2}
  .product-card,.shop-card,.shop-list-card,.settings-card,.settings-card-v2,
  .result-card,.checkout-preview-card,.account-dashboard-section{
    border-color:#a8b8c8!important;
  }
  .nav-item.active,.filter-pill.active,[aria-selected="true"]{
    outline:2px solid currentColor!important;
    outline-offset:-2px!important;
  }
}

@media (forced-colors:active){
  *,*::before,*::after{box-shadow:none!important}
  .nav-item.active,.filter-pill.active,.choice-button.active,[aria-selected="true"],
  [aria-pressed="true"]{outline:2px solid Highlight!important}
  .gainvo-skip-link{border:2px solid ButtonText}
}

@media (prefers-reduced-motion:reduce){
  .icon-button:active,.close-button:active,.product-card:active,.shop-card:active{
    transform:none!important;
  }
}

/* Dark theme keeps bright teal for text accents, but white-on-teal controls use
   a deeper accessible fill so normal-size labels retain AA contrast. */
html[data-theme="dark"] .primary-cta,
html[data-theme="dark"] .cart-count,
html[data-theme="dark"] .appearance-check{
  background:#0c7f74!important;
  color:#fff!important;
}
