/* =============================================================================
   SITE HEADER
   Single blurred fixed container (BUG-14: replaces two independent blur layers).
   Design: 328:33173 (secondary nav) + 328:33112 (primary nav).
   ============================================================================= */

/* ── Merged blur container ─────────────────────────────────────────────────── */

.site-header {
	--header-scroll-offset: 0px;
	position: fixed;
	inset: 0 0 auto;       /* top:0 left:0 right:0 — height is auto */
	z-index: 100;
	transform: translateY(calc(-1 * var(--header-scroll-offset)));
	
}

/* WP admin bar (#wpadminbar, z-index:99999) is fixed at the true viewport
   top for logged-in users, on top of everything above — it was overlapping
   and clipping the header/logo since nothing here accounted for it. */
body.admin-bar .site-header {
	top: 32px;
}
@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;      /* WP's own admin-bar breakpoint/height */
	}
}

/* ── On-light state ─────────────────────────────────────────────────────────
   header.js toggles this once the fixed header is over a page's white
   content instead of the dark hero image, where white nav text/icons become
   unreadable. Swaps every white-on-dark element to dark-on-light. */
.site-header.is-on-light .header-secondary__promo,
.site-header.is-on-light .header-secondary__link,
.site-header.is-on-light .country-selector,
.site-header.is-on-light .main-nav__list a,
.site-header.is-on-light .header-utils__btn {
	color: var(--fig-siegel-black, #1a1a1a);
}

/* Pages with no hero are on a light canvas from the first paint at every scroll
   position, so they take the dark nav colours without waiting for the script.
   Previously scoped to body.single-product, which left every other hero-less
   template (contact, about, technical centre, legal) with white-on-white nav
   text: header.js returns early when a template renders no .site-body, and even
   where one exists it measures against --header-h rather than the header's own
   height, so the state never flipped at scroll 0. body.no-hero is the same
   condition the layout offset already keys off, and it includes product pages. */
body.no-hero .header-secondary__promo,
body.no-hero .header-secondary__link,
body.no-hero .country-selector,
body.no-hero .main-nav__list a,
body.no-hero .header-utils__btn {
	color: var(--fig-siegel-black, #1a1a1a);
}

.site-header.is-on-light .header-secondary__link:focus-visible,
.site-header.is-on-light .country-selector:focus-visible,
.site-header.is-on-light .main-nav__list a:focus-visible,
.site-header.is-on-light .header-utils__btn:focus-visible,
body.no-hero .header-secondary__link:focus-visible,
body.no-hero .country-selector:focus-visible,
body.no-hero .main-nav__list a:focus-visible,
body.no-hero .header-utils__btn:focus-visible {
	outline-color: var(--fig-siegel-black, #1a1a1a);
}

.header-secondary__promo,
.header-secondary__link,
.country-selector,
.main-nav__list a,
.header-utils__btn {
	transition: color var(--dur-base, 300ms) ease-out;
}

@media (prefers-reduced-motion: reduce) {
	.header-secondary__promo,
	.header-secondary__link,
	.country-selector,
	.main-nav__list a,
	.header-utils__btn {
		transition: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		background: rgba(255,255,255,.95);
	}
}

/* ── Skip link (screen-reader-text from WP) ────────────────────────────────── */

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999;
}
.skip-link:focus {
	left: 16px;
	top: 16px;
	background: white;
	color: #333;
	padding: 4px 12px;
	border-radius: var(--r-sm);
	font: var(--fw-bold) 0.875rem/1.25rem var(--font-body);
}

/* ── Secondary nav (utility bar) ───────────────────────────────────────────── */
/* Figma: Frame 976 (328:33173) 1440×44. Instance at x:16 y:8 with px:12 py:5. */

/*
   No overflow clipping here. This carried `overflow: hidden` from the original
   build, when the bar was a fixed 44px box and the rule trimmed its contents to
   that height. The height was later replaced with padding, leaving the clip
   doing only one thing: cutting the country dropdown down to the bar's own
   30px, so the open list showed a single row of white over the bar and read as
   the whole utility nav vanishing.

   Nothing needs clipping at this level — the bar leaves the viewport because
   .site-header translates up by --header-scroll-offset, not because it is
   trimmed. `overflow-x: hidden` is not an alternative either: setting one axis
   to hidden forces the other to `auto`, which would clip the dropdown just the
   same and add a scrollbar.
*/
.header-secondary {
	display: flex;
	align-items: center;
	padding: 13px 0 0;
}

.header-secondary__inner {
	width: 100%;
	padding-inline: 28px;   /* 16px frame margin + 12px instance padding */
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.header-secondary__promo {
	color: white;
}

.header-secondary__right {
	display: flex;
	align-items: center;
	gap: 12px;              /* var(--sp-4) */
}

.header-secondary__link {
	color: white;
	text-decoration: none;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.header-secondary__link:hover {
		text-decoration: underline;
	}
}

.header-secondary__link:focus-visible {
	outline: 2px solid white;
	outline-offset: 2px;
	border-radius: 1px;
}

/* Phone number uses the same .t-body-sm-exbold class — no extra selector needed */

/* ── Country selector ──────────────────────────────────────────────────────── */

.country-selector {
	display: flex;
	align-items: center;
	gap: 4px;               /* var(--sp-1) */
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: white;
}

.country-selector__flag {
	display: block;
	flex-shrink: 0;
	width: 19px;
	height: 14px;
	object-fit: cover;
}

.country-selector__chevron {
	flex-shrink: 0;
	transition: transform 200ms linear;
}

.country-selector[aria-expanded="true"] .country-selector__chevron {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.country-selector__chevron {
		transition: none;
	}
}

.country-selector:focus-visible {
	outline: 2px solid white;
	outline-offset: 2px;
	border-radius: 1px;
}

/* ── Country selector dropdown ─────────────────────────────────────────────── */

.country-selector-wrap {
	position: relative;
}

.country-selector__list {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 200;
	min-width: 210px;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--fig-neutral-100);
	border-radius: var(--r-sm);
	box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
}

.country-selector__option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 44px;
	padding: 10px 16px;
	background: none;
	border: none;
	cursor: pointer;
	font: var(--fw-regular) 0.875rem / 1.25rem var(--font-body);
	color: var(--fig-siegel-black);
	text-align: left;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.country-selector__option:hover {
		background: var(--fig-neutral-50);
	}
}

.country-selector__option:focus-visible {
	outline: 2px solid var(--btn-stroke-focused);
	outline-offset: -2px;
	border-radius: 1px;
}

[role="option"][aria-selected="true"] .country-selector__option {
	font-weight: var(--fw-bold);
}

.country-selector__option-flag {
	width: 20px;
	height: 15px;
	border-radius: 1px;
	flex-shrink: 0;
	object-fit: cover;
}

/* ── Primary nav ────────────────────────────────────────────────────────────── */
/* Figma: Nav frame (328:33112) 1440×121, instance at x:16 y:16, h:89, px:12. */

.header-primary {
	padding: 16px;           /* Nav frame top/bottom padding (y:16 within frame) */
}

.header-primary__inner {
	position: relative;  /* containing block for wide mega-menu panels */
	box-sizing: border-box;  /* h:89 is the TOTAL pill height incl. padding+border, not content-box */
	height: 89px;
	padding: 12px;
	background: rgba(255,255,255,.2);
	border: 1px solid rgba(245,246,246,.2);
	border-radius: var(--r-sm);
	overflow: visible;   /* panels extend below; border-radius clips bg, not children */
	display: flex;
	align-items: center;
	justify-content: space-between;
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
}

/* ── Logo ───────────────────────────────────────────────────────────────────── */

.site-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 64px;
	height: 65px;
	box-sizing: border-box;
	background: var(--fig-siegel-red);
}

.site-logo img {
	width: 100%;
	height: auto;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

/* ── Right cluster: nav items + icons ───────────────────────────────────────── */

.header-primary__right {
	display: flex;
	align-items: center;
	gap: 24px;              /* var(--sp-6) — between nav group and icon cluster */
	justify-content: flex-end;
	flex: 1;
}

/* ── Main navigation ────────────────────────────────────────────────────────── */

.main-nav {
	display: flex;
	align-items: center;
}

.main-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 24px;              /* var(--sp-6) — between each nav item */
}

.main-nav__list a {
	font: var(--fw-bold) 1rem/1.2625rem var(--font-body); /* Lato Bold 16/20.2 — t-body-bold */
	color: white;
	text-decoration: none;
	white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
	.main-nav__list a:hover {
		opacity: .8;
	}
}

.main-nav__list a:focus-visible {
	outline: 2px solid white;
	outline-offset: 4px;
	border-radius: 1px;
}

/* ── Utility icons ──────────────────────────────────────────────────────────── */

.header-utils {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.header-utils__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: white;
	position: relative;
	flex-shrink: 0;
	text-decoration: none;
}

/* The three glyphs are the Font Awesome Sharp shapes 328:33113 draws, exported
   at their own sizes (16.41² search, 14×16 user and bag) rather than normalised
   to one box — Figma insets each differently inside the 20px icon slot, and
   forcing them to a common viewBox changes their weight against each other.
   The 32px button centres them, which is what the design does. */
.header-utils__icon {
	display: block;
	flex-shrink: 0;
}

.header-utils__btn:focus-visible {
	outline: 2px solid white;
	outline-offset: 2px;
	border-radius: 50%;
}

@media (hover: hover) and (pointer: fine) {
	.header-utils__btn:hover {
		opacity: .8;
	}
}

/* ── Cart badge ─────────────────────────────────────────────────────────────── */

.cart-badge {
	position: absolute;
	top: 0;
	right: 0;
	width: 15px;
	height: 15px;
	background: var(--fig-red-600);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
button.header-utils__btn.header-utils__cart span.cart-badge {
    color: #fff!important;
}
.cart-badge--empty {
	display: none;
}

.cart-badge__count {
	/* t-caption-sm applied via class: Aktiv Grotesk Bold 10px / 12px, ls 0.6px, uppercase */
	line-height: 1;
}

/* ── Mobile header — task 2.4 ───────────────────────────────────────────────── */

@media (max-width: 767px) {

	/* Secondary utility bar not in the mobile frame (263:16957, 393×93) */
	.header-secondary { display: none; }

	.site-header {
		display: block;
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		background: transparent;
	}

	.header-primary { padding: 16px; }

	.header-primary__inner {
		height: 61px;
		padding: 8px;
		border: 1px solid rgba(245, 246, 246, 0.2);
		border-radius: var(--r-sm);
		background: rgba(255, 255, 255, 0.47);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
	}

	/*
	   The glass pill above is only right while the nav sits over a hero. Pages
	   with no hero start on white content, and every page becomes white content
	   once scrolled, and there the 47%-opaque pill let the page show straight
	   through the fixed header — which reads as the nav not being sticky at all.
	   263:16957 draws that state as a solid #ffffff bar across the full 393×93.

	   Keyed off state, not page: body.no-hero covers the pages that never had a
	   hero, .is-on-light covers everything once header.js sees white content
	   under the bar. Three classes beats the per-page glass blocks in
	   category.css, so no page-specific override is needed.
	*/
	body.no-hero .site-header,
	.site-header.is-on-light {
		background: var(--fig-siegel-white);
	}

	body.no-hero .header-primary__inner,
	.site-header.is-on-light .header-primary__inner {
		border-color: transparent;
		border-radius: 0;
		background: transparent;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.site-logo {
		width: 44px;
		height: 45px;
		padding: 3px;
	}
	/* Desktop mega-menu nav replaced by the mobile drawer */
	.main-nav { display: none; }

	/* Icons are dark on white background */
	.header-utils__btn { color: var(--fig-siegel-black); }

	/* Hamburger toggle: show on mobile */
	.mobile-nav-toggle { display: flex; }
}

/* Home mobile header — glass overlay from Figma frame 79:4864. */
@media (max-width: 767px) {
	body.home .site-header {
		background: transparent;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
	body.home .header-primary { padding: 16px; }
	body.home .header-primary__inner {
		height: 61px;
		padding: 8px;
		border: 1px solid rgba(245, 246, 246, 0.2);
		border-radius: var(--r-sm);
		background: rgba(255, 255, 255, 0.47);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
	}
	body.home .site-logo {
		width: 44px;
		height: 45px;
	}
	body.home .header-utils__btn { color: var(--fig-siegel-white); }
	body.home .site-header.is-on-light .header-primary__inner {
		background: rgba(255, 255, 255, 0.94);
	}
	body.home .site-header.is-on-light .header-utils__btn {
		color: var(--fig-siegel-black);
	}
}
/* Home uses the red-square Siegel mark shown over the hero. */
body.home .site-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	background: var(--fig-siegel-red);
}
body.home .site-logo img {
	width: 100%;
	height: auto;
	filter: brightness(0) invert(1);
}
@media (max-width: 767px) {
	body.home .site-logo { padding: 3px; }
}

/* ── Above the 1440 design frame ──────────────────────────────────────────── */
/*
   Figma defines one desktop frame at 1440: the utility bar is 1440 wide and
   the nav pill 1408 (1440 - 16 - 16). Wider viewports are undefined, and
   without a cap the bars stretched edge to edge while every page body centred
   inside 1440 — the logo and nav drifted away from the content beneath them.
   Backgrounds stay full-bleed; only the inner rows cap and centre. These are
   no-ops at 1440 and below.
*/
.header-secondary__inner {
	box-sizing: border-box;
	max-width: var(--page-w);
	margin-inline: auto;
}

.header-primary__inner {
	max-width: calc(var(--page-w) - 2 * var(--sp-5)); /* 1440 - 16 - 16 = 1408 */
	margin-inline: auto;
}

/* Utility bar links come from a menu now, so the <ul> has to sit flat in the
   row the two hard-coded anchors used to occupy. */
.header-secondary__menu {
	display: flex;
	align-items: center;
	gap: 12px;   /* matches .header-secondary__right */
	margin: 0;
	padding: 0;
	list-style: none;
}

.header-secondary__menu li { display: flex; }
