/*
 * GAINVO Storefront v0.10.57 — Responsive Typography Foundation
 * Phase: cross-device type scale audit and correction.
 *
 * Goals:
 * - Keep mobile hierarchy closer to modern commerce apps: product/content first,
 *   typography compact and calm, controls readable.
 * - Scale progressively from small phones to tablets/desktop without abrupt jumps.
 * - Preserve 16px form controls on phones to avoid Safari focus zoom.
 * - Preserve browser/user text zoom and 200% resize/reflow capability.
 */

:root{
  /* Fluid scale: each token has a readable floor and a restrained ceiling. */
  --gv-type-2xs:clamp(.625rem,calc(.59rem + .14vw),.72rem);
  --gv-type-xs:clamp(.6875rem,calc(.65rem + .17vw),.79rem);
  --gv-type-sm:clamp(.75rem,calc(.70rem + .23vw),.875rem);
  --gv-type-md:clamp(.8125rem,calc(.76rem + .28vw),.95rem);
  --gv-type-body:clamp(.875rem,calc(.82rem + .26vw),1rem);
  --gv-type-lg:clamp(1rem,calc(.93rem + .36vw),1.15rem);
  --gv-type-section:clamp(1.125rem,calc(1.02rem + .55vw),1.38rem);
  --gv-type-page:clamp(1.45rem,calc(1.28rem + .9vw),2rem);
  --gv-type-display:clamp(1.65rem,calc(1.42rem + 1.25vw),2.35rem);
  --gv-type-price:clamp(.95rem,calc(.88rem + .35vw),1.08rem);
  --gv-type-card-title:clamp(.76rem,calc(.71rem + .24vw),.875rem);
  --gv-type-card-meta:clamp(.66rem,calc(.62rem + .18vw),.75rem);
  --gv-type-nav:clamp(.66rem,calc(.62rem + .17vw),.75rem);
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  font-size:var(--gv-type-body)!important;
  line-height:1.45!important;
  font-kerning:normal;
  font-optical-sizing:auto;
}

/* Inputs stay at 16px on touch phones: prevents iOS Safari auto-zoom on focus. */
@media (max-width:759px){
  input,select,textarea{font-size:1rem!important}
}

/* --------------------------------------------------------------------------
   Global semantic hierarchy
   -------------------------------------------------------------------------- */
.micro,.eyebrow,.home-eyebrow,.hero-kicker,.promo-badge,.page-title-badge,
.merchant-eyebrow,.product-badge,.stock-chip,.service-tag,.status,
.customer-order-subtitle,.customer-order-status{
  font-size:var(--gv-type-xs)!important;
  line-height:1.25!important;
}

.section-head h2,
.search-group-head h2,
.merchant-catalogue-heading h2,
.account-section-head h2,
.orders-section-title,
.shop-section-heading{
  font-size:var(--gv-type-section)!important;
  line-height:1.12!important;
  letter-spacing:-.025em!important;
  text-wrap:balance;
}

.page-title-row h1,.page-title-v3 h1,.search-topline h1,
.shops-directory-head h1,.account-hero h1,.merchant-name-row h1,
.orders-hero h1,.favourites-title-row h1{
  font-size:var(--gv-type-page)!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
  text-wrap:balance;
}

.hero-copy h1,.commerce-intro h1{
  font-size:var(--gv-type-display)!important;
  line-height:1.03!important;
  letter-spacing:-.04em!important;
  text-wrap:balance;
}

.hero-copy p,.page-title-row p,.page-title-v3 p,.commerce-intro p,
.empty-state p,.shop-description,.account-hero p{
  font-size:var(--gv-type-body)!important;
  line-height:1.5!important;
}

.text-button,.home-see-all,.result-action{
  font-size:var(--gv-type-sm)!important;
  line-height:1.2!important;
}

/* --------------------------------------------------------------------------
   Header + location + search
   -------------------------------------------------------------------------- */
.brand span{font-size:clamp(.88rem,calc(.82rem + .28vw),1rem)!important}
.home-brand-location strong,.location-pill strong{
  font-size:clamp(.75rem,calc(.70rem + .25vw),.875rem)!important;
  line-height:1.15!important;
}
.location-pill small,.home-brand-location small{font-size:var(--gv-type-xs)!important}

.search-box input,.home-search-v3 input,.shops-search input,
.search-screen-v4 input[type="search"]{
  font-size:1rem!important;
  line-height:1.3!important;
}
.search-box input::placeholder,.home-search-v3 input::placeholder,
.shops-search input::placeholder,.search-screen-v4 input[type="search"]::placeholder{
  font-size:clamp(.875rem,calc(.82rem + .25vw),1rem)!important;
}

/* --------------------------------------------------------------------------
   Category/navigation labels
   -------------------------------------------------------------------------- */
.category-tile strong,.category-chip strong{
  font-size:clamp(.69rem,calc(.65rem + .2vw),.79rem)!important;
  line-height:1.15!important;
  font-weight:750!important;
}
.home-v0911 .home-category-rail-approved .category-tile strong{
  font-size:clamp(.69rem,calc(.65rem + .2vw),.79rem)!important;
  line-height:1.15!important;
  max-width:100%!important;
  min-height:2.3em!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  white-space:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.filter-pill,.search-chip,.shop-filter-chip,.merchant-filter-pill{
  font-size:var(--gv-type-sm)!important;
  line-height:1.15!important;
}
.bottom-nav .nav-item small,.nav-item small{
  font-size:var(--gv-type-nav)!important;
  line-height:1.05!important;
  font-weight:700!important;
}

/* --------------------------------------------------------------------------
   Product cards — the main mismatch seen in the mobile audit.
   Names remain clear but do not dominate the image/card.
   -------------------------------------------------------------------------- */
.product-card .product-title,.product-card-v7 .product-title,
.product-card .product-title-link,.product-card-v7 .product-title-link,
.home-product-grid .product-title,.search-product-grid .product-title,
.shop-product-grid .product-title{
  font-size:var(--gv-type-card-title)!important;
  line-height:1.2!important;
  font-weight:760!important;
  letter-spacing:-.01em!important;
  min-height:2.4em!important;
  max-height:2.4em!important;
  margin:0 0 .32rem!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
}
.product-card .product-shop-row,.product-card-v7 .product-shop-row,
.home-product-grid .product-shop-row,.search-product-grid .product-shop-row,
.shop-product-grid .product-shop-row{
  font-size:var(--gv-type-card-meta)!important;
  line-height:1.15!important;
  font-weight:620!important;
  margin-bottom:.25rem!important;
}
.product-card .product-meta-line,.product-card-v7 .product-meta-line,
.home-product-grid .product-meta-line,.search-product-grid .product-meta-line,
.shop-product-grid .product-meta-line{
  font-size:var(--gv-type-card-meta)!important;
  line-height:1.15!important;
  margin-bottom:.35rem!important;
}
.product-card .product-price,.product-card-v7 .product-price,
.home-product-grid .product-price,.search-product-grid .product-price,
.shop-product-grid .product-price{
  font-size:var(--gv-type-price)!important;
  line-height:1!important;
  font-weight:850!important;
  letter-spacing:-.02em!important;
}
.product-card .product-price small,.product-card-v7 .product-price small,
.product-price-sale del{font-size:var(--gv-type-card-meta)!important}
.product-badge,.home-product-grid .product-badge,
.search-product-grid .product-badge,.shop-product-grid .product-badge{
  font-size:var(--gv-type-xs)!important;
  font-weight:750!important;
}

/* Home-specific density: two cards should feel like a commerce feed, not tiles. */
@media (max-width:759px){
  .home-v0911 .section-head h2{font-size:var(--gv-type-section)!important}
  .home-v0911 .section-head .micro{font-size:var(--gv-type-xs)!important}
  .home-v0911 .text-button,.home-v0911 .home-see-all{font-size:var(--gv-type-sm)!important}
  .home-v0911 .home-product-grid .product-body{
    min-height:112px!important;
    padding:8px!important;
  }
  .home-v0911 .home-product-grid .product-title{
    min-height:2.4em!important;
    max-height:2.4em!important;
  }
  .home-v0911 .home-product-grid .product-save-card{
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
  }
  .home-v0911 .home-product-grid .mini-add{
    width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  }
}

/* Shops/directories. */
.shop-card-v2 .shop-meta h3,.shop-meta h3,.shop-heading-line h2{
  font-size:clamp(.78rem,calc(.73rem + .25vw),.92rem)!important;
  line-height:1.2!important;
  font-weight:760!important;
}
.shop-card-v2 .shop-meta p,.shop-card-v2 .shop-card-foot,.shop-meta p,
.shops-directory-summary,.shop-description{
  font-size:var(--gv-type-sm)!important;
  line-height:1.35!important;
}

/* Search result list. */
.result-copy h3,.search-result-title{
  font-size:clamp(.78rem,calc(.73rem + .25vw),.92rem)!important;
  line-height:1.2!important;
  font-weight:760!important;
}
.result-copy p,.search-result-meta,.search-summary,.search-summary-v4{
  font-size:var(--gv-type-sm)!important;
  line-height:1.35!important;
}

/* Merchant/shop page. */
.merchant-name-row h1{font-size:clamp(1.3rem,calc(1.18rem + .65vw),1.7rem)!important}
.merchant-catalogue-heading h2{font-size:var(--gv-type-section)!important}
.merchant-shop-info-head h3{font-size:var(--gv-type-lg)!important}
.merchant-title-copy>p,.merchant-commerce-summary strong{font-size:var(--gv-type-sm)!important}
.merchant-commerce-summary small,.merchant-status-row-v8>span,.merchant-status-row-v8>button{
  font-size:var(--gv-type-xs)!important;
}

/* Product details: product title is important, but no mobile billboard typography. */
.pdp-heading-v9 h2,.product-modal h2,.product-detail-title{
  font-size:clamp(1.28rem,calc(1.15rem + .7vw),1.7rem)!important;
  line-height:1.08!important;
  letter-spacing:-.025em!important;
  text-wrap:balance;
}
.pdp-price-row-v9 .pdp-price,.product-detail-price{
  font-size:clamp(1.25rem,calc(1.13rem + .62vw),1.65rem)!important;
  line-height:1!important;
}
.pdp-heading-v9 p,.pdp-meta,.product-detail-meta{font-size:var(--gv-type-sm)!important}

/* Basket / checkout / modal sheets. */
.cart-sheet .sheet-head h2,.checkout-sheet .sheet-head h2,
.customer-account-sheet .sheet-head h2,.account-editor-sheet .sheet-head h2,
.shop-map-sheet .sheet-head h2,.location-dialog h2,.ad-detail-sheet .sheet-head h2{
  font-size:clamp(1.2rem,calc(1.08rem + .58vw),1.55rem)!important;
  line-height:1.1!important;
  letter-spacing:-.025em!important;
}
.cart-total strong,.checkout-total strong{font-size:var(--gv-type-lg)!important}
.cart-line-title,.checkout-line-title{font-size:var(--gv-type-md)!important}
.cart-line-meta,.checkout-helper,.checkout-label{font-size:var(--gv-type-sm)!important}

/* Orders + account. */
.customer-order-total strong,.order-total strong{font-size:var(--gv-type-lg)!important}
.customer-order-lines>div,.customer-order-total span,.customer-order-help,
.order-step strong,.order-step small{font-size:var(--gv-type-sm)!important}
.account-hero-v2 h1{font-size:clamp(1.25rem,calc(1.13rem + .62vw),1.65rem)!important}
.account-section-head h2{font-size:var(--gv-type-section)!important}
.settings-card-v2 strong,.account-highlights strong{font-size:var(--gv-type-md)!important}
.settings-card-v2 small,.account-highlights small{font-size:var(--gv-type-sm)!important}

/* --------------------------------------------------------------------------
   Small-phone safeguards (320–359 CSS px)
   -------------------------------------------------------------------------- */
@media (max-width:359px){
  :root{
    --gv-type-section:1.08rem;
    --gv-type-page:1.35rem;
    --gv-type-display:1.52rem;
    --gv-type-card-title:.73rem;
    --gv-type-price:.91rem;
    --gv-type-card-meta:.64rem;
  }
  .home-v0911 .home-category-rail-approved{grid-auto-columns:74px!important}
  .home-v0911 .home-category-rail-approved .category-tile strong{font-size:.67rem!important}
  .home-v0911 .home-product-grid{grid-auto-columns:clamp(132px,43vw,148px)!important}
  .bottom-nav .nav-item small,.nav-item small{font-size:.64rem!important}
}

/* --------------------------------------------------------------------------
   Large phones / tablets: increase gently, not proportionally to viewport.
   -------------------------------------------------------------------------- */
@media (min-width:430px) and (max-width:759px){
  :root{
    --gv-type-section:clamp(1.22rem,4.8vw,1.42rem);
    --gv-type-card-title:clamp(.81rem,3.15vw,.9rem);
    --gv-type-price:clamp(1rem,3.7vw,1.1rem);
  }
}

@media (min-width:760px) and (max-width:1023px){
  :root{
    --gv-type-body:.95rem;
    --gv-type-section:1.42rem;
    --gv-type-page:2rem;
    --gv-type-display:2.5rem;
    --gv-type-card-title:.9rem;
    --gv-type-card-meta:.75rem;
    --gv-type-price:1.08rem;
  }
}

/* Desktop: larger headings are allowed, but card type stays restrained. */
@media (min-width:1024px){
  :root{
    --gv-type-body:1rem;
    --gv-type-section:clamp(1.35rem,1.1rem + .45vw,1.72rem);
    --gv-type-page:clamp(2rem,1.55rem + .9vw,2.8rem);
    --gv-type-display:clamp(2.5rem,1.9rem + 1.25vw,3.6rem);
    --gv-type-card-title:.92rem;
    --gv-type-card-meta:.75rem;
    --gv-type-price:1.08rem;
    --gv-type-nav:.75rem;
  }
}

/* Reflow/accessibility: do not lock text containers to fixed heights at zoom. */
@media (min-resolution:1.5dppx){
  .product-card .product-title,.product-card-v7 .product-title,
  .home-product-grid .product-title,.search-product-grid .product-title,
  .shop-product-grid .product-title{height:auto!important}
}

@media (prefers-reduced-motion:reduce){
  *{text-rendering:optimizeLegibility}
}
