/**
 * Header V2 — the site header from the WEMountain design.
 *
 * The design draft carries its styling in inline `style` attributes; a header
 * that renders on every page of the sales site cannot, because it has states
 * (scrolled, panel open, menu open), breakpoints and pseudo-elements. So the
 * draft's values are written out here as rules instead, in the draft's order:
 * the bar, the utility controls, the navigation row, the mega panels, and the
 * full-screen menu.
 *
 * Everything is scoped to .wem-header or .wem-menu, and the page-level rules to
 * body.wem-header-v2, so nothing reaches the rest of the site. The explicit
 * values on headings, links, buttons and form controls are deliberate: the
 * BuddyBoss stylesheets style those bare elements site-wide, and inheritance
 * alone would not survive them.
 */

/* ------------------------------------------------------------------ *
 * 1. The page under the header
 * ------------------------------------------------------------------ */

/*
 * The header is fixed, so it is out of flow. A page that opens with the
 * landing hero wants the header over its artwork and pads itself; every other
 * page has to be pushed down by the header's height, or its first element
 * starts underneath the bar.
 */
body.wem-header-v2:not(.wem-header-v2-overlay) #page {
	padding-top: 128px;
}

@media (max-width: 760px) {
	body.wem-header-v2:not(.wem-header-v2-overlay) #page {
		padding-top: 76px;
	}
}

/* The admin bar is itself fixed, and sits above the header. */
body.wem-header-v2.admin-bar .wem-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.wem-header-v2.admin-bar .wem-header {
		top: 46px;
	}
}

/* ------------------------------------------------------------------ *
 * 2. The bar
 * ------------------------------------------------------------------ */

.wem-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 500;
	box-sizing: border-box;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background: linear-gradient(180deg, rgba(12, 15, 18, .82) 0%, rgba(12, 15, 18, .55) 60%, rgba(12, 15, 18, 0) 100%);
	transition: background .3s ease;
}

/*
 * Solid once the page has scrolled, while a panel is open, and from the first
 * paint on any page that does not put the header over its own artwork.
 */
.wem-header[data-solid="1"],
.wem-header[data-mega="1"] {
	background: rgba(12, 15, 18, .96);
	backdrop-filter: blur(10px);
}

.wem-header[data-drop="blue"][data-solid="1"],
.wem-header[data-drop="blue"][data-mega="1"] {
	background: rgba(10, 47, 143, .97);
}

.wem-header *,
.wem-header *::before,
.wem-header *::after,
.wem-menu *,
.wem-menu *::before,
.wem-menu *::after {
	box-sizing: border-box;
}

.wem-header-grid {
	width: min(100%, 1540px);
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 76px;
	padding: 0 clamp(22px, 5.5vw, 88px);
}

.wem-header-logo {
	display: block;
	flex: none;
	line-height: 0;
}

.wem-header-logo img {
	height: 52px;
	width: auto;
	display: block;
	max-width: none;
}

.wem-header-utils {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
}

/* ------------------------------------------------------------------ *
 * 3. The utility controls: language, search, cart, account
 * ------------------------------------------------------------------ */

.wem-util {
	position: relative;
	display: flex;
	align-items: center;
	height: 76px;
}

.wem-util--language {
	margin-right: 6px;
}

.wem-util--account {
	margin-left: 4px;
}

.wem-header .wem-util-button {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 10px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .16em;
	line-height: 1;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none;
}

.wem-header .wem-util-button--icon {
	justify-content: center;
	width: 40px;
	padding: 0;
	gap: 0;
}

.wem-header .wem-util-button--avatar {
	justify-content: center;
	width: 40px;
	padding: 0;
	gap: 0;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 999px;
	background: rgba(255, 255, 255, .08);
}

.wem-header .wem-cart {
	position: relative;
	text-decoration: none;
}

.wem-cart-count {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: #0047e0;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.wem-header[data-drop="blue"][data-solid="1"] .wem-cart-count,
.wem-header[data-drop="blue"][data-mega="1"] .wem-cart-count {
	background: #fff;
	color: #0a2f8f;
}

/* The dropdown under a utility control. */
.wem-drop {
	position: absolute;
	top: 100%;
	right: 0;
	width: 170px;
	padding: 10px 6px;
	background: #0c0f12;
	border: 1px solid rgba(255, 255, 255, .12);
	border-top: 2px solid #0047e0;
	box-shadow: 0 24px 50px rgba(0, 0, 0, .45);
	display: flex;
	flex-direction: column;
	z-index: 60;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.wem-header[data-drop="blue"] .wem-drop {
	background: #0a2f8f;
	border-color: rgba(255, 255, 255, .18);
	border-top-color: #fff;
}

/*
 * Open on hover for a pointer, and on click everywhere: a touch screen has no
 * hover, and the click state is what the button's aria-expanded reports.
 */
.wem-util:hover > .wem-drop,
.wem-util:focus-within > .wem-drop,
.wem-util[data-open="1"] > .wem-drop {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .18s ease, transform .18s ease;
}

.wem-header .wem-drop a,
.wem-header .wem-drop button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.wem-header .wem-drop--language a {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	padding: 9px 14px;
}

.wem-header .wem-drop a:hover,
.wem-header .wem-drop a:focus-visible,
.wem-header .wem-drop button:hover {
	background: rgba(255, 255, 255, .12);
	color: #fff;
}

.wem-drop-divider {
	height: 1px;
	background: rgba(255, 255, 255, .12);
	margin: 6px 8px;
}

/* The search panel is wider than a list of links, and holds a form. */
.wem-drop--search {
	width: 320px;
	padding: 14px;
}

.wem-drop--search form {
	display: flex;
	gap: 8px;
}

.wem-header .wem-drop--search input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 0;
	background: rgba(255, 255, 255, .06);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
}

.wem-header .wem-drop--search input[type="search"]::placeholder {
	color: rgba(255, 255, 255, .6);
}

.wem-header .wem-drop--search button[type="submit"] {
	width: auto;
	padding: 0 14px;
	height: 40px;
	background: #0047e0;
	color: #fff;
	font-family: 'Big Shoulders', sans-serif;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
}

/* The account panel's identity row. */
.wem-account-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px 14px;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
	margin-bottom: 6px;
}

.wem-account-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: #0047e0;
	color: #fff;
	font-family: 'Big Shoulders', sans-serif;
	font-size: 20px;
	font-weight: 900;
}

.wem-header[data-drop="blue"] .wem-account-avatar {
	background: #fff;
	color: #0a2f8f;
}

.wem-account-identity {
	min-width: 0;
}

.wem-account-name {
	display: block;
	font-family: 'Big Shoulders', sans-serif;
	font-size: 22px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
}

.wem-account-handle {
	display: block;
	margin-top: 3px;
	color: rgba(255, 255, 255, .7);
	font-size: 12px;
}

.wem-drop--account {
	width: 250px;
	padding: 8px;
}

/* ------------------------------------------------------------------ *
 * 4. The navigation row
 * ------------------------------------------------------------------ */

.wem-nav2 {
	width: min(100%, 1540px);
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(14px, 2vw, 32px);
	height: 52px;
	padding: 0 clamp(22px, 5.5vw, 88px);
	overflow-x: auto;
	scrollbar-width: none;
}

.wem-nav2::-webkit-scrollbar {
	display: none;
}

.wem-header .wem-nav-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 7px;
	height: 52px;
	padding: 0 2px;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 3px 14px rgba(0, 0, 0, .5);
	transition: color .2s ease;
}

.wem-header .wem-nav-link::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .6);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}

.wem-header .wem-nav-link:hover::after,
.wem-header .wem-nav-link:focus-visible::after,
.wem-header .wem-nav-link[aria-expanded="true"]::after {
	transform: scaleX(1);
}

.wem-header .wem-nav-link:hover,
.wem-header .wem-nav-link:focus-visible,
.wem-header .wem-nav-link[aria-expanded="true"] {
	color: #c9dbff;
}

.wem-header[data-solid="1"] .wem-nav-link:hover,
.wem-header[data-solid="1"] .wem-nav-link:focus-visible,
.wem-header[data-mega="1"] .wem-nav-link[aria-expanded="true"] {
	color: #8fb2ff;
}

.wem-header[data-solid="1"] .wem-nav-link::after,
.wem-header[data-mega="1"] .wem-nav-link::after {
	background: #8fb2ff;
	box-shadow: none;
}

.wem-header .wem-nav-burger {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin-left: 4px;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

/* ------------------------------------------------------------------ *
 * 5. The mega panels
 * ------------------------------------------------------------------ */

.wem-mega {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #0c0f12;
	border-top: 1px solid rgba(255, 255, 255, .12);
	box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
	animation: wem-header-fade-up .28s cubic-bezier(.2, .7, .2, 1) both;
}

.wem-header[data-drop="blue"] .wem-mega {
	background: #0a2f8f;
	border-top-color: rgba(255, 255, 255, .18);
}

.wem-mega[hidden] {
	display: none;
}

@keyframes wem-header-fade-up {
	from { opacity: 0; transform: translateY(30px); }
	to   { opacity: 1; transform: none; }
}

.wem-mega-grid {
	width: min(100%, 1540px);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
	gap: clamp(32px, 4vw, 72px);
	padding: 36px clamp(22px, 5.5vw, 88px) 44px;
}

.wem-mega-eyebrow {
	margin: 0 0 18px;
	color: #8fb2ff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .25em;
	text-transform: uppercase;
}

.wem-header[data-drop="blue"] .wem-mega-eyebrow {
	color: rgba(255, 255, 255, .72);
}

.wem-mega-links {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 10px 40px;
}

.wem-header .wem-mega-links a {
	display: block;
	padding: 6px 0;
	color: #fff;
	font-family: 'Big Shoulders', sans-serif;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.05;
	text-decoration: none;
	text-transform: uppercase;
	transition: color .18s ease;
}

.wem-header .wem-mega-links a:hover,
.wem-header .wem-mega-links a:focus-visible {
	color: #8fb2ff;
}

.wem-mega-img {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wem-header .wem-mega-img img {
	width: 100%;
	height: 240px;
	max-width: 100%;
	object-fit: cover;
	display: block;
}

.wem-header .wem-mega-img p {
	margin: 0;
	max-width: 40ch;
	color: rgba(255, 255, 255, .78);
	font-size: 14px;
	line-height: 1.55;
}

/* ------------------------------------------------------------------ *
 * 6. The full-screen menu
 * ------------------------------------------------------------------ */

.wem-menu {
	position: fixed;
	inset: 0;
	z-index: 700;
	background: transparent;
	color: #fff;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility 0s linear .3s;
}

.wem-menu[hidden] {
	display: none;
}

.wem-menu[data-open="1"] {
	opacity: 1;
	visibility: visible;
	transition: opacity .15s ease;
}

.wem-menu-img {
	position: absolute;
	inset: 0;
	/* The photograph is set inline by template-parts/header-v2.php, from the media library. */
	background: #0c0f12 center 30% / cover no-repeat;
	transform: translateX(100%);
}

.wem-menu-img::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(12, 15, 18, .05) 0%, rgba(12, 15, 18, .45) 100%);
}

.wem-menu-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 0;
	width: 56%;
	background: #0c0f12;
	transform: translateX(100%);
}

.wem-menu-inner {
	position: absolute;
	inset: 0;
	overflow: auto;
	padding: 0 clamp(22px, 5.5vw, 88px);
	opacity: 0;
	transform: translateX(40px);
}

.wem-menu-width {
	width: min(100%, 1540px);
	margin: 0 auto;
}

/* The panel slides in, then the words arrive. */
.wem-menu[data-open="1"] .wem-menu-img {
	transform: none;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.wem-menu[data-open="1"] .wem-menu-panel {
	transform: none;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1) .3s;
}

.wem-menu[data-open="1"] .wem-menu-inner {
	opacity: 1;
	transform: none;
	transition: opacity .45s ease .7s, transform .6s cubic-bezier(.2, .7, .2, 1) .7s;
}

.wem-menu-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 84px;
}

.wem-menu-head img {
	height: 54px;
	width: auto;
	max-width: none;
	display: block;
}

.wem-menu .wem-menu-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
}

.wem-menu-grid {
	display: grid;
	grid-template-columns: calc(44vw - clamp(22px, 5.5vw, 88px)) minmax(0, 1fr);
	gap: clamp(28px, 4vw, 64px);
	padding: clamp(24px, 5vh, 56px) 0 60px;
}

.wem-menu-big {
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2.2vh, 22px);
	padding-right: clamp(20px, 3vw, 44px);
}

.wem-menu .wem-menu-big a {
	display: block;
	color: #fff;
	font-family: 'Big Shoulders', sans-serif;
	font-size: clamp(30px, 3.4vw, 64px);
	font-weight: 900;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	text-shadow: 0 2px 20px rgba(0, 0, 0, .45);
	transition: color .18s ease;
}

.wem-menu-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 34px 28px;
	align-content: start;
	padding-top: 8px;
}

.wem-menu-eyebrow {
	margin: 0 0 14px;
	color: #8fb2ff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .25em;
	text-transform: uppercase;
}

.wem-menu-col-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wem-menu .wem-menu-col-links a {
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	transition: color .18s ease;
}

.wem-menu a:hover,
.wem-menu a:focus-visible {
	color: #8fb2ff;
}

/* ------------------------------------------------------------------ *
 * 7. Breakpoints
 * ------------------------------------------------------------------ */

@media (max-width: 1240px) {
	.wem-mega-grid {
		grid-template-columns: minmax(0, 1fr) minmax(240px, 34%);
	}

	.wem-header .wem-mega-img img {
		height: 180px;
	}
}

@media (max-width: 1100px) {
	.wem-nav2 {
		gap: 14px;
	}

	.wem-header .wem-nav-link {
		font-size: 11.5px;
		letter-spacing: .1em;
	}
}

@media (max-width: 760px) {
	.wem-nav-row {
		display: none;
	}

	.wem-header .wem-nav-burger {
		display: flex;
	}

	.wem-hdr-lang-label {
		display: none;
	}

	.wem-mega-img {
		display: none;
	}

	.wem-mega-grid {
		grid-template-columns: 1fr;
	}

	.wem-util {
		height: 76px;
	}

	.wem-menu-panel {
		width: 100%;
		background: rgba(12, 15, 18, .88);
	}

	.wem-menu-grid {
		grid-template-columns: 1fr;
	}

	.wem-menu .wem-menu-big a {
		font-size: clamp(36px, 9vw, 48px);
	}
}

@media (max-width: 640px) {
	.wem-hdr-hide-sm {
		display: none;
	}
}

/* ------------------------------------------------------------------ *
 * 8. Focus and reduced motion
 * ------------------------------------------------------------------ */

.wem-header a:focus-visible,
.wem-header button:focus-visible,
.wem-header input:focus-visible,
.wem-menu a:focus-visible,
.wem-menu button:focus-visible {
	outline: 3px solid #8fb2ff;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.wem-header *,
	.wem-header *::before,
	.wem-header *::after,
	.wem-menu *,
	.wem-menu *::before,
	.wem-menu *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
