/* =====================================================================
 * Nexus Sections — header & footer
 * ===================================================================== */
.nsx-header {
	position: relative;
	background: var(--nsx-surface);
	border-bottom: 1px solid var(--nsx-border);
	font-family: var(--nsx-font-body);
}
.nsx-header--sticky { position: sticky; top: 0; z-index: 999; }

/* Transparent over a full-bleed background hero; solid on scroll */
.nsx-header--transparent {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	background: transparent;
	border-bottom-color: transparent;
	z-index: 1000;
}
.nsx-header--transparent .nsx-header__title,
.nsx-header--transparent .nsx-menu > li > a { color: #fff; }
.nsx-header--transparent .nsx-header__burger span { background: #fff; }
/* No transform here — a transform on the header would become the containing
 * block for the fixed floating button and make it flash into the header. */
.nsx-header--transparent { transition: background 0.3s ease, box-shadow 0.3s ease; }
.nsx-header--transparent.is-scrolled {
	position: fixed;
	background: var(--nsx-surface);
	border-bottom-color: var(--nsx-border);
	box-shadow: 0 6px 24px -18px rgba(0, 0, 0, 0.4);
}
.nsx-header--transparent.is-scrolled .nsx-header__title,
.nsx-header--transparent.is-scrolled .nsx-menu > li > a { color: var(--nsx-heading); }
.nsx-header.is-scrolled { box-shadow: 0 6px 24px -18px rgba(0, 0, 0, 0.4); }
.nsx-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 68px;
	padding-block: 10px;
}
.nsx-header__brand a { display: inline-flex; align-items: center; text-decoration: none; }
.nsx-header__logo { max-height: 44px; width: auto; }
.nsx-header__title { font-family: var(--nsx-font-heading); font-size: 1.25rem; color: var(--nsx-heading); font-weight: 600; }

.nsx-header__nav { display: flex; }
.nsx-menu { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nsx-menu li { position: relative; }
.nsx-menu a {
	display: block;
	padding: 8px 14px;
	border-radius: calc(var(--nsx-radius) * 0.5);
	text-decoration: none;
	color: var(--nsx-heading);
	font-weight: 500;
}
.nsx-menu a:hover,
.nsx-menu .current-menu-item > a { color: var(--nsx-primary); }
/* Sub-menus */
.nsx-menu ul {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 190px;
	list-style: none;
	margin: 0;
	padding: 8px;
	background: var(--nsx-surface);
	border: 1px solid var(--nsx-border);
	border-radius: var(--nsx-radius);
	box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.4);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.nsx-menu li:hover > ul,
.nsx-menu li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }

/* Mega menu — add the CSS class "nsx-mega" to a top-level menu item.
 * Structure it as: parent → column headings → links under each. */
.nsx-menu > li.nsx-mega { position: static; }
.nsx-menu > li.nsx-mega > ul {
	left: 0;
	right: 0;
	width: 100%;
	min-width: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 6px 28px;
	padding: 26px clamp(20px, 5vw, 44px);
}
.nsx-menu > li.nsx-mega > ul > li > a { font-weight: 700; color: var(--nsx-heading); padding-inline: 0; }
.nsx-menu > li.nsx-mega > ul > li > ul {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	border: 0;
	min-width: 0;
	padding: 4px 0 0;
}
.nsx-menu > li.nsx-mega > ul > li > ul a { padding: 4px 0; color: var(--nsx-muted); }
.nsx-menu > li.nsx-mega > ul > li > ul a:hover { color: var(--nsx-primary); }

.nsx-header__actions { display: flex; align-items: center; gap: 12px; }

/* Header buttons — self-contained styles (frontend.css isn't loaded here) with
 * !important to beat theme / Elementor button borders. */
.nsx-header .nsx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: var(--nsx-btn-radius, 10px);
	font-family: var(--nsx-btn-font, var(--nsx-font-body)) !important;
	font-weight: var(--nsx-btn-weight, 600);
	text-transform: var(--nsx-btn-transform, none);
	letter-spacing: var(--nsx-btn-spacing, 0);
	text-decoration: none;
	line-height: 1;
	cursor: pointer;
	border: 1px solid transparent !important;
	transition: transform 0.15s ease;
}
.nsx-header .nsx-btn:hover { transform: translateY(-2px); }
.nsx-header .nsx-btn--primary { background-color: var(--nsx-primary) !important; color: var(--nsx-on-primary) !important; }
.nsx-header .nsx-btn--ghost { background: transparent !important; color: var(--nsx-heading) !important; border-color: var(--nsx-border) !important; }
.nsx-header__cta { padding: 10px 18px; }
.nsx-header__fab { display: none !important; }

/* Layout — Logo centered, menu underneath (stacked). Reads far better than
 * squeezing the menu beside a centered logo. */
.nsx-header--center .nsx-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	grid-template-areas: ". brand actions" "nav nav nav";
	row-gap: 10px;
	justify-items: center;
}
.nsx-header--center .nsx-header__brand { grid-area: brand; }
.nsx-header--center .nsx-header__actions { grid-area: actions; justify-self: end; }
.nsx-header--center .nsx-header__nav { grid-area: nav; }
.nsx-header--center .nsx-menu { justify-content: center; }

/* Layout — Logo centered with the menu split either side. */
.nsx-header--split .nsx-header__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.nsx-header--split .nsx-header__nav { grid-column: 1; justify-self: start; }
.nsx-header--split .nsx-header__brand { grid-column: 2; justify-self: center; }
.nsx-header--split .nsx-header__actions { grid-column: 3; justify-self: end; }

/* Layout — Mirrored: logo right, menu left. */
.nsx-header--right .nsx-header__inner { flex-direction: row-reverse; }
.nsx-header--right .nsx-menu { justify-content: flex-start; }

/* Style — Glass: translucent bar that blurs whatever scrolls under it. */
.nsx-header--glass,
.nsx-header--floating {
	background: var(--nsx-header-bg, rgba(255, 255, 255, 0.7)) !important;
	-webkit-backdrop-filter: blur(var(--nsx-header-blur, 14px)) saturate(160%);
	backdrop-filter: blur(var(--nsx-header-blur, 14px)) saturate(160%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
/* Glass overlays the page so there is real content behind it to blur (rather
 * than an empty strip at the top). The page content starts underneath it —
 * designed to sit over a hero. Sticky keeps it pinned + blurring while scrolling. */
.nsx-header--overlay {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	z-index: 1000;
}
.nsx-header--overlay.nsx-header--sticky { position: fixed; }
.nsx-header--floating.nsx-header--overlay { top: 14px; }
/* When overlaying, the first section clears the bar but its background still
 * fills up behind the glass (var set by hf.js). */
body.nsx-has-overlay-header .nsx-page > .nsx-sec:first-child,
body.nsx-has-overlay-header > .nsx-hero:first-child { scroll-margin-top: var( --nsx-header-h, 80px ); }
/* Style — Floating: detached rounded bar with breathing room. */
.nsx-header--floating {
	margin: 14px auto;
	width: calc(100% - 28px);
	max-width: var(--nsx-maxw, 1160px);
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	box-shadow: 0 10px 34px -18px rgba(0, 0, 0, 0.45);
}
.nsx-header--floating.nsx-header--sticky { top: 14px; }
@media (max-width: 860px) {
	.nsx-header--floating { border-radius: var(--nsx-radius, 14px); }
}

/* Mobile-only overlay pieces (hidden on desktop). Chevron toggles never show
 * on desktop and never carry a border (kills the stray Elementor outline). */
.nsx-header__nav-logo,
.nsx-header__nav-footer { display: none; }
.nsx-subtoggle { display: none !important; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none !important; }

@media (max-width: 860px) {
	/* Top bar shows only the logo; the CTA/cart leave the bar. */
	.nsx-header__actions { display: none; }
	/* Every desktop layout collapses to the same simple mobile bar. */
	.nsx-header--center .nsx-header__inner,
	.nsx-header--split .nsx-header__inner { display: flex; }
	.nsx-header--right .nsx-header__inner { flex-direction: row; }

	/* Sticky floating menu button, bottom-right (!important beats Elementor's
	 * default button styling that otherwise turns it into a pink square). */
	.nsx-header__fab {
		display: flex !important;
		position: fixed;
		right: 20px;
		bottom: 20px;
		z-index: 1300;
		width: 58px !important;
		height: 58px !important;
		min-width: 0;
		border-radius: 50% !important;
		background: var(--nsx-primary) !important;
		border: 0 !important;
		padding: 0 !important;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
		-webkit-appearance: none;
		appearance: none;
	}
	.nsx-header__fab span { position: relative; display: block; width: 24px; height: 2px; background: var(--nsx-on-primary); transition: all 0.3s ease; }
	.nsx-header__fab span::before,
	.nsx-header__fab span::after { content: ""; position: absolute; left: 0; width: 24px; height: 2px; background: var(--nsx-on-primary); transition: all 0.3s ease; }
	.nsx-header__fab span::before { top: -8px; }
	.nsx-header__fab span::after { top: 8px; }
	.nsx-header.is-open .nsx-header__fab span { background: transparent; }
	.nsx-header.is-open .nsx-header__fab span::before { top: 0; transform: rotate(45deg); }
	.nsx-header.is-open .nsx-header__fab span::after { top: 0; transform: rotate(-45deg); }

	/* Fullscreen overlay menu — colors + fonts from the global tokens */
	.nsx-header__nav {
		position: fixed;
		inset: 0;
		z-index: 1200;
		background: var(--nsx-primary);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		padding: clamp(72px, 16vw, 120px) 24px 40px;
		overflow-y: auto;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.35s ease, visibility 0.35s ease;
	}
	.nsx-header.is-open .nsx-header__nav { opacity: 1; visibility: visible; }

	.nsx-header__nav-logo { display: block; margin: 0 auto 26px; }
	.nsx-header__nav-logo img { max-height: 56px; width: auto; }
	.nsx-header__nav-logo .nsx-header__title { color: var(--nsx-on-primary) !important; }

	.nsx-menu { flex-direction: column; gap: 0; width: 100%; max-width: 440px; text-align: center; }
	.nsx-menu > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
	.nsx-menu > li > a {
		flex: 1 1 auto;
		color: var(--nsx-on-primary) !important;
		font-family: var(--nsx-font-heading);
		font-size: clamp(1.5rem, 6vw, 2rem);
		text-transform: uppercase;
		letter-spacing: 1px;
		padding: 15px 0;
		border-radius: 0;
	}
	.nsx-menu > li > a:hover { color: #fff !important; }

	/* Submenu accordion */
	.nsx-subtoggle { display: inline-flex !important; flex: 0 0 auto; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
	.nsx-subtoggle::before {
		content: "";
		width: 9px;
		height: 9px;
		border-right: 2px solid var(--nsx-on-primary);
		border-bottom: 2px solid var(--nsx-on-primary);
		transform: rotate(45deg);
		margin-top: -4px;
		transition: transform 0.3s ease;
	}
	.nsx-header__nav li.is-sub-open > .nsx-subtoggle::before { transform: rotate(-135deg); margin-top: 4px; }

	.nsx-menu .sub-menu {
		position: static;
		flex: 0 0 100%;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: rgba(0, 0, 0, 0.2);
		border: 0;
		box-shadow: none;
		border-radius: 12px;
		min-width: 0;
		margin: 0;
		padding: 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease;
	}
	.nsx-header__nav li.is-sub-open > .sub-menu { max-height: 800px; padding: 6px 16px; margin: 4px 0 14px; }
	.nsx-menu .sub-menu a { color: rgba(255, 255, 255, 0.82) !important; font-family: var(--nsx-font-heading); font-size: 1.15rem; letter-spacing: 1px; text-transform: uppercase; padding: 10px 0; }
	.nsx-menu > li.nsx-mega > ul { display: block; grid-template-columns: none; padding: 0; }

	.nsx-header__nav-footer { display: block; width: 100%; max-width: 440px; margin-top: 30px; }
	.nsx-header__nav-footer .nsx-btn { display: block; width: 100%; text-align: center; background: var(--nsx-accent) !important; color: #fff !important; border-color: var(--nsx-accent) !important; }
}

/* Footer */
.nsx-site-footer { background: var(--nsx-bg); color: var(--nsx-text); }
.nsx-footer-bar { border-top: 1px solid var(--nsx-border); padding-block: 22px; }
.nsx-footer-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.nsx-footer-bar__copy { margin: 0; color: var(--nsx-muted); font-size: 0.9rem; }
.nsx-footer-menu { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.nsx-footer-menu a { color: var(--nsx-muted); text-decoration: none; font-size: 0.9rem; }
.nsx-footer-menu a:hover { color: var(--nsx-primary); }

/* Top bar */
.nsx-topbar { background: var(--nsx-heading); color: rgba(255, 255, 255, 0.82); font-family: var(--nsx-font-body); font-size: 0.82rem; }
.nsx-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 7px; flex-wrap: wrap; }
.nsx-topbar__left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nsx-topbar a { color: rgba(255, 255, 255, 0.82) !important; text-decoration: none; }
.nsx-topbar a:hover { color: #fff !important; }
.nsx-topbar__social { display: flex; gap: 14px; }
@media (max-width: 600px) { .nsx-topbar__inner { justify-content: center; } }

/* Header search button + fullscreen overlay */
.nsx-header__search-btn { background: none; border: 0; cursor: pointer; color: var(--nsx-heading); padding: 6px; display: inline-flex; align-items: center; }
.nsx-header--transparent .nsx-header__search-btn { color: #fff; }
.nsx-header--transparent.is-scrolled .nsx-header__search-btn { color: var(--nsx-heading); }
.nsx-search { position: fixed; inset: 0; z-index: 10001; background: rgba(10, 10, 12, 0.92); display: grid; place-items: center; padding: 24px; }
.nsx-search[hidden] { display: none; }
.nsx-search__close { position: absolute; top: 18px; right: 24px; background: none; border: 0; color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.nsx-search form { width: min(680px, 92vw); display: flex; gap: 12px; align-items: center; }
.nsx-search input[type="search"],
.nsx-search input[type="text"] {
	flex: 1;
	background: transparent;
	border: 0;
	border-bottom: 2px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	font-size: clamp(1.4rem, 4vw, 2.4rem);
	font-family: var(--nsx-font-heading);
	padding: 10px 0;
}
.nsx-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.nsx-search input[type="submit"],
.nsx-search button[type="submit"] {
	background: var(--nsx-primary) !important;
	color: var(--nsx-on-primary) !important;
	border: 0 !important;
	border-radius: calc(var(--nsx-radius) * 0.5);
	padding: 12px 22px;
	cursor: pointer;
	font-weight: 600;
}

/* =====================================================================
 * Logo variants — different logo for desktop vs mobile
 * ===================================================================== */
.nsx-logo--mobile { display: none; }
@media (max-width: 860px) {
	.nsx-header__brand .nsx-logo--desktop { display: none; }
	.nsx-header__brand .nsx-logo--mobile { display: inline-block; }
}

/* =====================================================================
 * Slide-out drawer menu (header_menu = drawer) — at all widths
 * ===================================================================== */
.nsx-header__hamburger {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 42px;
	height: 42px;
	padding: 0 10px;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: inherit;
}
.nsx-header__hamburger span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nsx-header--drawer.is-open .nsx-header__hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nsx-header--drawer.is-open .nsx-header__hamburger span:nth-child(2) { opacity: 0; }
.nsx-header--drawer.is-open .nsx-header__hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* The inline menu becomes an off-canvas panel from the right. */
.nsx-header--drawer .nsx-header__nav {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	width: min(360px, 86vw);
	transform: translateX(100%);
	transition: transform .3s ease;
	background: var(--nsx-surface);
	z-index: 1300;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	padding: 84px 28px 28px;
	overflow-y: auto;
	box-shadow: -16px 0 40px -24px rgba(0, 0, 0, 0.5);
}
.nsx-header--drawer.is-open .nsx-header__nav { transform: translateX(0); }
.nsx-header--drawer .nsx-menu { flex-direction: column; align-items: stretch; gap: 2px; }
.nsx-header--drawer .nsx-menu > li > a { display: block; padding: 10px 0; }
/* Submenus render as static, always-open nested lists inside the drawer. */
.nsx-header--drawer .sub-menu {
	position: static !important;
	display: block !important;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	box-shadow: none !important;
	padding: 0 0 4px 14px !important;
	min-width: 0 !important;
	background: transparent !important;
}
.nsx-header--drawer .nsx-subtoggle { display: none !important; }
.nsx-header--drawer .nsx-header__nav-logo { display: block; margin-bottom: 18px; }
.nsx-header--drawer .nsx-header__nav-footer { display: block; margin-top: auto; }
.nsx-header--drawer .nsx-header__fab { display: none !important; }

/* Backdrop behind the drawer. */
.nsx-header__scrim {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease;
	z-index: 1200;
}
.nsx-header--drawer.is-open .nsx-header__scrim { opacity: 1; visibility: visible; }

/* On mobile the actions row is normally hidden; in drawer mode keep the
 * hamburger reachable but drop the inline CTA to save room. */
@media (max-width: 860px) {
	.nsx-header--drawer .nsx-header__actions { display: flex; }
	.nsx-header--drawer .nsx-header__cta { display: none; }
}
