/* GAINVO Storefront v0.10.23 — universal mobile header parity
   Home is the reference. Every primary storefront screen must use the same
   logo/location/actions geometry and the same cart count badge placement. */

@media (max-width:759px){
  :root{
    --gainvo-mobile-header-h:52px;
    --gainvo-mobile-logo:28px;
    --gainvo-mobile-action-hit:44px;
    --gainvo-mobile-action-icon:20px;
    --gainvo-mobile-status-safe:env(safe-area-inset-top,0px);
  }

  body .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)!important;
    min-height:var(--gainvo-mobile-header-h)!important;
    max-height:var(--gainvo-mobile-header-h)!important;
    margin:0!important;
    padding:4px 10px!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    transform:none!important;
    contain:none!important;
  }

  body .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 .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 .topbar .brand{
    position:static!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 var(--gainvo-mobile-logo)!important;
    width:var(--gainvo-mobile-logo)!important;
    min-width:var(--gainvo-mobile-logo)!important;
    max-width:var(--gainvo-mobile-logo)!important;
    height:var(--gainvo-mobile-logo)!important;
    min-height:var(--gainvo-mobile-logo)!important;
    max-height:var(--gainvo-mobile-logo)!important;
    margin:0!important;
    padding:0!important;
    gap:0!important;
    transform:none!important;
  }

  body .topbar .brand .brand-mark{
    display:block!important;
    width:var(--gainvo-mobile-logo)!important;
    min-width:var(--gainvo-mobile-logo)!important;
    max-width:var(--gainvo-mobile-logo)!important;
    height:var(--gainvo-mobile-logo)!important;
    min-height:var(--gainvo-mobile-logo)!important;
    max-height:var(--gainvo-mobile-logo)!important;
    object-fit:cover!important;
    border-radius:8px!important;
    background:transparent!important;
    filter:none!important;
    opacity:1!important;
    box-shadow:0 2px 6px rgba(3,33,76,.15)!important;
  }

  body .topbar .brand>span{display:none!important;}

  body .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;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    transform:none!important;
    color:var(--ink)!important;
    text-align:left!important;
  }

  body .topbar .home-brand-location>svg:first-child{
    width:12px!important;height:12px!important;min-width:12px!important;flex:0 0 12px!important;
    fill:#16b7a4!important;stroke:#16b7a4!important;
  }
  body .topbar .home-brand-location strong{
    display:block!important;min-width:0!important;margin:0!important;overflow:hidden!important;
    text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important;
    line-height:1!important;font-weight:800!important;letter-spacing:0!important;
  }
  body .topbar .home-location-chevron{
    width:10px!important;height:10px!important;min-width:10px!important;flex:0 0 10px!important;
    margin-left:1px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;opacity:.70!important;
  }

  body .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;flex:0 0 auto!important;transform:none!important;
  }
  body .topbar .top-actions .icon-button{
    position:relative!important;display:grid!important;place-items:center!important;
    width:var(--gainvo-mobile-action-hit)!important;min-width:var(--gainvo-mobile-action-hit)!important;max-width:var(--gainvo-mobile-action-hit)!important;
    height:var(--gainvo-mobile-action-hit)!important;min-height:var(--gainvo-mobile-action-hit)!important;max-height:var(--gainvo-mobile-action-hit)!important;
    margin:0!important;padding:0!important;border-radius:12px!important;transform:none!important;box-shadow:none!important;
  }
  body .topbar .top-action-svg,
  body .topbar #cartBtn .top-action-svg{
    width:var(--gainvo-mobile-action-icon)!important;height:var(--gainvo-mobile-action-icon)!important;
    min-width:var(--gainvo-mobile-action-icon)!important;max-width:var(--gainvo-mobile-action-icon)!important;
    flex:0 0 var(--gainvo-mobile-action-icon)!important;stroke-width:1.8!important;
  }

  /* Homepage cart badge is the reference for every screen. */
  body .topbar .cart-count{
    position:absolute!important;
    top:-2px!important;
    right:-2px!important;
    min-width:17px!important;
    width:auto!important;
    height:17px!important;
    padding:0 4px!important;
    border-radius:999px!important;
    display:grid!important;
    place-items:center!important;
    background:var(--teal,#0a9888)!important;
    color:#fff!important;
    border:2px solid var(--surface-2,#fff)!important;
    font-size:8px!important;
    line-height:17px!important;
    font-weight:900!important;
    box-sizing:border-box!important;
    z-index:3!important;
    transform:none!important;
  }

  /* Keep the heart count aligned consistently too, while preserving its red state. */
  body .topbar .favourites-count{
    position:absolute!important;
    top:-2px!important;
    right:-2px!important;
    min-width:17px!important;
    width:auto!important;
    height:17px!important;
    padding:0 4px!important;
    border-radius:999px!important;
    display:grid!important;
    place-items:center!important;
    color:#fff!important;
    border:2px solid var(--surface-2,#fff)!important;
    font-size:8px!important;
    line-height:17px!important;
    font-weight:900!important;
    box-sizing:border-box!important;
    z-index:3!important;
    transform:none!important;
  }
  body .topbar .favourites-count[hidden]{display:none!important;}

  body .topbar>.location-pill{display:none!important;}

  html[data-theme="dark"] body .topbar .home-brand-location,
  html[data-theme="dark"] body .topbar .home-brand-location strong{color:#f5f8fb!important;}
  html[data-theme="dark"] body .topbar .cart-count,
  html[data-theme="dark"] body .topbar .favourites-count{border-color:#0e1923!important;}
}

/* Standalone: preserve one identical app header directly below the OS safe area. */
@media (display-mode:standalone) and (max-width:759px){
  :root{--installed-header-height:calc(var(--gainvo-mobile-status-safe) + var(--gainvo-mobile-header-h));}
  body .topbar{
    position:fixed!important;
    inset:auto 0 auto 0!important;
    top:var(--gainvo-mobile-status-safe)!important;
    left:0!important;right:0!important;
    width:100%!important;max-width:none!important;
    margin:0!important;padding:4px 10px!important;
  }
  body .app-shell{padding-top:var(--installed-header-height)!important;}
}

@supports(-webkit-touch-callout:none){
  @media(max-width:759px){
    html.gainvo-standalone body .topbar{
      position:fixed!important;
      inset:auto 0 auto 0!important;
      top:var(--gainvo-mobile-status-safe)!important;
      left:0!important;right:0!important;
      width:100%!important;max-width:none!important;
      margin:0!important;padding:4px 10px!important;
    }
    html.gainvo-standalone body .app-shell{padding-top:var(--installed-header-height)!important;}
  }
}
