/* =====================================================================
   R10.19.0 — HEADER BALANCE + ACTION CLARITY
   Corrects high-specificity legacy collisions in the public header.
   Keeps every desktop action inside the contained site shell, makes
   Wishlist / Account / Cart truly icon-only, and restores a true cart badge.
   ===================================================================== */
:root{
  --r10190-green:#063f34;
  --r10190-red:#e54a31;
  --r10190-gold:#f4bd38;
  --r10190-ink:#27221e;
  --r10190-line:#eadfd5;
  --r10190-paper:#fffdfa;
}

/* Never let legacy text labels escape compact icon buttons. The anchors already
   carry aria-label/title text, so visible duplicate labels are unnecessary. */
body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-action-label{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
  display:block!important;
}

/* Desktop header is constrained to the visible white shell. This explicitly
   overrides the older 1184px max-width + later oversized grid combination. */
@media (min-width:1261px){
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) > .theme-site-header{
    overflow:visible!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) > .theme-site-header .site-header-inner{
    width:calc(100% - 32px)!important;
    max-width:1248px!important;
    min-height:82px!important;
    margin:0 auto!important;
    padding:8px 0!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:136px minmax(420px,1fr) minmax(180px,218px) auto!important;
    align-items:center!important;
    column-gap:10px!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .brand{
    grid-column:1!important;
    width:136px!important;
    min-width:0!important;
    margin:0!important;
    overflow:visible!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .brand-logo{
    width:auto!important;
    max-width:128px!important;
    height:46px!important;
    object-fit:contain!important;
    object-position:left center!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .brand:after{
    display:none!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header #main-navigation{
    grid-column:2!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-wrap:nowrap!important;
    gap:1px!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header #main-navigation>a,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-nav-more>summary{
    min-height:39px!important;
    padding:0 7px!important;
    border-radius:11px!important;
    font-size:9.3px!important;
    font-weight:850!important;
    letter-spacing:.025em!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-nav-more{
    flex:0 0 auto!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search{
    grid-column:3!important;
    justify-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:218px!important;
    height:44px!important;
    margin:0!important;
    padding:0 10px 0 12px!important;
    display:grid!important;
    grid-template-columns:18px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
    overflow:hidden!important;
    border-radius:14px!important;
    background:#fff!important;
    border:1px solid rgba(6,63,52,.12)!important;
    box-shadow:0 7px 20px rgba(7,52,43,.05)!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search .site-svg-icon{
    width:17px!important;
    height:17px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search span{
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:8.7px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search kbd{
    margin:0!important;
    padding:4px 6px!important;
    font-size:7px!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-actions{
    grid-column:4!important;
    justify-self:end!important;
    align-self:center!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:6px!important;
    white-space:nowrap!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-actions>a{
    margin:0!important;
    flex:0 0 auto!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-phone{
    display:none!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-location{
    width:122px!important;
    max-width:122px!important;
    height:44px!important;
    padding:0 10px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    border-radius:14px!important;
    background:#f8f2e9!important;
    border:1px solid var(--r10190-line)!important;
    color:var(--r10190-green)!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-location span{
    display:block!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:9px!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-icon-link,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill{
    position:relative!important;
    display:grid!important;
    place-items:center!important;
    flex:0 0 44px!important;
    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    padding:0!important;
    gap:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
    border-radius:14px!important;
    background:#fff!important;
    color:var(--r10190-ink)!important;
    border:1px solid var(--r10190-line)!important;
    box-shadow:0 7px 18px rgba(7,55,45,.05)!important;
    text-decoration:none!important;
    font-size:0!important;
    line-height:1!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-icon-link:hover,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-icon-link:focus-visible{
    transform:translateY(-2px)!important;
    color:var(--r10190-red)!important;
    border-color:#e7c9b9!important;
    background:#fff9f3!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill{
    background:linear-gradient(135deg,var(--r10190-red),#f05b39)!important;
    border-color:transparent!important;
    color:#fff!important;
    box-shadow:0 9px 20px rgba(229,74,49,.18)!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-icon-link .site-svg-icon,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill .site-svg-icon{
    display:block!important;
    width:19px!important;
    height:19px!important;
    margin:0!important;
    flex:0 0 19px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-wishlist-link .site-svg-icon{
    fill:currentColor!important;
    fill-opacity:.04!important;
  }

  /* True corner badges — never participate in icon button flow. */
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill .header-cart-count,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-action-badge{
    position:absolute!important;
    z-index:4!important;
    top:-6px!important;
    right:-6px!important;
    left:auto!important;
    bottom:auto!important;
    transform:none!important;
    min-width:19px!important;
    width:auto!important;
    height:19px!important;
    padding:0 5px!important;
    margin:0!important;
    display:grid!important;
    place-items:center!important;
    border:2px solid var(--r10190-paper)!important;
    border-radius:999px!important;
    background:var(--r10190-gold)!important;
    color:#392806!important;
    box-shadow:0 3px 8px rgba(0,0,0,.12)!important;
    font-size:8px!important;
    font-weight:950!important;
    line-height:1!important;
  }

  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-order-now{
    height:44px!important;
    min-width:88px!important;
    padding:0 13px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:14px!important;
    font-size:9px!important;
    font-weight:900!important;
    white-space:nowrap!important;
  }
}

/* Compact desktop: retain all customer actions, but remove duplicated main-header
   Order Now CTA because the yellow announcement bar already exposes it. */
@media (min-width:1261px) and (max-width:1599px){
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) > .theme-site-header .site-header-inner{
    width:calc(100% - 24px)!important;
    max-width:1256px!important;
    grid-template-columns:126px minmax(390px,1fr) minmax(164px,196px) auto!important;
    column-gap:8px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .brand{
    width:126px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .brand-logo{
    max-width:118px!important;
    height:44px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header #main-navigation>a,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-nav-more>summary{
    padding-inline:6px!important;
    font-size:8.8px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search{
    max-width:196px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search kbd{
    display:none!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-location{
    width:112px!important;
    max-width:112px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-order-now{
    display:none!important;
  }
}

/* Slightly wider desktop can keep the CTA while still remaining bounded. */
@media (min-width:1600px){
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) > .theme-site-header .site-header-inner{
    max-width:1460px!important;
    grid-template-columns:140px minmax(455px,1fr) minmax(205px,240px) auto!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-search{
    max-width:240px!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .sf-header-location{
    width:128px!important;
    max-width:128px!important;
  }
}

/* Mobile/tablet inherits the R10.18 collapsed navigation, but ensure cart count
   remains a corner badge and labels cannot reappear. */
@media (max-width:1260px){
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-icon-link,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill{
    font-size:0!important;
    overflow:visible!important;
  }
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .cart-pill .header-cart-count,
  body:not(.admin-app-body):not(.staff-auth-body):not(.install-body) .theme-site-header .header-action-badge{
    position:absolute!important;
    top:-5px!important;
    right:-5px!important;
    min-width:18px!important;
    width:auto!important;
    height:18px!important;
    padding:0 4px!important;
    display:grid!important;
    place-items:center!important;
    border:2px solid #fff!important;
    border-radius:999px!important;
    background:var(--r10190-gold)!important;
    color:#392806!important;
    font-size:8px!important;
    font-weight:950!important;
    line-height:1!important;
    transform:none!important;
  }
  .theme-site-header .sf-nav-more{
    width:100%!important;
  }
  .theme-site-header .sf-nav-more>summary{
    width:100%!important;
    min-height:44px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    color:#fff!important;
    cursor:pointer!important;
  }
  .theme-site-header .sf-nav-more-menu{
    position:static!important;
    width:100%!important;
    margin-top:6px!important;
    box-shadow:none!important;
    border-color:rgba(255,255,255,.12)!important;
    background:rgba(255,255,255,.06)!important;
  }
  .theme-site-header .sf-nav-more-menu a{
    color:#fff!important;
  }
}

@media (prefers-reduced-motion:reduce){
  .theme-site-header .header-icon-link,
  .theme-site-header .cart-pill,
  .theme-site-header .sf-header-search,
  .theme-site-header .sf-header-location{transition:none!important;transform:none!important}
}
