/* Public shared header only. Tokens and native commerce assets stay canonical. */
.site-header {
	background: var(--wp--preset--color--mrwax-canvas);
	border-block-end: 1px solid var(--wp--preset--color--mrwax-border);
}

.mrwax-header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--mrwax-space-2) var(--wp--preset--spacing--mrwax-space-3);
	min-block-size: var(--wp--preset--spacing--mrwax-space-6);
	padding-block: var(--wp--preset--spacing--mrwax-space-2);
}

.mrwax-primary-navigation,
.mrwax-navigation,
.mrwax-menu li,
.mrwax-header-utilities li {
	min-inline-size: 0;
	max-inline-size: 100%;
}

.mrwax-navigation {
	display: flex;
	flex: 1 1 100%;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--mrwax-space-2) var(--wp--preset--spacing--mrwax-space-3);
	font-family: var(--wp--preset--font-family--mrwax-body);
	font-size: var(--wp--preset--font-size--mrwax-body);
}

/* Visibility belongs to the disclosure controller, including desktop changes. */
.mrwax-navigation[hidden],
.mrwax-navigation-toggle[hidden] {
	display: none;
}

.mrwax-navigation-toggle {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--mrwax-space-1);
	margin-inline-start: auto;
	min-block-size: 2.75rem;
	max-inline-size: 100%;
	padding: var(--wp--preset--spacing--mrwax-space-1) var(--wp--preset--spacing--mrwax-space-2);
	border: var(--wp--custom--mrwax--focus--width) solid var(--wp--preset--color--mrwax-ink);
	background: var(--wp--preset--color--mrwax-canvas);
	color: var(--wp--preset--color--mrwax-muted);
	font-family: var(--wp--preset--font-family--mrwax-body);
	font-size: var(--wp--preset--font-size--mrwax-body);
	font-weight: var(--wp--custom--mrwax--font-weight--regular);
	line-height: var(--wp--custom--mrwax--line-height--compact);
	overflow-wrap: anywhere;
	cursor: pointer;
}

.mrwax-navigation-toggle-mark {
	display: none;
	font-size: 1.5rem;
	font-weight: var(--wp--custom--mrwax--font-weight--light);
	line-height: 1;
}

.mrwax-navigation-toggle:is(:hover, :active) {
	color: var(--wp--preset--color--mrwax-ink);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.mrwax-menu,
.mrwax-header-utilities {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--mrwax-space-1) var(--wp--preset--spacing--mrwax-space-2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.mrwax-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 0 0 var(--wp--preset--spacing--mrwax-space-2);
	padding-inline: var(--wp--preset--spacing--mrwax-space-2) 0;
}

.mrwax-header-inner a {
	display: inline-flex;
	align-items: center;
	min-block-size: 2.75rem;
	max-inline-size: 100%;
	color: var(--wp--preset--color--mrwax-muted);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	overflow-wrap: anywhere;
}

/* Native site identity, sized like the legacy MR Wax emblem and wordmark. */
.site-header .mrwax-brand {
	flex: 0 1 auto;
	gap: 0.9rem;
}

.site-header .mrwax-brand .custom-logo-link {
	flex: 0 0 auto;
	min-inline-size: 44px;
	min-block-size: 44px;
	justify-content: center;
}

.site-header .mrwax-brand .custom-logo {
	inline-size: 72px;
	block-size: 72px;
	max-inline-size: none;
	max-block-size: none;
	object-fit: contain;
	filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.3));
}

.site-header .mrwax-brand .site-title {
	color: var(--wp--preset--color--mrwax-ink);
	font-size: 1.75rem;
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: 1;
}

.site-header .mrwax-brand .site-title a {
	color: inherit;
	text-decoration: none;
}

.site-header .mrwax-brand .site-description {
	display: block;
	max-inline-size: 32ch;
	margin-block-start: 0.25rem;
	color: var(--wp--preset--color--mrwax-muted);
	font-family: var(--wp--preset--font-family--mrwax-mono);
	font-size: 0.58rem;
	font-weight: 400;
	letter-spacing: 0.22em;
	line-height: 1.4;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

@media (width <= 60rem) {
	.site-header .mrwax-brand .custom-logo {
		inline-size: 52px;
		block-size: 52px;
	}

	.site-header .mrwax-brand .site-title {
		font-size: 1.35rem;
	}
}

@media (width <= 45rem) {
	.site-header .mrwax-brand .custom-logo {
		inline-size: 44px;
		block-size: 44px;
	}

	.site-header .mrwax-brand .site-title {
		font-size: 1.16rem;
	}

	.site-header .mrwax-brand .site-description {
		font-size: 0.46rem;
	}
}

@media (width <= 26.25rem) {
	.site-header .mrwax-brand {
		gap: 0.45rem;
	}

	.site-header .mrwax-brand .custom-logo {
		inline-size: 38px;
		block-size: 38px;
	}

	.site-header .mrwax-brand .site-title {
		font-size: 1.02rem;
	}

	.site-header .mrwax-brand .site-description {
		display: none;
	}
}

.mrwax-header-inner a:is(:hover, :active),
.mrwax-header-inner a[aria-current="page"],
.mrwax-menu .current-menu-item > a {
	color: var(--wp--preset--color--mrwax-ink);
	text-decoration-thickness: 0.12em;
}

.mrwax-header-inner a[aria-current="page"],
.mrwax-menu .current-menu-item > a {
	font-weight: var(--wp--custom--mrwax--font-weight--bold);
}

.mrwax-header-inner a:focus-visible,
.mrwax-navigation-toggle:focus-visible,
.mrwax-skip-link:focus {
	outline: var(--wp--custom--mrwax--focus--width) solid var(--wp--preset--color--mrwax-ink);
	outline-offset: var(--wp--custom--mrwax--focus--width);
	box-shadow: 0 0 0 var(--wp--custom--mrwax--focus--width) var(--wp--preset--color--mrwax-surface);
}

.mrwax-skip-link:focus {
	z-index: 1;
}

/* The controller-ready gate keeps the no-JavaScript menu readable in flow. */
@media (width < 70rem) {
	body.mrwax-navigation-open {
		overflow: hidden;
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation-toggle[aria-expanded='true'] {
		position: fixed;
		inset-block-start: var(--wp--preset--spacing--mrwax-space-2);
		inset-inline-end: var(--wp--custom--mrwax--gutter);
		z-index: 1001;
		min-inline-size: 2.75rem;
		border-color: var(--wp--preset--color--mrwax-bronze-light);
		background: var(--wp--preset--color--mrwax-dark);
		color: var(--wp--preset--color--mrwax-canvas);
		text-decoration: none;
	}

	body.admin-bar .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation-toggle[aria-expanded='true'] {
		inset-block-start: calc(var(--wp-admin--admin-bar--height, 32px) + var(--wp--preset--spacing--mrwax-space-2));
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation-toggle[aria-expanded='true'] .mrwax-navigation-toggle-mark {
		display: inline;
	}

	body.mrwax-navigation-open .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) {
		box-sizing: border-box;
		position: fixed;
		inset: 0;
		z-index: 1000;
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: flex-start;
		gap: var(--wp--preset--spacing--mrwax-space-4);
		block-size: 100vh;
		block-size: 100dvh;
		padding-block: clamp(5.5rem, 14vh, 8rem) var(--wp--preset--spacing--mrwax-space-4);
		padding-inline: var(--wp--custom--mrwax--gutter);
		background: var(--wp--preset--color--mrwax-dark);
		background: color-mix(in srgb, var(--wp--preset--color--mrwax-dark) 98%, transparent);
		color: var(--wp--preset--color--mrwax-canvas);
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	body.admin-bar .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) {
		padding-block-start: calc(var(--wp-admin--admin-bar--height, 32px) + clamp(5.5rem, 14vh, 8rem));
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-primary-navigation {
		inline-size: min(100%, 42rem);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu {
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: var(--wp--preset--spacing--mrwax-space-1);
		inline-size: 100%;
		text-align: center;
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu > li > a {
		box-sizing: border-box;
		justify-content: center;
		inline-size: 100%;
		min-block-size: 2.75rem;
		padding: 0.25rem var(--wp--preset--spacing--mrwax-space-1);
		color: var(--wp--preset--color--mrwax-canvas);
		font-family: var(--wp--preset--font-family--mrwax-display);
		font-size: clamp(1.75rem, 7vw, 3rem);
		font-weight: var(--wp--custom--mrwax--font-weight--light);
		letter-spacing: 0.03em;
		line-height: var(--wp--custom--mrwax--line-height--compact);
		text-decoration-color: transparent;
		text-underline-offset: 0.2em;
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu > :is(.current-menu-item, .current-menu-ancestor, .current_page_item) > a,
	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu > li > a[aria-current] {
		color: var(--wp--preset--color--mrwax-bronze-light);
		text-decoration-color: var(--wp--preset--color--mrwax-bronze);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu .sub-menu {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0.25rem;
		margin-block: 0.25rem var(--wp--preset--spacing--mrwax-space-1);
		padding-inline: var(--wp--preset--spacing--mrwax-space-3);
		border-inline-start: 1px solid var(--wp--preset--color--mrwax-bronze);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu .sub-menu a {
		box-sizing: border-box;
		justify-content: center;
		inline-size: 100%;
		min-block-size: 2.75rem;
		color: var(--wp--preset--color--mrwax-canvas);
		font-size: var(--wp--preset--font-size--mrwax-body);
		letter-spacing: var(--wp--custom--mrwax--tracking--metadata);
		line-height: var(--wp--custom--mrwax--line-height--compact);
		text-align: center;
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-header-utilities {
		justify-content: center;
		gap: var(--wp--preset--spacing--mrwax-space-1) var(--wp--preset--spacing--mrwax-space-2);
		inline-size: min(100%, 42rem);
		padding-block-start: var(--wp--preset--spacing--mrwax-space-3);
		border-block-start: 1px solid color-mix(in srgb, var(--wp--preset--color--mrwax-bronze-light) 45%, transparent);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-header-utilities a {
		justify-content: center;
		min-block-size: 2.75rem;
		padding-inline: var(--wp--preset--spacing--mrwax-space-1);
		color: var(--wp--preset--color--mrwax-bronze-light);
		font-size: 0.75rem;
		font-weight: var(--wp--custom--mrwax--font-weight--semibold);
		letter-spacing: var(--wp--custom--mrwax--tracking--label);
		line-height: var(--wp--custom--mrwax--line-height--compact);
		text-transform: uppercase;
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) a:is(:hover, :active) {
		color: var(--wp--preset--color--mrwax-bronze-light);
		text-decoration-color: var(--wp--preset--color--mrwax-bronze);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) a:focus-visible,
	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation-toggle[aria-expanded='true']:focus-visible {
		outline-color: var(--wp--preset--color--mrwax-canvas);
		box-shadow: 0 0 0 var(--wp--custom--mrwax--focus--width) var(--wp--preset--color--mrwax-bronze);
	}
}

@media (width < 70rem) and (max-height: 36rem) {
	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) {
		gap: var(--wp--preset--spacing--mrwax-space-2);
		padding-block: 4.5rem var(--wp--preset--spacing--mrwax-space-3);
	}

	body.admin-bar .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) {
		padding-block-start: calc(var(--wp-admin--admin-bar--height, 32px) + 4.5rem);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-menu > li > a {
		font-size: clamp(1.5rem, 7vh, 2rem);
	}

	.mrwax-header-inner[data-navigation-ready='true'] .mrwax-header-utilities {
		padding-block-start: var(--wp--preset--spacing--mrwax-space-2);
	}
}

/* Keep this condition identical to navigation.js. */
@media (min-width: 70rem) {
	.site-header {
		background: color-mix(in srgb, var(--wp--preset--color--mrwax-canvas) 96%, var(--wp--preset--color--mrwax-surface));
		border-block-end-color: color-mix(in srgb, var(--wp--preset--color--mrwax-bronze) 24%, transparent);
		box-shadow: 0 0.25rem 1.5rem color-mix(in srgb, var(--wp--preset--color--mrwax-ink) 7%, transparent);
		transition: background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
	}

	.site-header .mrwax-brand .site-description {
		display: block;
	}

	.mrwax-header-inner {
		flex-wrap: nowrap;
		gap: clamp(var(--wp--preset--spacing--mrwax-space-3), 3vw, var(--wp--preset--spacing--mrwax-space-5));
		min-block-size: 5.75rem;
		padding-block: 0.75rem;
	}

	.mrwax-navigation {
		flex: 1 1 28rem;
		flex-wrap: nowrap;
		justify-content: flex-end;
		gap: clamp(var(--wp--preset--spacing--mrwax-space-2), 2vw, var(--wp--preset--spacing--mrwax-space-4));
	}

	.mrwax-primary-navigation {
		flex: 1 1 auto;
	}

	.mrwax-menu {
		justify-content: center;
		gap: var(--wp--preset--spacing--mrwax-space-1) clamp(var(--wp--preset--spacing--mrwax-space-2), 2vw, var(--wp--preset--spacing--mrwax-space-4));
	}

	.mrwax-header-utilities {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		align-items: center;
		gap: var(--wp--preset--spacing--mrwax-space-2);
		padding-inline-start: var(--wp--preset--spacing--mrwax-space-3);
		border-inline-start: 1px solid color-mix(in srgb, var(--wp--preset--color--mrwax-bronze) 35%, transparent);
	}

	.mrwax-primary-navigation > .mrwax-menu > li > a,
	.mrwax-header-utilities > li > a {
		position: relative;
		font-size: 0.75rem;
		font-weight: var(--wp--custom--mrwax--font-weight--medium);
		letter-spacing: var(--wp--custom--mrwax--tracking--navigation);
		line-height: var(--wp--custom--mrwax--line-height--compact);
		text-decoration: none;
		text-transform: uppercase;
	}

	.mrwax-primary-navigation > .mrwax-menu > li > a::after,
	.mrwax-header-utilities > li > a::after {
		content: '';
		position: absolute;
		inset: auto 0 0.35rem;
		block-size: 1px;
		background: var(--wp--preset--color--mrwax-bronze);
		transform: scaleX(0);
		transform-origin: center;
		transition: transform 200ms ease;
	}

	.mrwax-primary-navigation > .mrwax-menu > li > a:is(:hover, :active, [aria-current])::after,
	.mrwax-primary-navigation > .mrwax-menu > :is(.current-menu-item, .current-menu-ancestor, .current_page_item) > a::after,
	.mrwax-header-utilities > li > a:is(:hover, :active, [aria-current])::after {
		transform: scaleX(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.mrwax-primary-navigation > .mrwax-menu > li > a::after,
	.mrwax-header-utilities > li > a::after {
		transition: none;
	}
}

@media (forced-colors: active) {
	.mrwax-header-inner a:focus-visible,
	.mrwax-navigation-toggle:focus-visible,
	.mrwax-skip-link:focus {
		outline-color: Highlight;
		box-shadow: none;
	}

	body.mrwax-navigation-open .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) {
		border: 1px solid CanvasText;
		background: Canvas;
		color: CanvasText;
	}

	body.mrwax-navigation-open .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation:not([hidden]) a,
	body.mrwax-navigation-open .mrwax-header-inner[data-navigation-ready='true'] .mrwax-navigation-toggle[aria-expanded='true'] {
		color: LinkText;
	}
}
