/* ============================================================================
   CAPTAIN PIPE 2.0 — HEADER  (FASE 1)
   White, minimal, premium. Desktop: brand left · nav centre · actions right.
   Mobile: brand + actions + toggle; lightweight disclosure panel.
   ========================================================================== */

.cs-header {
	background: var(--cs-bg);
	border-bottom: 1px solid var(--cs-line);
}

.cs-header__inner {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 3vw, 2.5rem);
	/* CAPTAIN-LOGO-01: raised from 76px to fit the official logo (up to
	   ~80px tall) with comfortable breathing room, without otherwise
	   touching the header's layout. */
	min-height: 96px;
}

/* ---- Brand / wordmark ------------------------------------------------ */
.cs-header__brand {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--cs-ink);
}
.cs-wordmark {
	font-family: var(--cs-font-sans);
	font-weight: 600;
	font-size: 1.0625rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	white-space: nowrap;
}
/* Scoped under .cs-header so it outranks WooCommerce's
   `.woocommerce-page img { height: auto }` (0,1,1), which otherwise blew the
   logo up to its natural size on Shop / Cart / My Account. */
.cs-header .cs-header__logo {
	display: block;
	/* CAPTAIN-LOGO-01: official crest logo. ~80px tall on desktop (within
	   the requested 70-90px range), scaling down smoothly on narrower
	   viewports; never below 56px so it stays recognisable on small
	   phones. Real image is portrait (1157x1359), so this stays compact
	   horizontally too - no risk of crowding the nav/actions. */
	height: clamp(56px, 8vw, 80px);
	width: auto;
	max-width: 100%;
	object-fit: contain; /* never stretched/deformed */
}

/* ---- Primary navigation (desktop) --------------------------------- */
.cs-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}
.cs-nav__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(1.25rem, 2.5vw, 2.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}
.cs-nav__link {
	display: inline-block;
	padding: 0.5rem 0;
	font-size: var(--cs-fs-nav);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cs-ink);
	position: relative;
}
.cs-nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.15rem;
	height: 1px;
	background: var(--cs-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--cs-dur) var(--cs-ease);
}
.cs-nav__link:hover::after,
.cs-nav__link:focus-visible::after {
	transform: scaleX(1);
}
.cs-nav__link--current {
	color: var(--cs-accent);
}
.cs-nav__link--current::after {
	transform: scaleX(1);
}

/* ---- Actions (search / account / cart / toggle) ------------------ */
.cs-header__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}
.cs-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: var(--cs-ink);
	text-decoration: none;
	border-radius: 2px;
	transition: color var(--cs-dur) var(--cs-ease),
	            background var(--cs-dur) var(--cs-ease);
}
.cs-iconbtn:hover,
.cs-iconbtn:focus-visible {
	color: var(--cs-accent);
	background: var(--cs-surface);
}
.cs-cart {
	position: relative;
}
.cs-cart__count {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	font-family: var(--cs-font-sans);
	font-size: 10px;
	font-weight: 600;
	line-height: 16px;
	text-align: center;
	color: var(--cs-accent-ink);
	background: var(--cs-ink);
	border-radius: 999px;
}

/* ---- Mobile toggle + panel -------------------------------------- */
.cs-navtoggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	color: var(--cs-ink);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.cs-mobile-nav {
	border-top: 1px solid var(--cs-line);
	background: var(--cs-bg);
}
.cs-mobile-nav__list {
	margin: 0;
	padding-block: 0.5rem 1rem;
	list-style: none;
}
.cs-mobile-nav__link {
	display: block;
	padding: 0.9rem 0;
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cs-ink);
	border-bottom: 1px solid var(--cs-line);
}
.cs-mobile-nav__link:hover,
.cs-mobile-nav__link:focus-visible {
	color: var(--cs-accent);
}
.cs-mobile-nav__link--current {
	color: var(--cs-accent);
	border-bottom-color: var(--cs-accent);
}
.cs-mobile-nav__sep {
	margin-top: 0.5rem;
}

/* ---- Responsive: collapse to mobile nav under 1024px ----------- */
@media (max-width: 1023.98px) {
	.cs-nav {
		display: none;
	}
	.cs-navtoggle {
		display: inline-flex;
	}
	.cs-header__actions {
		margin-left: auto;
	}
}

/* Desktop: hide the disclosure panel entirely (JS keeps it [hidden] too). */
@media (min-width: 1024px) {
	.cs-mobile-nav {
		display: none;
	}
}

/* ---- Small phones: prevent the top bar from crowding ------------- */
@media (max-width: 479.98px) {
	.cs-header__inner {
		gap: 0.75rem;
		min-height: 72px; /* fits the 56px-floor logo comfortably */
	}
	.cs-wordmark {
		font-size: 1rem;
		letter-spacing: 0.12em;
	}
	.cs-iconbtn {
		width: 36px;
		height: 36px;
	}
	.cs-navtoggle {
		width: 36px;
		height: 36px;
	}
	/* Search lives on the Shop page / in the menu at this width. */
	.cs-iconbtn--search {
		display: none;
	}
}
