/**
 * Fluxio primary header navigation (desktop + mobile drawer).
 * Uses theme tokens: tag-text, borders, heading fonts.
 */

/* Fixed shell (single fixed ancestor — avoids broken sticky when nested fixed + transform). */
.header-box {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 999;
	will-change: transform;
	transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Webflow Header Down: translateY(-102%) on scroll down */
.header-box.fluxio-header-scroll-hidden {
	transform: translate3d(0, -102%, 0);
	pointer-events: none;
}

.header-section {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
	width: 100%;
}

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

	.header-box.fluxio-header-scroll-hidden {
		transform: none !important;
		pointer-events: auto;
	}
}

/* Logged-in: fixed header clears WP admin bar (32px desktop, 46px ≤782px). */
body.admin-bar .header-box {
	top: 32px;
}

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

/* —— Layout: push CTA + mobile toggle to the right —— */
.header-wrapper {
	gap: clamp(12px, 2vw, 28px);
}

.header-right-box {
	margin-left: auto;
	flex-shrink: 0;
}

/* Override theme .header-info { flex-flow: column } for horizontal desktop nav */
.header-info.fluxio-primary-nav {
	flex: 1 1 auto;
	min-width: 0;
	justify-content: center;
	align-items: center;
	flex-flow: row nowrap;
	flex-direction: row;
}

/* —— Desktop horizontal menu —— */
.fluxio-primary-nav .fluxio-nav-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: row;
	flex-flow: row nowrap;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: clamp(8px, 1.2vw, 28px);
}

.fluxio-primary-nav .fluxio-nav-menu > .menu-item {
	position: relative;
	margin: 0;
	padding: 0;
}

.fluxio-primary-nav .fluxio-nav-item-inner {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
}

.fluxio-primary-nav .fluxio-nav-link {
	font-family: var(--tag--font-family, var(--_base---font-family--primary));
	color: var(--_color---text-color--paragraph-color);
	font-size: var(--tag--font-size, 12px);
	line-height: var(--tag--line-height, 1.4);
	font-weight: var(--tag--font-weight, 500);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	padding: 10px 6px;
	border-radius: var(--_base---bordar-radius--radius-sm, 8px);
	transition: color 0.25s ease, background-color 0.25s ease;
}

.fluxio-primary-nav .fluxio-nav-link:hover,
.fluxio-primary-nav .fluxio-nav-link:focus-visible,
.fluxio-primary-nav .fluxio-nav-link.w--current {
	color: var(--_color---accent-color--orange);
	outline: none;
}

.fluxio-primary-nav .fluxio-submenu-toggle {
	display: none;
}

/* Dropdown panels (2nd–4th level) */
.fluxio-primary-nav .fluxio-sub-menu {
	list-style: none;
	margin: 0;
	padding: 10px 0 14px;
	flex-direction: column;
	flex-flow: column nowrap;
	position: absolute;
	left: 0;
	top: calc(100% - 6px);
	min-width: 220px;
	background-color: var(--fluxio-bg-elevated, #1a1a1a);
	border: 1px solid var(--_color---accent-color--border);
	border-radius: var(--_base---bordar-radius--radius-sm, 8px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	z-index: 80;
}

.fluxio-primary-nav .menu-item:hover > .fluxio-sub-menu,
.fluxio-primary-nav .menu-item:focus-within > .fluxio-sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.fluxio-primary-nav .fluxio-sub-menu .fluxio-nav-link {
	white-space: nowrap;
	display: block;
	padding: 10px 18px;
	text-transform: none;
	letter-spacing: 0.02em;
	font-size: var(--body-regular--font-size, 14px);
	font-family: var(--body-regular--font-family, var(--_base---font-family--primary));
	font-weight: 400;
}

.fluxio-primary-nav .fluxio-sub-menu .menu-item {
	position: relative;
	margin: 0;
	padding: 0;
}

/* Flyout nested submenus to the right */
.fluxio-primary-nav .fluxio-sub-menu .fluxio-sub-menu {
	left: calc(100% - 1px);
	top: 0;
}

.fluxio-primary-nav .fluxio-sub-menu .menu-item:hover > .fluxio-sub-menu,
.fluxio-primary-nav .fluxio-sub-menu .menu-item:focus-within > .fluxio-sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* —— Fallback copy —— */
.fluxio-nav-fallback {
	margin: 0;
	text-align: center;
	opacity: 0.75;
}

.fluxio-nav-fallback-link {
	color: var(--_color---accent-color--orange);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* —— Mobile toggle (Remix icons) —— */
.fluxio-mobile-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--_color---accent-color--border);
	border-radius: var(--_base---bordar-radius--radius-4xl, 999px);
	background: transparent;
	color: var(--_color---text-color--paragraph-color);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.fluxio-mobile-menu-toggle:hover,
.fluxio-mobile-menu-toggle:focus-visible {
	color: var(--_color---accent-color--orange);
	border-color: var(--_color---accent-color--orange);
	outline: none;
}

.fluxio-mobile-menu-icon {
	font-size: 22px;
	line-height: 1;
}

.fluxio-mobile-menu-icon--close {
	display: none;
}

body.fluxio-mobile-nav-open .fluxio-mobile-menu-icon--open {
	display: none;
}

body.fluxio-mobile-nav-open .fluxio-mobile-menu-icon--close {
	display: block;
}

/* —— Mobile drawer (sibling of .header-box — not inside transformed header shell) —— */
.fluxio-mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 10050;
	visibility: hidden;
	pointer-events: none;
}

.fluxio-mobile-drawer:not(.fluxio-mobile-drawer--closed) {
	visibility: visible;
	pointer-events: auto;
}

.fluxio-mobile-drawer-scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.fluxio-mobile-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	width: min(420px, 92vw);
	height: 100%;
	max-height: 100dvh;
	display: flex;
	flex-direction: column;
	background-color: var(--fluxio-bg-elevated, var(--_color---accent-color--dark-shade));
	border-left: 1px solid var(--_color---accent-color--border);
	padding: env(safe-area-inset-top, 0) 20px calc(28px + env(safe-area-inset-bottom, 0));
	overflow: hidden;
	transform: translate3d(105%, 0, 0);
	transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
	-webkit-overflow-scrolling: touch;
	will-change: transform;
}

.fluxio-mobile-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0;
	padding: 16px 0 12px;
	border-bottom: 1px solid var(--_color---accent-color--border);
	margin-bottom: 12px;
}

.fluxio-mobile-drawer-head-label {
	margin: 0;
	color: var(--_color---accent-color--low-white);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fluxio-mobile-drawer-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid var(--_color---accent-color--border);
	border-radius: var(--_base---bordar-radius--radius-4xl, 999px);
	background: transparent;
	color: var(--_color---text-color--paragraph-color);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.fluxio-mobile-drawer-close:hover,
.fluxio-mobile-drawer-close:focus-visible {
	color: var(--_color---accent-color--orange);
	border-color: var(--_color---accent-color--orange);
	outline: none;
}

.fluxio-mobile-drawer-close i {
	font-size: 22px;
	line-height: 1;
}

.fluxio-mobile-drawer-nav {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding-bottom: 8px;
}

body.fluxio-mobile-nav-open .fluxio-mobile-drawer-scrim {
	opacity: 1;
}

body.fluxio-mobile-nav-open .fluxio-mobile-drawer-panel {
	transform: translate3d(0, 0, 0);
}

body.admin-bar .fluxio-mobile-drawer-panel {
	padding-top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .fluxio-mobile-drawer-panel {
		padding-top: 46px;
	}
}

/* Mobile nav tree + accordion (height animation, one sibling open per level) */
.fluxio-mobile-drawer .fluxio-nav-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.fluxio-mobile-drawer .fluxio-nav-menu > .menu-item {
	border: 1px solid var(--_color---accent-color--border);
	border-radius: var(--_base---bordar-radius--radius-sm, 8px);
	margin-bottom: 10px;
	overflow: hidden;
	background-color: var(--fluxio-bg-elevated, var(--_color---accent-color--dark-shade));
}

.fluxio-mobile-drawer .fluxio-nav-menu > .menu-item:last-child {
	margin-bottom: 0;
}

.fluxio-mobile-drawer .fluxio-sub-menu .menu-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--_color---accent-color--border);
	border-radius: 0;
	background: transparent;
}

.fluxio-mobile-drawer .fluxio-sub-menu .menu-item:last-child {
	border-bottom: none;
}

.fluxio-mobile-drawer .fluxio-nav-item-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 14px 14px 14px 16px;
}

.fluxio-mobile-drawer .fluxio-nav-menu > .menu-item > .fluxio-nav-item-inner {
	padding: 16px 14px 16px 18px;
}

/* Top level: match desktop / tag strip */
.fluxio-mobile-drawer .fluxio-nav-menu > .menu-item > .fluxio-nav-item-inner .fluxio-nav-link {
	font-family: var(--tag--font-family, var(--_base---font-family--primary));
	font-size: var(--tag--font-size, 12px);
	line-height: var(--tag--line-height, 1.4);
	font-weight: var(--tag--font-weight, 500);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--_color---text-color--paragraph-color);
}

.fluxio-mobile-drawer .fluxio-nav-link {
	flex: 1;
	min-width: 0;
	font-family: var(--body-regular--font-family, var(--_base---font-family--primary));
	font-size: var(--body-regular--font-size, 15px);
	line-height: var(--body-regular--line-height, 1.45);
	font-weight: 400;
	color: var(--_color---text-color--paragraph-color);
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0.01em;
	transition: color 0.2s ease;
}

.fluxio-mobile-drawer .fluxio-nav-link:active {
	color: var(--_color---accent-color--orange);
}

.fluxio-mobile-drawer .fluxio-nav-link.w--current {
	color: var(--_color---accent-color--orange);
}

.fluxio-mobile-drawer .fluxio-submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border: 1px solid var(--_color---accent-color--border);
	border-radius: var(--_base---bordar-radius--radius-sm, 8px);
	background-color: var(--_color---accent-color--dark-shade);
	color: var(--_color---text-color--paragraph-color);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.fluxio-mobile-drawer .fluxio-submenu-toggle:hover,
.fluxio-mobile-drawer .fluxio-submenu-toggle:focus-visible {
	color: var(--_color---accent-color--orange);
	border-color: var(--_color---accent-color--orange);
	outline: none;
}

.fluxio-mobile-drawer .menu-item.fluxio-submenu-open > .fluxio-nav-item-inner .fluxio-submenu-toggle {
	background-color: var(--fluxio-bg-elevated, var(--_color---accent-color--dark-shade));
	border-color: var(--_color---accent-color--orange);
	color: var(--_color---accent-color--orange);
}

.fluxio-mobile-drawer .fluxio-submenu-toggle i {
	font-size: 18px;
	line-height: 1;
	transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.fluxio-mobile-drawer .menu-item.fluxio-submenu-open > .fluxio-nav-item-inner .fluxio-submenu-toggle i {
	transform: rotate(180deg);
}

/* Accordion panels: animated height */
.fluxio-mobile-drawer .menu-item > .fluxio-sub-menu {
	position: static;
	display: block;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	margin: 0;
	padding: 0 12px 0 14px;
	border-left: 2px solid var(--_color---accent-color--orange);
	background-color: var(--_color---accent-color--dark-shade);
	box-shadow: inset 0 1px 0 0 var(--_color---accent-color--border);
	transition:
		max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.3s ease,
		padding 0.35s ease,
		margin 0.35s ease;
}

.fluxio-mobile-drawer .menu-item.fluxio-submenu-open > .fluxio-sub-menu {
	max-height: min(2800px, 85vh);
	opacity: 1;
	margin-top: 0;
	padding-top: 6px;
	padding-bottom: 10px;
}

.fluxio-mobile-drawer .fluxio-sub-menu .fluxio-nav-item-inner {
	padding: 12px 10px 12px 8px;
}

.fluxio-mobile-drawer .fluxio-sub-menu .fluxio-sub-menu {
	border-left-color: var(--_color---accent-color--border-light, var(--_color---accent-color--low-dark));
	margin-left: 4px;
}

.fluxio-mobile-drawer .fluxio-sub-menu .fluxio-nav-link {
	font-size: calc(var(--body-regular--font-size, 15px) * 0.94);
	color: var(--_color---accent-color--low-white, var(--_color---text-color--paragraph-color));
}

@media (prefers-reduced-motion: reduce) {
	.fluxio-mobile-drawer-scrim,
	.fluxio-mobile-drawer-panel {
		transition-duration: 0.01ms;
	}

	.fluxio-mobile-drawer .menu-item > .fluxio-sub-menu {
		transition-duration: 0.01ms;
	}

	.fluxio-mobile-drawer .fluxio-submenu-toggle,
	.fluxio-mobile-drawer .fluxio-submenu-toggle i {
		transition-duration: 0.01ms;
	}
}

/* Breakpoint: match theme mobile header tweaks (~991px) */
@media screen and (max-width: 991px) {
	.fluxio-mobile-menu-toggle {
		display: inline-flex;
	}

	.header-info.fluxio-primary-nav {
		display: none;
	}

	body.fluxio-mobile-nav-open {
		overflow: hidden;
	}
}

@media screen and (min-width: 992px) {
	.fluxio-mobile-drawer {
		display: none !important;
	}
}
