/* GAINVO Storefront v0.10.22 — Favourites parity correction
   Goal: Favourites must inherit the same installed-app header geometry and
   the same product-card visual language as the approved Home discovery rail. */

/* ---------- Page rhythm ---------- */
.favourites-screen-native{
  padding-top:0!important;
  padding-bottom:calc(var(--bottom-nav-space,94px) + env(safe-area-inset-bottom) + 20px)!important;
}
.favourites-native-head{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-height:0!important;
  margin:0 0 16px!important;
  padding:18px 0 14px!important;
  border-bottom:1px solid var(--border,#dfe7ec)!important;
}
.favourites-native-head>div{min-width:0!important;}
.favourites-native-head .micro{
  margin:0 0 5px!important;
  color:var(--teal,#0b978a)!important;
  font-size:clamp(.72rem,.69rem + .12vw,.8rem)!important;
  line-height:1.15!important;
  letter-spacing:.13em!important;
  font-weight:900!important;
}
.favourites-native-head h1{
  margin:0!important;
  color:var(--ink,#0e2f50)!important;
  font-size:clamp(1.42rem,5.4vw,1.8rem)!important;
  line-height:1.06!important;
  letter-spacing:-.025em!important;
  font-weight:900!important;
}
.favourites-head-count{
  align-self:center!important;
  min-height:36px!important;
  padding:0 12px!important;
  border-radius:999px!important;
  font-size:.8rem!important;
  font-weight:850!important;
}

/* ---------- Product-card parity with Home ---------- */
.favourites-product-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  align-items:stretch!important;
  width:100%!important;
}
.favourites-product-grid>.product-card,
.favourites-product-grid>.product-card-v7{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  margin:0!important;
  overflow:hidden!important;
  border-radius:17px!important;
  box-shadow:0 4px 15px rgba(15,49,88,.04)!important;
}
.favourites-product-grid .product-media-wrap,
.favourites-product-grid .product-image{
  width:100%!important;
  min-width:0!important;
}
.favourites-product-grid .product-image{aspect-ratio:1.08/1!important;}
.favourites-product-grid .product-body{
  display:flex!important;
  flex-direction:column!important;
  min-height:132px!important;
  padding:10px!important;
}
.favourites-product-grid .product-title{
  min-height:34px!important;
  max-height:36px!important;
  margin:0 0 5px!important;
  font-size:clamp(.8125rem,.78rem + .13vw,.9rem)!important;
  line-height:1.28!important;
}
.favourites-product-grid .product-shop-row{
  min-height:16px!important;
  margin:0 0 6px!important;
  font-size:clamp(.72rem,.69rem + .1vw,.78rem)!important;
}
.favourites-product-grid .product-shop-row>span{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.favourites-product-grid .product-meta-line{
  min-height:15px!important;
  margin:0 0 7px!important;
  font-size:clamp(.7rem,.68rem + .08vw,.75rem)!important;
}
.favourites-product-grid .product-price-row{
  margin-top:auto!important;
  gap:6px!important;
  align-items:center!important;
}
.favourites-product-grid .product-price{
  min-width:0!important;
  font-size:clamp(.94rem,.9rem + .16vw,1.04rem)!important;
  line-height:1.05!important;
  white-space:nowrap!important;
}
.favourites-product-grid .product-price small,
.favourites-product-grid .product-price-sale del{font-size:.7rem!important;}
.favourites-product-grid .mini-add{
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  border-radius:13px!important;
  background:#10a68f!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(16,166,143,.18)!important;
}
.favourites-product-grid .mini-add svg{stroke:#fff!important;}
.favourites-product-grid .product-save-card{
  width:40px!important;
  min-width:40px!important;
  height:40px!important;
  min-height:40px!important;
  border-radius:13px!important;
}
/* Keep saved hearts unmistakably red on the dedicated Favourites page. */
.favourites-product-grid .product-save-card.is-saved{
  background:var(--gainvo-like,#e52d45)!important;
  border-color:var(--gainvo-like,#e52d45)!important;
  color:#fff!important;
}
.favourites-product-grid .product-save-card.is-saved svg{
  fill:currentColor!important;
  stroke:currentColor!important;
}

/* ---------- Dark theme: exactly the same card language as Home ---------- */
html[data-theme="dark"] .favourites-native-head{border-bottom-color:#26343f!important;}
html[data-theme="dark"] .favourites-native-head h1{color:#f5f8fb!important;}
html[data-theme="dark"] .favourites-native-head .micro{color:#32c7b3!important;}
html[data-theme="dark"] .favourites-head-count{
  background:#0d1b24!important;
  border-color:#29404d!important;
  color:#a9bbc8!important;
}
html[data-theme="dark"] .favourites-product-grid>.product-card,
html[data-theme="dark"] .favourites-product-grid>.product-card-v7{
  background:#111b24!important;
  border-color:#26343f!important;
  color:#f5f8fb!important;
  box-shadow:0 6px 18px rgba(0,0,0,.2)!important;
}
html[data-theme="dark"] .favourites-product-grid .product-media-wrap,
html[data-theme="dark"] .favourites-product-grid .product-image{background:#eef2f4!important;}
html[data-theme="dark"] .favourites-product-grid .product-title{color:#f5f8fb!important;}
html[data-theme="dark"] .favourites-product-grid .product-shop-row,
html[data-theme="dark"] .favourites-product-grid .product-meta-line{color:#91a3b1!important;}
html[data-theme="dark"] .favourites-product-grid .product-price{color:#f7fafc!important;}
html[data-theme="dark"] .favourites-product-grid .product-price small{color:#91a3b1!important;}
html[data-theme="dark"] .favourites-product-grid .product-badge{
  background:#14342d!important;
  color:#8be4cc!important;
  border-color:#285448!important;
}
html[data-theme="dark"] .favourites-product-grid .is-discounted .product-badge{
  background:#d92b42!important;
  color:#fff!important;
  border-color:#e64a5d!important;
}
html[data-theme="dark"] .favourites-product-grid .product-save-card:not(.is-saved){
  background:rgba(13,23,31,.94)!important;
  color:#f5f8fb!important;
  border-color:#32424f!important;
  box-shadow:0 3px 10px rgba(0,0,0,.24)!important;
}
html[data-theme="dark"] .favourites-product-grid .mini-add{
  background:#10a68f!important;
  color:#fff!important;
}

/* ---------- Installed mobile header parity ----------
   Explicitly lock Favourites to the same geometry used on Home. This is a
   final authority layer so page-specific legacy rules cannot move the header. */
@media(max-width:759px){
  body:has(.favourites-screen-native.active) .topbar{
    position:sticky!important;
    inset:auto!important;
    top:0!important;
    left:auto!important;
    right:auto!important;
    z-index:65!important;
    display:block!important;
    width:100%!important;
    max-width:none!important;
    height:var(--gainvo-mobile-header-h,52px)!important;
    min-height:var(--gainvo-mobile-header-h,52px)!important;
    max-height:var(--gainvo-mobile-header-h,52px)!important;
    margin:0!important;
    padding:4px 10px!important;
    box-sizing:border-box!important;
    transform:none!important;
    overflow:visible!important;
  }
  body:has(.favourites-screen-native.active) .topbar .brand-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
    width:100%!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    margin:0!important;
    padding:0!important;
  }
  body:has(.favourites-screen-native.active) .topbar .brand-stack{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    width:auto!important;
    min-width:0!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    margin:0!important;
    padding:0!important;
  }
  body:has(.favourites-screen-native.active) .topbar .brand{
    flex:0 0 var(--gainvo-mobile-logo,28px)!important;
    width:var(--gainvo-mobile-logo,28px)!important;
    min-width:var(--gainvo-mobile-logo,28px)!important;
    max-width:var(--gainvo-mobile-logo,28px)!important;
    height:var(--gainvo-mobile-logo,28px)!important;
    min-height:var(--gainvo-mobile-logo,28px)!important;
    max-height:var(--gainvo-mobile-logo,28px)!important;
    margin:0!important;
    padding:0!important;
  }
  body:has(.favourites-screen-native.active) .topbar .brand .brand-mark{
    width:var(--gainvo-mobile-logo,28px)!important;
    min-width:var(--gainvo-mobile-logo,28px)!important;
    max-width:var(--gainvo-mobile-logo,28px)!important;
    height:var(--gainvo-mobile-logo,28px)!important;
    min-height:var(--gainvo-mobile-logo,28px)!important;
    max-height:var(--gainvo-mobile-logo,28px)!important;
    border-radius:8px!important;
  }
  body:has(.favourites-screen-native.active) .topbar .home-brand-location{
    position:static!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    flex:0 1 auto!important;
    min-width:0!important;
    max-width:min(50vw,190px)!important;
    width:auto!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    margin:0!important;
    padding:0!important;
    gap:4px!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body:has(.favourites-screen-native.active) .topbar .home-brand-location strong{
    font-size:12px!important;
    line-height:1!important;
    font-weight:800!important;
  }
  body:has(.favourites-screen-native.active) .topbar .top-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:4px!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    margin:0!important;
    padding:0!important;
  }
  body:has(.favourites-screen-native.active) .topbar .top-actions .icon-button{
    width:var(--gainvo-mobile-action-hit,44px)!important;
    min-width:var(--gainvo-mobile-action-hit,44px)!important;
    max-width:var(--gainvo-mobile-action-hit,44px)!important;
    height:var(--gainvo-mobile-action-hit,44px)!important;
    min-height:var(--gainvo-mobile-action-hit,44px)!important;
    max-height:var(--gainvo-mobile-action-hit,44px)!important;
    margin:0!important;
    padding:0!important;
    border-radius:12px!important;
  }
}

@media(display-mode:standalone) and (max-width:759px){
  body:has(.favourites-screen-native.active) .topbar{
    position:fixed!important;
    inset:auto 0 auto 0!important;
    top:var(--gainvo-mobile-status-safe,env(safe-area-inset-top,0px))!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:4px 10px!important;
  }
}
@supports(-webkit-touch-callout:none){
  @media(max-width:759px){
    html.gainvo-standalone body:has(.favourites-screen-native.active) .topbar{
      position:fixed!important;
      inset:auto 0 auto 0!important;
      top:var(--gainvo-mobile-status-safe,env(safe-area-inset-top,0px))!important;
      left:0!important;
      right:0!important;
      width:100%!important;
      max-width:none!important;
      margin:0!important;
      padding:4px 10px!important;
    }
  }
}

@media(max-width:350px){
  .favourites-product-grid{gap:8px!important;}
  .favourites-product-grid .product-body{padding:9px!important;min-height:128px!important;}
  .favourites-product-grid .product-title{font-size:.8125rem!important;}
  .favourites-product-grid .product-price{font-size:.9375rem!important;}
  .favourites-native-head{padding-top:15px!important;}
}
@media(min-width:520px) and (max-width:699px){
  .favourites-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;}
}
@media(min-width:700px){
  .favourites-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;}
}
@media(min-width:1024px){
  .favourites-product-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important;}
}
@media(prefers-reduced-motion:reduce){
  .favourites-product-grid .product-card-v7{transition:none!important;}
}
