/**
 * Site header (inc/ms-shop-header.php, assets/js/ms-shop-header.js).
 * Spec: _claude/docs/header-modification.md.
 *
 * Breakpoints: desktop >= 1180px, tablet 768–1179px, mobile <= 767px.
 * Sizes that change per breakpoint / compact state are custom properties on #masthead.
 */

:root {
	--ms-ink: #1b2330;
	--ms-muted: #4f5867;
	--ms-placeholder: #6b7280;
	--ms-accent: #1c5fa8;
	--ms-accent-strong: #174e8a;
	--ms-accent-tint: #eef3fa;
	--ms-strip-bg: #0e2338;
	--ms-strip-text: #e2e8f0;
	--ms-border-input: #cdd2da;
	--ms-border: #e3e6eb;
	--ms-surface: #f5f6f8;
	--ms-surface-sub: #f8f9fb;
	--ms-shadow-pop: 0 12px 32px rgba(14, 35, 56, 0.14);
	--ms-ring: 0 0 0 3px rgba(28, 95, 168, 0.2);
}

/* Storefront's `.site { overflow-x: hidden }` stops position: sticky from working.
   `clip` hides horizontal overflow the same way without creating a scroll container. */
#page.site {
	overflow-x: clip;
}

/* Scroll marker for the compact header (see JS). */
.ms-shop-header-sentinel {
	position: absolute;
	top: 120px;
	left: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

/* ==========================================================================
   Header shell
   ========================================================================== */

#masthead.site-header {
	--ms-bar-h: 76px;
	--ms-logo-h: 44px;
	--ms-pad: 32px;
	--ms-pad-r: 32px;
	--ms-logo-gap: 32px;
	--ms-link-pad: 14px;
	--ms-actions-gap: 16px;
	--ms-pop-offset: calc((var(--ms-bar-h) - 44px) / 2 + 4px); /* 4px below the bar */

	position: sticky;
	top: 0;
	z-index: 1000;
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	background: #fff;
	color: var(--ms-ink);
	border-bottom: 1px solid var(--ms-border);
	box-shadow: none;
	transition: box-shadow 0.2s ease;
}

#masthead.site-header.ms-shop-is-compact {
	--ms-bar-h: 60px;
	--ms-logo-h: 34px;
	box-shadow: 0 4px 16px rgba(14, 35, 56, 0.1);
}

.admin-bar #masthead.site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Below 601px the admin bar scrolls away with the page. */
@media (max-width: 600px) {
	.admin-bar #masthead.site-header {
		top: 0;
	}
}

#masthead .ms-shop-header__inner {
	box-sizing: border-box;
	max-width: calc(1240px + var(--ms-pad) + var(--ms-pad-r));
	margin: 0 auto;
	padding: 0 var(--ms-pad-r) 0 var(--ms-pad);
}

/* Shared reset for the header's own buttons (beats Storefront/Customizer `button` and `button:hover`). */
button.ms-shop-icon-button,
button.ms-shop-icon-button:hover,
button.ms-shop-icon-button:focus,
button.ms-shop-subtoggle,
button.ms-shop-subtoggle:hover,
button.ms-shop-subtoggle:focus,
button.ms-shop-search__cancel,
button.ms-shop-search__cancel:hover,
button.ms-shop-search__cancel:focus {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ms-ink);
	font: inherit;
	line-height: 1;
	text-shadow: none;
	cursor: pointer;
}

button.ms-shop-icon-button {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 8px;
}

button.ms-shop-icon-button:hover {
	background: var(--ms-accent-tint);
	color: var(--ms-accent);
}

#masthead a:focus-visible,
#masthead button:focus-visible,
.ms-shop-drawer a:focus-visible,
.ms-shop-drawer button:focus-visible {
	outline: 2px solid var(--ms-accent);
	outline-offset: 2px;
}

/* ==========================================================================
   Utility strip
   ========================================================================== */

#masthead .ms-shop-utility {
	max-height: 36px;
	overflow: hidden;
	background: var(--ms-strip-bg);
	color: var(--ms-strip-text);
	transition: max-height 0.2s ease;
}

#masthead.ms-shop-is-compact .ms-shop-utility {
	max-height: 0;
}

#masthead .ms-shop-utility-menu--strip {
	display: flex;
	align-items: center;
	gap: 24px;
	height: 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#masthead .ms-shop-utility-menu--strip li {
	margin: 0;
}

/* The external link sits on the right. */
#masthead .ms-shop-utility-menu--strip li:has(> .ms-shop-utility-external) {
	margin-left: auto;
}

#masthead .ms-shop-utility-menu--strip a {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	color: var(--ms-strip-text);
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

#masthead .ms-shop-utility-menu--strip a:hover {
	color: #fff;
	text-decoration: underline;
}

#masthead .ms-shop-utility-menu--strip a.ms-shop-utility-external {
	gap: 6px;
	color: #fff;
	font-weight: 600;
}

/* Accent is too dark on the navy strip; use white for the focus ring here. */
#masthead .ms-shop-utility a:focus-visible {
	outline-color: #fff;
	outline-offset: -2px;
}

/* ==========================================================================
   Main bar
   ========================================================================== */

#masthead .ms-shop-header__bar {
	position: relative;
}

#masthead .ms-shop-header__bar-inner {
	display: flex;
	align-items: center;
	gap: var(--ms-actions-gap);
	height: var(--ms-bar-h);
	transition: height 0.2s ease;
}

/* ---------- Logo ---------- */

#masthead .ms-shop-header__logo {
	display: flex;
	flex: none;
	align-items: center;
	min-width: 0;
	margin: 0 calc(var(--ms-logo-gap) - var(--ms-actions-gap)) 0 0;
}

#masthead .ms-shop-header__logo .logo,
#masthead .ms-shop-header__logo .site-title {
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1;
}

#masthead .ms-shop-header__logo .custom-logo-link {
	display: flex;
	margin: 0;
}

/* !important: style.css forces `img { width/height: auto !important }` site-wide. */
#masthead .ms-shop-header__logo img {
	display: block;
	width: auto !important;
	max-width: none;
	height: var(--ms-logo-h) !important;
	margin: 0;
	transition: height 0.2s ease;
}

#masthead .ms-shop-header__logo .site-title a {
	color: var(--ms-ink);
	font-weight: 700;
	text-decoration: none;
}

#masthead .ms-shop-header__logo .site-description {
	display: none;
}

/* ---------- Primary navigation ---------- */

#masthead .ms-shop-nav {
	flex: none;
}

#masthead .ms-shop-nav__menu {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#masthead .ms-shop-nav__menu > li {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	border-radius: 8px;
}

#masthead .ms-shop-nav__menu > li > a {
	display: flex;
	align-items: center;
	height: 44px;
	padding: 0 var(--ms-link-pad);
	border-radius: 8px;
	color: var(--ms-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
}

#masthead .ms-shop-nav__label {
	padding: 4px 0 2px;
	border-bottom: 2px solid transparent;
}

/* The old FiboSearch "search in menu" item: search now has its own slot. Remove the item in Appearance > Menus. */
#masthead .ms-shop-nav__menu > li:has(.dgwt-wcas-search-wrapp),
.ms-shop-drawer__menu > li:has(.dgwt-wcas-search-wrapp) {
	display: none;
}

/* Hover / open: the whole item (link + chevron) is one pill. */
#masthead .ms-shop-nav__menu > li:hover,
#masthead .ms-shop-nav__menu > li.is-open {
	background: var(--ms-accent-tint);
}

#masthead .ms-shop-nav__menu > li:hover > a,
#masthead .ms-shop-nav__menu > li.is-open > a,
#masthead .ms-shop-nav__menu > li:hover > .ms-shop-subtoggle,
#masthead .ms-shop-nav__menu > li.is-open > .ms-shop-subtoggle {
	color: var(--ms-accent);
}

/* Current page. */
#masthead .ms-shop-nav__menu > li.current-menu-item > a,
#masthead .ms-shop-nav__menu > li.current-menu-parent > a,
#masthead .ms-shop-nav__menu > li.current-menu-ancestor > a,
#masthead .ms-shop-nav__menu > li.current-product_cat-ancestor > a {
	color: var(--ms-accent);
	font-weight: 600;
}

#masthead .ms-shop-nav__menu > li.current-menu-item > a .ms-shop-nav__label,
#masthead .ms-shop-nav__menu > li.current-menu-parent > a .ms-shop-nav__label,
#masthead .ms-shop-nav__menu > li.current-menu-ancestor > a .ms-shop-nav__label,
#masthead .ms-shop-nav__menu > li.current-product_cat-ancestor > a .ms-shop-nav__label {
	border-bottom-color: var(--ms-accent);
}

/* Parent item: the link navigates, the chevron button opens the submenu.
   The button is a 44px target; -8px margin keeps the pill's padding even. */
#masthead .ms-shop-nav__menu > li.menu-item-has-children > a {
	padding-right: 0;
}

#masthead button.ms-shop-subtoggle {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 44px;
	height: 44px;
	margin-right: -8px;
	padding-left: 6px;
	border-radius: 8px;
	color: var(--ms-ink);
}

.ms-shop-subtoggle .ms-shop-icon {
	transition: transform 0.2s ease;
}

.is-open > .ms-shop-subtoggle .ms-shop-icon {
	transform: rotate(180deg);
}

/* Dropdown panel. */
#masthead .ms-shop-nav .sub-menu {
	position: absolute;
	top: calc(100% + var(--ms-pop-offset));
	left: 0;
	z-index: 20;
	box-sizing: border-box;
	width: 248px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--ms-border);
	border-radius: 10px;
	box-shadow: var(--ms-shadow-pop);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

/* Hover bridge across the gap between the item and the panel. */
#masthead .ms-shop-nav .sub-menu::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	height: calc(var(--ms-pop-offset) + 1px);
}

#masthead .ms-shop-nav li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

#masthead .ms-shop-nav .sub-menu li {
	margin: 0;
}

#masthead .ms-shop-nav .sub-menu a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 6px;
	color: var(--ms-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
}

#masthead .ms-shop-nav .sub-menu a:hover,
#masthead .ms-shop-nav .sub-menu a:focus-visible {
	background: var(--ms-accent-tint);
	color: var(--ms-accent);
}

#masthead .ms-shop-nav .sub-menu a:focus-visible {
	outline-offset: -2px;
}

#masthead .ms-shop-nav .sub-menu .current-menu-item > a {
	color: var(--ms-accent);
	font-weight: 600;
}

/* ---------- Search (FiboSearch) ---------- */

#masthead .ms-shop-search {
	display: flex;
	flex: none;
	align-items: center;
	gap: 4px;
	width: 260px;
	margin-left: auto;
}

#masthead .ms-shop-search__field {
	flex: 1;
	min-width: 0;
}

#masthead .ms-shop-search__close,
#masthead .ms-shop-search__cancel,
#masthead .ms-shop-search-toggle,
#masthead .ms-shop-menu-toggle {
	display: none;
}

#masthead button.ms-shop-search__cancel {
	align-items: center;
	height: 44px;
	padding: 0 10px;
	border-radius: 8px;
	color: var(--ms-accent);
	font-size: 15px;
	font-weight: 600;
}

#masthead button.ms-shop-search__cancel:hover {
	color: var(--ms-accent-strong);
}

#masthead .ms-shop-search .dgwt-wcas-search-wrapp {
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
}

#masthead .ms-shop-search .dgwt-wcas-sf-wrapp {
	position: relative;
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
}

#masthead .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 14px 0 42px;
	border: 1px solid var(--ms-border-input);
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	color: var(--ms-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: normal;
	outline: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

#masthead .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
	border-color: var(--ms-accent);
	box-shadow: var(--ms-ring);
}

#masthead .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::placeholder {
	color: var(--ms-placeholder);
	font-style: normal;
	opacity: 1;
}

/* Magnifier on the left (FiboSearch's submit button). */
#masthead .ms-shop-search .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 42px;
	min-width: 0;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0 0 0 14px;
	border: 0;
	border-radius: 8px 0 0 8px;
	background: transparent;
	box-shadow: none;
	color: var(--ms-muted);
	opacity: 1;
}

#masthead .ms-shop-search .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::before {
	content: none;
}

#masthead .ms-shop-search .dgwt-wcas-search-submit svg {
	width: 18px;
	height: 18px;
	max-width: none;
}

#masthead .ms-shop-search .dgwt-wcas-search-submit svg path {
	fill: var(--ms-muted);
}

/* Clear (×) button / loading spinner: a 44px target flush with the field's right edge.
   Resets FiboSearch's pirx-style 35px margin. !important: FiboSearch's JS sets an inline
   `right` equal to its submit button's width (it assumes the button is on the right; ours is on the left). */
#masthead .ms-shop-search .dgwt-wcas-sf-wrapp .dgwt-wcas-preloader {
	right: 0 !important;
	width: 44px;
	margin: 0;
	background-position: center;
}

#masthead .ms-shop-search .dgwt-wcas-close:not(.dgwt-wcas-inner-preloader) {
	width: 44px;
}

#masthead .ms-shop-search .dgwt-wcas-close path {
	fill: var(--ms-muted);
}

/* Keep typed text clear of the × button. */
#masthead .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
	padding-right: 44px;
}

/* Results dropdown. FiboSearch appends it to <body>, so it can't be scoped to the header.
   `:not(#ms-shop-x)` only raises specificity above FiboSearch's style-specific rules. */
body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp {
	box-sizing: border-box;
	max-width: none;
	margin-top: 8px;
	padding: 0;
	overflow-x: hidden;
	background: #fff;
	border: 1px solid var(--ms-border);
	border-radius: 10px;
	box-shadow: var(--ms-shadow-pop);
	font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion {
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	min-height: 44px;
	padding: 8px 16px;
	border: 0;
	background: #fff;
	color: var(--ms-ink);
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-product {
	min-height: 64px;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-selected {
	background: var(--ms-accent-tint);
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-si {
	flex: none;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
}

/* !important: style.css forces `img { width/height: auto !important }` site-wide. */
body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-si img {
	box-sizing: border-box;
	width: 48px !important;
	max-width: none;
	height: 48px !important;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ms-border);
	border-radius: 6px;
	object-fit: cover;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-content-wrapp {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 12px;
	min-width: 0;
	height: auto;
	padding: 0;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-st {
	flex: 1;
	min-width: 0;
	padding: 0;
	color: var(--ms-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-st-title {
	display: block;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-st strong {
	font-weight: 700;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .ms-shop-search-cat {
	display: block;
	margin-top: 2px;
	color: var(--ms-muted);
	font-size: 12px;
	font-weight: 400;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-meta {
	flex: none;
	margin: 0;
	text-align: right;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp {
	color: var(--ms-ink);
	font-size: 14px;
	font-weight: 600;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp del {
	display: block;
	color: var(--ms-muted);
	font-size: 12px;
	font-weight: 400;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-sp ins {
	text-decoration: none;
}

/* "Products" heading. */
body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline {
	display: block;
	min-height: 0;
	padding: 10px 16px 6px;
	background: #fff;
	cursor: default;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-headline .dgwt-wcas-st {
	padding: 0;
	border: 0;
	color: var(--ms-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: none;
}

/* "See all results (N) →" footer. */
body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-more {
	justify-content: space-between;
	min-height: 44px;
	margin-top: 6px;
	padding: 0 16px;
	border-top: 1px solid var(--ms-border);
	color: var(--ms-accent);
	font-size: 14px;
	font-weight: 600;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-more::after {
	content: "\2192";
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-st-more {
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	text-transform: none;
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-more.dgwt-wcas-suggestion-selected {
	background: var(--ms-accent-tint);
	color: var(--ms-accent-strong);
}

body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp .dgwt-wcas-suggestion-nores {
	min-height: 0;
	padding: 14px 16px;
	font-size: 14px;
}

/* ---------- Cart + mini-cart ---------- */

/* !important: Customizer > Additional CSS sets `.site-header-cart { width: 18% !important }` (>= 768px). */
#masthead .site-header-cart {
	position: relative;
	flex: none;
	float: none;
	width: auto !important;
	margin: 0;
	padding: 0;
	list-style: none;
}

#masthead .site-header-cart > li {
	margin: 0;
	list-style: none;
}

#masthead .site-header-cart .cart-contents {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	height: 44px;
	min-width: 44px;
	padding: 0 10px;
	border-radius: 8px;
	background: transparent;
	color: var(--ms-ink);
	text-decoration: none;
}

#masthead .site-header-cart .cart-contents:hover,
#masthead .site-header-cart:hover .cart-contents {
	background: var(--ms-accent-tint);
}

/* Storefront's Font Awesome basket. */
#masthead .site-header-cart .cart-contents::after {
	content: none;
	display: none;
}

#masthead .ms-shop-cart__icon {
	position: relative;
	display: flex;
}

#masthead .ms-shop-icon--basket {
	stroke-width: 1.8;
}

#masthead .ms-shop-cart__badge {
	position: absolute;
	top: -7px;
	right: -9px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border: 2px solid #fff;
	border-radius: 10px;
	background: var(--ms-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

#masthead .ms-shop-cart__text {
	display: flex;
	flex-direction: column;
	margin-left: 4px;
	line-height: 1.2;
	white-space: nowrap;
}

#masthead .ms-shop-cart__total {
	display: block;
	color: var(--ms-ink);
	font-size: 15px;
	font-weight: 600;
}

#masthead .ms-shop-cart__total .amount {
	margin: 0;
}

#masthead .ms-shop-cart.is-empty .ms-shop-cart__total {
	color: var(--ms-muted);
}

#masthead .ms-shop-cart__count {
	display: block;
	color: var(--ms-muted);
	font-size: 12px;
	font-weight: 500;
}

/* Mini-cart dropdown (Storefront widget), hover or keyboard focus. Hidden below 768px by Storefront. */
@media (min-width: 768px) {
	#masthead .site-header-cart .widget_shopping_cart {
		top: calc(100% + var(--ms-pop-offset));
		right: -9999px;
		left: auto;
		box-sizing: border-box;
		width: 340px;
		padding: 6px 0;
		background: #fff;
		border: 1px solid var(--ms-border);
		border-radius: 10px;
		box-shadow: var(--ms-shadow-pop);
		color: var(--ms-ink);
		font-size: 14px;
	}

	/* Hover bridge across the gap. */
	#masthead .site-header-cart .widget_shopping_cart::before {
		content: "";
		position: absolute;
		right: 0;
		bottom: 100%;
		left: 0;
		height: calc(var(--ms-pop-offset) + 1px);
	}

	#masthead .site-header-cart:hover .widget_shopping_cart,
	#masthead .site-header-cart:focus-within .widget_shopping_cart {
		right: 0;
		left: auto;
	}

	#masthead .site-header-cart:focus-within .widget_shopping_cart .product_list_widget {
		height: auto;
	}
}

/* ==========================================================================
   Tablet + mobile (<= 1179px)
   ========================================================================== */

@media (max-width: 1179px) {

	#masthead.site-header {
		--ms-bar-h: 72px;
		--ms-logo-h: 40px;
		--ms-pad: 24px;
		--ms-pad-r: 24px;
		--ms-logo-gap: 16px;
		--ms-link-pad: 12px;
		--ms-actions-gap: 8px;
	}

	#masthead.site-header.ms-shop-is-compact {
		--ms-bar-h: 60px;
		--ms-logo-h: 32px;
	}

	#masthead .ms-shop-header__inner {
		max-width: none;
	}

	/* Search collapses to an icon. */
	#masthead .ms-shop-search {
		display: none;
		width: auto;
	}

	#masthead .ms-shop-search-toggle {
		display: inline-flex;
		margin-left: auto;
	}

	/* Cart: icon + badge only. */
	#masthead .site-header-cart .cart-contents {
		width: 44px;
		padding: 0;
	}

	#masthead .ms-shop-cart__text {
		display: none;
	}
}

/* ---------- Tablet only: search expands inline over the menu ---------- */

@media (min-width: 768px) and (max-width: 1179px) {

	#masthead.ms-shop-search-open .ms-shop-nav,
	#masthead.ms-shop-search-open .ms-shop-search-toggle {
		display: none;
	}

	#masthead.ms-shop-search-open .ms-shop-search {
		display: flex;
		flex: 1;
		min-width: 0;
		animation: ms-shop-search-in 0.2s ease-out;
	}

	#masthead.ms-shop-search-open .ms-shop-search__close {
		display: inline-flex;
	}

	#masthead.ms-shop-search-open .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
		border-color: var(--ms-accent);
		box-shadow: var(--ms-ring);
	}
}

@keyframes ms-shop-search-in {
	from {
		clip-path: inset(0 0 0 calc(100% - 44px));
		opacity: 0.6;
	}

	to {
		clip-path: inset(0);
		opacity: 1;
	}
}

/* ==========================================================================
   Mobile (<= 767px)
   ========================================================================== */

@media (max-width: 767px) {

	#masthead.site-header {
		--ms-bar-h: 60px;
		--ms-logo-h: 32px;
		--ms-pad: 16px;
		--ms-pad-r: 6px;
		--ms-logo-gap: 0px;
		--ms-actions-gap: 2px;
	}

	#masthead.site-header.ms-shop-is-compact {
		--ms-bar-h: 52px;
		--ms-logo-h: 28px;
	}

	#masthead .ms-shop-utility,
	#masthead .ms-shop-nav {
		display: none;
	}

	#masthead .ms-shop-header__logo {
		flex: 0 1 auto;
		margin-right: auto;
	}

	#masthead .ms-shop-header__logo img {
		max-width: 100%;
		object-fit: contain;
		object-position: left center;
	}

	#masthead .ms-shop-search-toggle {
		margin-left: 0;
	}

	#masthead .ms-shop-menu-toggle {
		display: inline-flex;
	}

	/* Search: full-width bar below the main bar. */
	#masthead .ms-shop-search {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		z-index: 5;
		box-sizing: border-box;
		width: auto;
		padding: 8px 8px 8px 12px;
		background: #fff;
		border-top: 1px solid var(--ms-border);
		border-bottom: 1px solid var(--ms-border);
	}

	#masthead.ms-shop-search-open .ms-shop-search {
		display: flex;
	}

	#masthead.ms-shop-search-open .ms-shop-search__cancel {
		display: inline-flex;
	}

	#masthead.ms-shop-search-open button.ms-shop-search-toggle {
		background: var(--ms-accent-tint);
		color: var(--ms-accent);
	}

	/* 16px stops iOS zooming into the field; focus styling stays on while the bar is open. */
	#masthead .ms-shop-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
		padding-left: 40px;
		border-color: var(--ms-accent);
		box-shadow: var(--ms-ring);
		font-size: 16px;
	}

	#masthead .ms-shop-search .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
		padding-left: 12px;
	}

	/* Results: full width under the search bar. */
	body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp {
		left: 0 !important;
		width: 100% !important;
		margin-top: 9px;
		border-right: 0;
		border-left: 0;
		border-radius: 0;
		box-shadow: 0 12px 24px rgba(14, 35, 56, 0.1);
	}
}

/* Desktop: results are 400px wide, right-aligned to the 260px field. */
@media (min-width: 1180px) {

	body:not(#ms-shop-x) .dgwt-wcas-suggestions-wrapp {
		width: 400px !important;
		margin-left: -140px;
	}
}

/* ==========================================================================
   Mobile drawer (markup printed in the footer)
   ========================================================================== */

.ms-shop-drawer-scrim {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(14, 35, 56, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease-out, visibility 0s linear 0.25s;
}

.ms-shop-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 320px;
	max-width: 85vw;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	box-shadow: -12px 0 32px rgba(14, 35, 56, 0.2);
	color: var(--ms-ink);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 0.25s ease-out, visibility 0s linear 0.25s;
}

html.ms-shop-drawer-open .ms-shop-drawer {
	transform: none;
	visibility: visible;
	transition: transform 0.25s ease-out;
}

html.ms-shop-drawer-open .ms-shop-drawer-scrim {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease-out;
}

html.ms-shop-drawer-open,
html.ms-shop-drawer-open body {
	overflow: hidden;
}

@media (min-width: 768px) {

	.ms-shop-drawer,
	.ms-shop-drawer-scrim {
		display: none;
	}
}

.ms-shop-drawer__head {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	height: 60px;
	padding: 0 8px 0 20px;
	border-bottom: 1px solid var(--ms-border);
}

.ms-shop-drawer__logo {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--ms-ink);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
}

/* !important: style.css forces `img { width/height: auto !important }` site-wide. */
.ms-shop-drawer__logo img.ms-shop-drawer__logo-img {
	display: block;
	width: auto !important;
	max-width: 200px;
	height: 28px !important;
	object-fit: contain;
	object-position: left center;
}

.ms-shop-drawer__menu {
	margin: 0;
	padding: 8px 0;
	list-style: none;
}

.ms-shop-drawer__menu li {
	margin: 0;
}

.ms-shop-drawer__menu > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.ms-shop-drawer__menu > li > a {
	display: flex;
	flex: 1;
	align-items: center;
	min-height: 52px;
	padding: 0 20px;
	color: var(--ms-ink);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.25;
	text-decoration: none;
	text-transform: none;
}

.ms-shop-drawer__menu > li.menu-item-has-children > a {
	padding-right: 0;
}

.ms-shop-drawer button.ms-shop-subtoggle {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-right: 0;
	padding: 0;
}

.ms-shop-drawer .sub-menu {
	display: none;
	flex-basis: 100%;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: var(--ms-surface-sub);
}

.ms-shop-drawer li.is-open > .sub-menu {
	display: block;
}

.ms-shop-drawer .sub-menu a {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 20px 0 36px;
	color: var(--ms-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	text-decoration: none;
	text-transform: none;
}

.ms-shop-drawer__menu a:hover {
	color: var(--ms-accent);
}

.ms-shop-drawer__menu .current-menu-item > a {
	background: var(--ms-accent-tint);
	color: var(--ms-accent);
	font-weight: 600;
}

.ms-shop-drawer a:focus-visible,
.ms-shop-drawer button.ms-shop-subtoggle:focus-visible {
	outline-offset: -2px;
}

/* Contact block pinned to the bottom. */
.ms-shop-drawer__utility {
	flex: none;
	margin-top: auto;
	padding: 8px 0 16px;
	background: var(--ms-surface);
	border-top: 1px solid var(--ms-border);
}

.ms-shop-utility-menu--drawer {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-shop-utility-menu--drawer li {
	margin: 0;
}

.ms-shop-utility-menu--drawer a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 0 20px;
	color: var(--ms-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	word-break: break-word;
}

.ms-shop-utility-menu--drawer .ms-shop-icon {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--ms-muted);
}

.ms-shop-utility-menu--drawer a.ms-shop-utility-external {
	color: var(--ms-accent);
	font-weight: 600;
}

/* Icon first in the drawer (it sits after the text in the strip). */
.ms-shop-utility-menu--drawer a.ms-shop-utility-external .ms-shop-icon {
	order: -1;
	color: currentColor;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

	#masthead.site-header,
	#masthead *,
	.ms-shop-drawer,
	.ms-shop-drawer-scrim {
		transition: none !important;
		animation: none !important;
	}
}
