/* Responsive header: use Blocksy's existing mobile header before navigation collides. */
@media (max-width: 1479.98px) {
 #header > [data-device="desktop"], #offcanvas [data-device="desktop"] {display:none !important;}
 #header > [data-device="mobile"] {display:block !important;}
 #offcanvas [data-device="mobile"] {display:flex !important;}
 #header [data-device="mobile"] [data-row="middle"] {--height:90px;}
 #header [data-device="mobile"] [data-row="middle"] > div {width:calc(100% - 40px);max-width:none;}
 #header [data-device="mobile"] [data-column], #header [data-device="mobile"] [data-items] {min-width:0;}
 #header [data-device="mobile"] [data-items] {gap:20px;}
 #header [data-device="mobile"] [data-items] > * {margin:0 !important;}
 #header [data-device="mobile"] .site-logo-container img {width:240px;max-width:240px;max-height:38px !important;height:auto;}
 #header [data-device="mobile"] .sr-shipping-switch {flex-shrink:0;}
 #header [data-device="mobile"] .ct-header-trigger {min-width:44px;min-height:44px;justify-content:center;padding:10px;}
 #header [data-device="mobile"] .ct-header-trigger .ct-label {display:none !important;}
 #header [data-device="mobile"] .sr-account-cart-group {flex-shrink:0;height:46px;}
 #header [data-device="mobile"] .sr-account-cart-link {width:44px;height:44px;}
 #header [data-device="mobile"] .sr-account-cart-group .ct-cart-item {width:44px;height:44px;min-height:44px;padding:10px;justify-content:center;}
 #header [data-device="mobile"] .ct-cart-item > .ct-label {display:none !important;}
 #offcanvas .mobile-menu {width:100%;--theme-font-size:17px;--theme-font-weight:600;}
 #offcanvas .mobile-menu .ct-menu-link {min-height:48px;font-size:17px;font-weight:600;}
}
@media (max-width: 767.98px) {
 #header [data-device="mobile"] [data-items] {gap:12px;}
 #header [data-device="mobile"] .site-logo-container img {width:190px;max-width:190px;max-height:30px !important;}
}
/* On phones keep the store identity on its own row, away from account/cart controls. */
@media (max-width: 599.98px) {
 #header [data-device="mobile"] [data-row="middle"] {--height:auto;}
 #header [data-device="mobile"] [data-row="middle"] > div {width:calc(100% - 32px);display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;}
 #header [data-device="mobile"] [data-column="start"],
 #header [data-device="mobile"] [data-column="start"] > [data-items] {display:contents;}
 #header [data-device="mobile"] .site-branding {grid-column:1;grid-row:1;min-width:0;}
 #header [data-device="mobile"] .site-logo-container img {width:min(190px, calc(100vw - 184px));max-width:100%;height:auto;}
 #header [data-device="mobile"] [data-column="end"] {grid-column:2;grid-row:1;min-height:66px;}
 #header [data-device="mobile"] [data-column="end"] > [data-items] {gap:8px;}
 #header [data-device="mobile"] .ct-header-text {grid-column:1 / -1;grid-row:2;width:100%;padding:8px 0 12px;border-top:1px solid #eee;}
 #header [data-device="mobile"] .sr-shipping-switch {display:flex;align-items:flex-start;}
 #header [data-device="mobile"] .sr-shipping-switch .sr-shipping-change {min-height:28px;padding:3px 0 !important;}
 #header [data-device="mobile"] .sr-shipping-panel {left:0;right:auto;max-width:calc(100vw - 32px);}
 #header [data-device="mobile"] .sr-shipping-global .sr-shipping-trigger {padding:6px 0 !important;border-left:0 !important;font-size:12px !important;}
}
/* Keep an open drawer useful when the window is resized back to desktop. */
#offcanvas .ct-panel-content[data-device="mobile"] {display:flex !important;}
#offcanvas .ct-panel-content[data-device="desktop"] {display:none !important;}
#offcanvas[data-behaviour] .ct-panel-inner {background:#fff !important;color:#222;}
#offcanvas .mobile-menu .ct-menu-link {color:#222;}
#offcanvas .mobile-menu .ct-menu-link:hover,
#offcanvas .mobile-menu .current-menu-item > .ct-menu-link {color:#a83c36;}
#offcanvas .ct-toggle-close {--theme-icon-color:#222;color:#222;}

/* The empty cart must still provide feedback when its button is pressed. */
#header .ct-header-cart.sr-cart-open > .ct-cart-content {display:block !important;}
@media (max-width:599.98px) {
 #header [data-device="mobile"] .ct-cart-content {width:min(340px, calc(100vw - 64px));max-width:calc(100vw - 64px);}
}
