/**
 * Styles for the [fitrx_site_header] shortcode.
 *
 * Everything is scoped under .fitrx-header-root (the shortcode's single
 * wrapper around both the sticky <header> and the mobile nav overlay, which
 * are siblings — the overlay is position:fixed, not nested inside <header>)
 * so this can be dropped into an existing Elementor-built page via the
 * Shortcode widget in the Header theme template without leaking into or
 * being overridden by the site's own global styles. Same approach as
 * site-footer.css. Colors match the FitRx brand palette already used by the
 * hero-banner block and the footer (ink #181818, accent red #CE0E2D, pink
 * #FFBDC8). 'Anton' is the display font used site-wide for headings,
 * expected to load from the theme. 'Manrope' is the nav/body font used
 * across every block (see fitrx_blocks_enqueue_fonts() in fitrx-blocks.php
 * for the single site-wide enqueue — not repeated per-file).
 */

.fitrx-header-root,
.fitrx-header-root *,
.fitrx-header-root *::before,
.fitrx-header-root *::after {
	box-sizing: border-box;
}

.fitrx-header-root {
	width: 100%;
	--ink: #181818;
	--ink-2: #121212;
	--red: #ce0e2d;
	--red-dim: #a80c25;
	--pink: #ffbdc8;
	--paper: #f7f3ee;
	--line: rgba(255, 255, 255, 0.12);
	--line-soft: rgba(255, 255, 255, 0.07);
	--ink-soft: rgba(255, 255, 255, 0.68);
	--ink-softer: rgba(255, 255, 255, 0.42);
	--header-h: 76px;

	color: #fff;
	font-family: 'Manrope', sans-serif;
	-webkit-font-smoothing: antialiased;
}

.fitrx-header-root a {
	color: inherit;
	text-decoration: none;
}
.fitrx-header-root button {
	font-family: inherit;
	cursor: pointer;
	padding: 0; /* the theme's own reset.css sets button { padding: .5rem 1rem }; .fitrx-nav-link overrides this itself via a more specific rule, but .fitrx-burger/.fitrx-icon-btn never declared their own padding at all, so the theme's won by default and ate into their fixed 52x52 box */
	border: none;
	background: none;
	appearance: none;
	-webkit-appearance: none;
	line-height: normal;
}
.fitrx-header-root ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fitrx-header-root :focus-visible {
	outline: 2px solid var(--pink);
	outline-offset: 3px;
}

/* ============ HEADER ============ */
.fitrx-header-root .fitrx-site-header {
	position: sticky;
	top: 0;
	width: 100%;
	z-index: 100;
	background: var(--ink);
	border-bottom: 1px solid var(--line-soft);
	transition: border-color 0.3s ease;
}
.fitrx-header-root .fitrx-site-header.is-scrolled {
	border-color: var(--line);
	box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.6);
}

.fitrx-header-root .fitrx-header-inner {
	max-width: 1520px;
	margin: 0 auto;
	height: var(--header-h);
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 40px;
	transition: height 0.3s ease;
}
.fitrx-header-root .fitrx-site-header.is-scrolled .fitrx-header-inner { height: 64px; }

.fitrx-header-root .fitrx-logo {
	display: flex;
	flex-direction: column;
	line-height: 1;
	flex-shrink: 0;
	position: relative;
}
.fitrx-header-root .fitrx-logo-img {
	display: block;
	height: 28px;
	width: auto;
}

/* ---- primary nav ---- */
.fitrx-header-root .fitrx-primary-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.fitrx-header-root .fitrx-nav-item { position: relative; }
.fitrx-header-root .fitrx-nav-link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 16px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--ink-soft);
	border: none;
	background: none;
	transition: color 0.2s ease;
}
.fitrx-header-root .fitrx-nav-link:hover,
.fitrx-header-root .fitrx-nav-link:focus-visible,
.fitrx-header-root .fitrx-nav-item.is-open .fitrx-nav-link { color: #fff; }
.fitrx-header-root .fitrx-nav-link .fitrx-chev { transition: transform 0.25s ease; opacity: 0.6; }
.fitrx-header-root .fitrx-nav-item.is-open .fitrx-nav-link .fitrx-chev { transform: rotate(180deg); }

.fitrx-header-root .fitrx-nav-underline {
	position: absolute;
	left: 16px; right: 16px; bottom: 6px;
	height: 2px;
	background: var(--red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}
.fitrx-header-root .fitrx-nav-link:hover ~ .fitrx-nav-underline,
.fitrx-header-root .fitrx-nav-link:focus-visible ~ .fitrx-nav-underline { transform: scaleX(1); }

/* ---- mega menu ----
 * .fitrx-mega is the hoverable hit-area: it sits flush against the trigger
 * (top: 100%, no vertical offset) so the mouse never crosses a dead zone
 * that belongs to the header instead of the menu. The visual gap and
 * slide-in motion live on .fitrx-mega-panel (via padding-top + its own
 * transform), which is purely decorative and doesn't affect hit-testing.
 */
.fitrx-header-root .fitrx-mega {
	position: absolute;
	top: 100%;
	left: 0; /* aligned to the trigger's own left edge, not centered under it — centering a 620px panel under an ~80px word pulled it visually far away from what you clicked */
	width: 620px;
	padding-top: 12px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.22s ease, visibility 0.22s;
}
.fitrx-header-root .fitrx-nav-item.is-open .fitrx-mega {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.fitrx-header-root .fitrx-mega-panel {
	background: var(--ink-2);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.65);
	padding: 28px;
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 24px;
	transform: translateY(-6px);
	transition: transform 0.22s ease;
}
.fitrx-header-root .fitrx-nav-item.is-open .fitrx-mega-panel {
	transform: translateY(0);
}
.fitrx-header-root .fitrx-mega-col-title {
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: var(--ink-softer);
	margin: 0 0 14px;
}
.fitrx-header-root .fitrx-mega-links li + li { margin-top: 2px; }
.fitrx-header-root .fitrx-mega-links a {
	display: block;
	padding: 8px 10px;
	margin: 0 -10px;
	border-radius: 8px;
	font-size: 14.5px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.88);
	transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.fitrx-header-root .fitrx-mega-links a:hover,
.fitrx-header-root .fitrx-mega-links a:focus-visible {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	padding-left: 16px;
}
.fitrx-header-root .fitrx-mega-promo {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: var(--paper);
	display: flex;
	flex-direction: column;
	min-height: 190px;
}
.fitrx-header-root .fitrx-mega-promo-media {
	position: relative;
	aspect-ratio: 1 / 1; /* the featured product photo is square (1920x1920) — match it so object-fit: contain fills the box */
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.fitrx-header-root .fitrx-mega-promo-media img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.fitrx-header-root .fitrx-mega-promo-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--red);
	color: #fff;
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 999px;
	z-index: 1;
}
.fitrx-header-root .fitrx-mega-promo-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
	justify-content: flex-end;
}
.fitrx-header-root .fitrx-mega-promo-title {
	font-family: 'Anton', sans-serif;
	font-size: 19px;
	line-height: 1.08;
	text-transform: uppercase;
	color: var(--ink);
	margin: 0 0 10px;
}
.fitrx-header-root .fitrx-mega-promo-link {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12.5px; font-weight: 800;
	color: var(--red);
	text-decoration: underline; text-underline-offset: 3px;
	width: fit-content;
	transition: color 0.15s ease;
}
.fitrx-header-root .fitrx-mega-promo-link:hover { color: var(--red-dim); }

.fitrx-header-root .fitrx-mega--simple {
	width: 260px;
	left: auto;
	right: 0;
}
.fitrx-header-root .fitrx-mega--simple .fitrx-mega-panel {
	grid-template-columns: 1fr;
}

/* ---- header actions ---- */
.fitrx-header-root .fitrx-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	margin-left: auto; /* anchors to the right edge on its own — needed on mobile, where .fitrx-primary-nav (which does this on desktop via flex: 1) is display:none and no longer provides that push */
}
.fitrx-header-root .fitrx-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px; height: 52px;
	border: none;
	background: transparent;
	color: #fff;
	border-radius: 50%;
	transition: background 0.2s ease;
}
.fitrx-header-root .fitrx-icon-btn:hover,
.fitrx-header-root .fitrx-icon-btn:focus-visible { background: rgba(255, 255, 255, 0.08); }
.fitrx-header-root .fitrx-shop-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	margin-left: 6px;
	border-radius: 999px;
	background: var(--red);
	color: #fff;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	box-shadow: 0 10px 24px -12px rgba(206, 14, 45, 0.7);
	transition: transform 0.2s ease, background 0.2s ease;
	white-space: nowrap;
}
.fitrx-header-root .fitrx-shop-cta:hover { background: var(--red-dim); transform: translateY(-1px); }

.fitrx-header-root .fitrx-burger {
	display: none;
	width: 52px; height: 52px;
	border: none; background: none;
	color: #fff;
	align-items: center; justify-content: center;
	border-radius: 8px;
}
.fitrx-header-root .fitrx-burger:hover { background: rgba(255, 255, 255, 0.08); }

/* ============ MOBILE NAV OVERLAY ============ */
.fitrx-header-root .fitrx-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: var(--ink-2);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
	overflow-y: auto;
}
.fitrx-header-root .fitrx-mobile-nav.is-open { transform: translateX(0); }
.fitrx-header-root .fitrx-mobile-nav::before {
	content: '';
	position: fixed;
	width: 380px; height: 380px;
	background: var(--red);
	opacity: 0.22;
	filter: blur(90px);
	border-radius: 50%;
	top: -120px; right: -140px;
	pointer-events: none;
}
.fitrx-header-root .fitrx-mobile-nav::after {
	content: '';
	position: fixed;
	width: 260px; height: 260px;
	background: var(--pink);
	opacity: 0.12;
	filter: blur(80px);
	border-radius: 50%;
	bottom: 10%; left: -100px;
	pointer-events: none;
}
.fitrx-header-root .fitrx-mobile-nav-top {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--line-soft);
	position: relative; z-index: 1;
}
.fitrx-header-root .fitrx-mobile-nav-list {
	position: relative; z-index: 1;
	padding: 12px 24px 40px;
	flex: 1;
}
.fitrx-header-root .fitrx-mobile-nav-list > li {
	border-bottom: 1px solid var(--line-soft);
}
.fitrx-header-root .fitrx-mobile-nav-list > li > a,
.fitrx-header-root .fitrx-mobile-nav-list summary {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 4px;
	font-family: 'Anton', sans-serif;
	font-size: 22px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	list-style: none;
	cursor: pointer;
}
.fitrx-header-root .fitrx-mobile-nav-list summary::-webkit-details-marker { display: none; }
.fitrx-header-root .fitrx-mobile-nav-list summary .fitrx-chev { transition: transform 0.25s ease; }
.fitrx-header-root details[open] summary .fitrx-chev { transform: rotate(180deg); }
.fitrx-header-root .fitrx-mobile-sub { padding: 0 4px 18px; }
.fitrx-header-root .fitrx-mobile-sub li + li { margin-top: 2px; }
.fitrx-header-root .fitrx-mobile-sub a {
	display: block;
	padding: 10px 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink-soft);
}
.fitrx-header-root .fitrx-mobile-nav-foot {
	position: relative; z-index: 1;
	padding: 22px 24px 34px;
	display: flex;
	gap: 14px;
}
.fitrx-header-root .fitrx-mobile-nav-foot .fitrx-shop-cta { margin: 0; flex: 1; justify-content: center; }

@media (max-width: 980px) {
	.fitrx-header-root .fitrx-primary-nav { display: none; }
	.fitrx-header-root .fitrx-burger { display: inline-flex; }
	.fitrx-header-root .fitrx-header-inner { padding: 0 20px; gap: 16px; }
	.fitrx-header-root .fitrx-shop-cta { display: none; }
}
@media (min-width: 981px) {
	.fitrx-header-root .fitrx-mobile-nav { display: none; }
}
