/* Header (S:143-161; responsive S:43-46, S:118-124). */

/* Sticky on the part wrapper: <header> in theme templates, a <div> in WooCommerce's own templates (until Task 4). */
.wp-block-template-part:has(> .sv-hdr) {
	position: sticky;
	top: 0;
	z-index: 80;
}

.sv-hdr.sv-hdr {
	position: relative;
	align-items: center;
	gap: 14px;
	padding: 20px var(--pg);
	background: rgba(255, 255, 255, .85);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	backdrop-filter: blur(18px) saturate(150%);
	border-bottom: 1px solid var(--sv-stroke-hair);
}
.sv-hdr .sv-hdr-left { align-items: center; gap: 14px 38px; }
.sv-hdr .sv-hdr-right { align-items: center; gap: 12px; }

.sv-hdr .sv-logo.wp-block-site-logo img {
	display: block;
	width: auto;
	height: min(54px, 4.6vw);
	min-height: 34px;
}

/* Primary nav (S:3765-3770) */
.sv-hdr .sv-primary-nav .wp-block-navigation__container { gap: 12px 24px; }
/* A hidden item (inc/links.php renders it as nothing) splits core's list into two <ul>s. Their items lay out as one row
   with one gap, so the spacing never depends on which items are hidden (Ana exit F3). */
.sv-hdr nav.sv-primary-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.sv-hdr nav.sv-primary-nav > .wp-block-navigation__container { display: contents; }
.sv-hdr .sv-primary-nav .wp-block-navigation-item__content {
	padding-bottom: 4px;
	border-bottom: 2px solid transparent;
	font-size: 13px;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	color: #3d3e40;
	transition: color 320ms, border-color 320ms;
}
.sv-hdr .sv-primary-nav .wp-block-navigation-item__content:hover { color: #0c0d0e; }
.sv-hdr .sv-primary-nav .wp-block-navigation-item__content[aria-current] {
	color: #0c0d0e;
	border-bottom-color: #4DC5D5;
}

/* Hamburger (S:153-157; 44px target) */
.sv-burger {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--sv-stroke-hair);
	border-radius: 12px;
	background: rgba(255, 255, 255, .7);
	cursor: pointer;
}
.sv-burger span { display: block; width: 18px; height: 2px; background: #0c0d0e; }

/* Cart pill and badge (S:158, S:4173-4174) */
.sv-hdr .sv-cart-pill .wp-block-button__link {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 20px;
	border: 1px solid #727374;
	border-radius: 999px;
	background: rgba(255, 255, 255, .62);
	font-size: 12px;
	line-height: 1;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #3d3e40;
}
.sv-hdr .sv-cart-pill .wp-block-button__link::after {
	content: attr(data-count);
	display: inline-grid;
	place-items: center;
	min-width: 16px;
	height: 16px;
	padding: 0 5px;
	border-radius: 999px;
	background: #4DC5D5;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;   /* §4 minimum, CSS-drawn text included (Ana ruling 3) */
	line-height: 1;
	letter-spacing: 0;
	color: #0c0d0e;
}
.sv-hdr .sv-cart-pill .wp-block-button__link[data-count="0"]::after { background: rgba(114, 115, 116, .3); }

/* "Log in" Coming-soon trigger (S:159) and its popover */
.sv-soon {
	display: inline-flex;
	align-items: baseline;   /* "Log in" and the mono "Soon" differ in font metrics: centring the boxes leaves "Soon" low */
	gap: 8px;
	padding: 10px 22px;
	border: 1px solid #0c0d0e;
	border-radius: 999px;
	background: #0c0d0e;
	box-shadow: 0 0 0 1px rgba(77, 197, 213, .6), 0 8px 22px -10px rgba(12, 13, 14, .65);
	font: inherit;
	font-size: 12px;
	line-height: 1;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #fff;
	cursor: pointer;
}
.sv-soon-tag {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 12px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #4DC5D5;
}
.sv-hdr .sv-soon-pop {
	position: absolute;
	top: calc(100% - 8px);
	right: var(--pg);
	z-index: 1;
	width: min(320px, calc(100vw - 2 * var(--pg)));
	box-sizing: border-box;
	margin: 0;
	padding: 18px 20px;
	border: 1px solid var(--sv-stroke-glass);
	border-radius: 20px;
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	backdrop-filter: blur(18px) saturate(150%);
	box-shadow: 0 18px 40px -18px rgba(12, 26, 42, .25);
	font-size: 14px;
	line-height: 1.5;
}
.sv-hdr .sv-soon-pop:not([data-open="true"]) { display: none; }
.sv-hdr .sv-soon-pop > * { margin: 0; }
.sv-hdr .sv-soon-pop > * + * { margin-top: 14px; }
.sv-hdr .sv-soon-contact .wp-block-button__link {
	padding: 10px 20px;
	border-radius: 999px;
	background: #0c0d0e;
	font-size: 12px;
	line-height: 1;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #fff;
}

@media (max-width: 1100px) {
	.sv-hdr.sv-hdr { flex-direction: column; align-items: flex-start; }
	.sv-hdr .sv-hdr-left, .sv-hdr .sv-hdr-right { width: 100%; }
	.sv-hdr .sv-soon-pop { right: auto; left: var(--pg); }
}

@media (max-width: 720px) {
	.sv-burger { display: flex; }
	.sv-hdr nav.sv-primary-nav { display: none; }
	.sv-hdr nav.sv-primary-nav[data-open="true"] {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		padding: 6px var(--pg) 14px;
		background: rgba(255, 255, 255, .97);
		-webkit-backdrop-filter: blur(18px) saturate(150%);
		backdrop-filter: blur(18px) saturate(150%);
		border-bottom: 1px solid var(--sv-stroke-hair);
		box-shadow: 0 18px 40px -18px rgba(12, 26, 42, .25);
	}
	.sv-hdr nav.sv-primary-nav[data-open="true"] { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
	.sv-hdr .sv-primary-nav[data-open="true"] .wp-block-navigation-item { border-bottom: 1px solid var(--sv-stroke-hair); }
	.sv-hdr .sv-primary-nav[data-open="true"] > ul:last-of-type > .wp-block-navigation-item:last-child { border-bottom: none; }
	.sv-hdr .sv-primary-nav[data-open="true"] .wp-block-navigation-item__content { display: flex; align-items: center; box-sizing: border-box; min-height: 44px; padding: 13px 0; border-bottom: none; font-size: 14px; }
	/* 44px touch targets (screen map §4) */
	.sv-hdr .sv-logo .custom-logo-link { display: inline-flex; align-items: center; min-height: 44px; }
	.sv-hdr .sv-cart-pill .wp-block-button__link, .sv-soon { box-sizing: border-box; min-height: 44px; }
	.sv-soon { padding-block: 15px; }   /* baseline-aligned content sits at the top edge, so the 44px comes from padding */
}
