/*
 * GAINVO Storefront v0.10.58 — Cross-device Visual QA & Density Calibration
 * Final responsive calibration after the v0.10.57 typography foundation.
 *
 * Design contract:
 * - Product imagery and content stay visually primary.
 * - Headings are clear but restrained on phones.
 * - Text scales in bounded steps across 320px phones, larger phones, tablets and PC.
 * - Long labels never force card widths or create arbitrary mid-word breaks.
 * - Existing Phase 1–5 scrolling architecture is untouched.
 */

:root{
  --gv-qa-section-title:clamp(1.05rem,calc(1rem + .28vw),1.22rem);
  --gv-qa-page-title:clamp(1.28rem,calc(1.18rem + .52vw),1.62rem);
  --gv-qa-card-title:clamp(.75rem,calc(.71rem + .18vw),.84rem);
  --gv-qa-card-meta:clamp(.66rem,calc(.63rem + .13vw),.73rem);
  --gv-qa-card-price:clamp(.90rem,calc(.85rem + .23vw),1rem);
  --gv-qa-category:clamp(.68rem,calc(.65rem + .14vw),.75rem);
  --gv-qa-nav:clamp(.64rem,calc(.61rem + .13vw),.72rem);
  --gv-qa-gutter:clamp(12px,3.3vw,16px);
}

/* Prevent accidental middle-of-word category/product breaks on compact cards. */
.category-tile strong,
.category-chip strong,
.product-title,
.product-title-link,
.shop-meta h3,
.result-copy h3,
.search-result-title{
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
}

/* --------------------------------------------------------------------------
   PHONE CALIBRATION — visual density aligned to modern marketplace feeds.
   -------------------------------------------------------------------------- */
@media (max-width:759px){
  body:has(.home-v0911.active){
    --gv-home-gutter:var(--gv-qa-gutter)!important;
    --gv-home-section-gap:clamp(18px,4.8vw,22px)!important;
  }

  /* Global mobile headings: clear hierarchy without billboard typography. */
  .section-head h2,
  .search-group-head h2,
  .merchant-catalogue-heading h2,
  .account-section-head h2,
  .orders-section-title,
  .shop-section-heading,
  .shops-section-head h2{
    font-size:var(--gv-qa-section-title)!important;
    line-height:1.12!important;
    letter-spacing:-.025em!important;
  }

  .page-title-row h1,
  .page-title-v3 h1,
  .search-topline h1,
  .shops-directory-head h1,
  .orders-hero h1,
  .favourites-title-row h1{
    font-size:var(--gv-qa-page-title)!important;
    line-height:1.08!important;
  }

  /* Home: tighten first-screen hierarchy and section rhythm. */
  .home-v0911 .section-head{margin-bottom:8px!important;gap:7px!important}
  .home-v0911 .section-head h2{font-size:var(--gv-qa-section-title)!important}
  .home-v0911 .section-head .micro{
    font-size:clamp(.64rem,2.75vw,.71rem)!important;
    letter-spacing:.105em!important;
    margin-bottom:3px!important;
  }
  .home-v0911 .text-button,
  .home-v0911 .home-see-all{
    font-size:clamp(.70rem,2.9vw,.78rem)!important;
    min-height:34px!important;
  }

  /* Categories: keep icons dominant and labels calm; never split Restaurants mid-word. */
  .home-v0911 .home-category-rail-approved{
    grid-auto-columns:clamp(74px,20.5vw,86px)!important;
    gap:8px!important;
  }
  .home-v0911 .home-category-rail-approved .category-tile{
    height:clamp(82px,22vw,90px)!important;
    min-height:clamp(82px,22vw,90px)!important;
    padding:7px 5px!important;
    gap:5px!important;
  }
  .home-v0911 .home-category-rail-approved .category-icon{
    width:clamp(39px,10.8vw,44px)!important;
    height:clamp(39px,10.8vw,44px)!important;
    font-size:clamp(18px,5.2vw,21px)!important;
  }
  .home-v0911 .home-category-rail-approved .category-tile strong{
    font-size:var(--gv-qa-category)!important;
    line-height:1.12!important;
    font-weight:720!important;
    min-height:2.24em!important;
    max-height:2.24em!important;
    max-width:100%!important;
    -webkit-line-clamp:2!important;
  }

  /* Home cards: closer to a commerce feed than dashboard tiles. */
  .home-v0911 .home-product-grid{
    grid-auto-columns:clamp(136px,43.5vw,176px)!important;
    gap:9px!important;
  }
  .home-v0911 .home-product-grid .product-image{
    aspect-ratio:1.16/1!important;
  }
  .home-v0911 .home-product-grid .product-body{
    min-height:108px!important;
    padding:8px!important;
  }
  .home-v0911 .home-product-grid .product-title,
  .product-card-v7 .product-title,
  .product-card-v7 .product-title-link,
  .product-card .product-title,
  .product-card .product-title-link,
  .search-product-grid .product-title,
  .shop-product-grid .product-title,
  .favourites-product-grid .product-title{
    font-size:var(--gv-qa-card-title)!important;
    line-height:1.18!important;
    font-weight:730!important;
    letter-spacing:-.008em!important;
    min-height:2.36em!important;
    max-height:2.36em!important;
    margin:0 0 4px!important;
    -webkit-line-clamp:2!important;
  }
  .home-v0911 .home-product-grid .product-shop-row,
  .product-card-v7 .product-shop-row,
  .product-card .product-shop-row,
  .search-product-grid .product-shop-row,
  .shop-product-grid .product-shop-row,
  .favourites-product-grid .product-shop-row{
    font-size:var(--gv-qa-card-meta)!important;
    line-height:1.15!important;
    font-weight:590!important;
    min-height:1.15em!important;
    margin:0 0 4px!important;
  }
  .home-v0911 .home-product-grid .product-meta-line,
  .product-card-v7 .product-meta-line,
  .product-card .product-meta-line,
  .search-product-grid .product-meta-line,
  .shop-product-grid .product-meta-line,
  .favourites-product-grid .product-meta-line{
    font-size:var(--gv-qa-card-meta)!important;
    line-height:1.15!important;
    min-height:1.15em!important;
    margin:0 0 6px!important;
  }
  .home-v0911 .home-product-grid .product-price,
  .product-card-v7 .product-price,
  .product-card .product-price,
  .search-product-grid .product-price,
  .shop-product-grid .product-price,
  .favourites-product-grid .product-price{
    font-size:var(--gv-qa-card-price)!important;
    line-height:1!important;
    font-weight:800!important;
  }
  .home-v0911 .home-product-grid .product-price small,
  .product-card-v7 .product-price small,
  .product-card .product-price small,
  .product-price-sale del{
    font-size:var(--gv-qa-card-meta)!important;
  }
  .home-v0911 .home-product-grid .product-save-card{
    width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
    border-radius:11px!important;
  }
  .home-v0911 .home-product-grid .mini-add{
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;
    flex-basis:36px!important;
    border-radius:11px!important;
  }
  .home-v0911 .home-product-grid .mini-add .mini-cart-svg,
  .home-v0911 .home-product-grid .mini-cart-svg{width:17px!important;height:17px!important}

  /* Search / shop grid cards use the same hierarchy and no oversized text. */
  .search-screen-v4 .search-product-grid .product-body,
  body[data-active-screen="shop"] .shop-product-grid .product-body,
  .favourites-product-grid .product-body{
    padding:8px!important;
  }

  /* Merchant and PDP titles scale down cleanly on narrow phones. */
  body[data-active-screen="shop"] .merchant-name-row h1,
  .merchant-name-row h1{
    font-size:clamp(1.18rem,calc(1.04rem + .75vw),1.45rem)!important;
    line-height:1.08!important;
    letter-spacing:-.025em!important;
  }
  .pdp-heading-v9 h2,.product-modal h2,.product-detail-title{
    font-size:clamp(1.20rem,calc(1.08rem + .62vw),1.48rem)!important;
    line-height:1.08!important;
  }
  .pdp-price-row-v9 .pdp-price,.product-detail-price{
    font-size:clamp(1.15rem,calc(1.05rem + .50vw),1.40rem)!important;
  }

  /* Basket/checkout/order/account headings stay proportional to the phone. */
  .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.08rem,calc(1rem + .42vw),1.30rem)!important;
  }
  .account-hero-v2 h1,.account-hero h1{
    font-size:clamp(1.16rem,calc(1.05rem + .55vw),1.42rem)!important;
  }

  /* Bottom nav should frame content rather than compete with it. */
  .bottom-nav .nav-item small,.nav-item small{
    font-size:var(--gv-qa-nav)!important;
    line-height:1!important;
    font-weight:650!important;
  }
}

/* --------------------------------------------------------------------------
   DEVICE WIDTH CALIBRATION
   -------------------------------------------------------------------------- */
@media (max-width:359px){
  :root{
    --gv-qa-section-title:1.04rem;
    --gv-qa-page-title:1.24rem;
    --gv-qa-card-title:.72rem;
    --gv-qa-card-meta:.63rem;
    --gv-qa-card-price:.88rem;
    --gv-qa-category:.65rem;
    --gv-qa-nav:.62rem;
  }
  .home-v0911 .home-product-grid{grid-auto-columns:clamp(132px,43.5vw,148px)!important;gap:8px!important}
  .home-v0911 .home-category-rail-approved{grid-auto-columns:72px!important;gap:7px!important}
  .home-v0911 .home-product-grid .product-body{min-height:104px!important;padding:7px!important}
}

@media (min-width:360px) and (max-width:389px){
  :root{
    --gv-qa-section-title:1.08rem;
    --gv-qa-page-title:1.30rem;
    --gv-qa-card-title:.75rem;
    --gv-qa-card-meta:.65rem;
    --gv-qa-card-price:.91rem;
    --gv-qa-category:.68rem;
  }
}

@media (min-width:390px) and (max-width:429px){
  :root{
    --gv-qa-section-title:1.12rem;
    --gv-qa-page-title:1.36rem;
    --gv-qa-card-title:.78rem;
    --gv-qa-card-meta:.67rem;
    --gv-qa-card-price:.94rem;
    --gv-qa-category:.70rem;
  }
}

@media (min-width:430px) and (max-width:599px){
  :root{
    --gv-qa-section-title:1.16rem;
    --gv-qa-page-title:1.42rem;
    --gv-qa-card-title:.80rem;
    --gv-qa-card-meta:.69rem;
    --gv-qa-card-price:.97rem;
    --gv-qa-category:.72rem;
  }
  .home-v0911 .home-product-grid{grid-auto-columns:clamp(160px,42.5vw,184px)!important}
}

@media (min-width:600px) and (max-width:759px){
  :root{
    --gv-qa-section-title:1.22rem;
    --gv-qa-page-title:1.52rem;
    --gv-qa-card-title:.84rem;
    --gv-qa-card-meta:.72rem;
    --gv-qa-card-price:1rem;
    --gv-qa-category:.75rem;
  }
}

/* Tablet: increase hierarchy, but keep card copy compact. */
@media (min-width:760px) and (max-width:1023px){
  .section-head h2,.search-group-head h2,.merchant-catalogue-heading h2,
  .account-section-head h2,.orders-section-title,.shop-section-heading{
    font-size:1.34rem!important;
  }
  .product-card-v7 .product-title,.product-card .product-title,
  .search-product-grid .product-title,.shop-product-grid .product-title{
    font-size:.88rem!important;
    font-weight:740!important;
  }
  .product-card-v7 .product-shop-row,.product-card .product-shop-row,
  .product-card-v7 .product-meta-line,.product-card .product-meta-line{
    font-size:.73rem!important;
  }
}

/* Desktop: avoid scaling cards like marketing headlines. */
@media (min-width:1024px){
  .product-card-v7 .product-title,.product-card .product-title,
  .search-product-grid .product-title,.shop-product-grid .product-title,
  .favourites-product-grid .product-title{
    font-size:.90rem!important;
    font-weight:740!important;
    line-height:1.20!important;
  }
  .product-card-v7 .product-shop-row,.product-card .product-shop-row,
  .product-card-v7 .product-meta-line,.product-card .product-meta-line{
    font-size:.74rem!important;
  }
  .product-card-v7 .product-price,.product-card .product-price{font-size:1.04rem!important}
}

/* Accessibility / text zoom: never enforce fixed text-box heights at enlargement. */
@media (min-resolution:1.5dppx){
  .product-title,.product-title-link,.category-tile strong{height:auto!important}
}
