/**
 * LXA Premium Sticky Header - Base & Isolated Styles
 *
 * NOTE: Every rule is strictly scoped under .lxa-sticky-header.
 * Zero global tags or third-party styles are modified.
 */

/* Safe Scoped Box-Sizing & Reset */
.lxa-sticky-header,
.lxa-sticky-header *,
.lxa-sticky-header *::before,
.lxa-sticky-header *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* Base Header Container */
.lxa-sticky-header {
	position: fixed;
	top: var(--lxa-top-offset, 16px);
	left: 0;
	right: 0;
	margin: 0 auto;
	width: var(--lxa-width, 94%);
	max-width: var(--lxa-max-width, 1380px);
	height: var(--lxa-height, 72px);
	z-index: var(--lxa-z-index, 9999);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--lxa-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	pointer-events: none; /* Allow click-through in margins outside the inner bar */
	transition:
		height 250ms cubic-bezier(0.16, 1, 0.3, 1),
		transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
		opacity 300ms ease,
		top 250ms ease;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Safe Area Inset Support for iOS Notches */
@supports (padding-top: env(safe-area-inset-top)) {
	.lxa-sticky-header {
		top: calc(var(--lxa-top-offset, 16px) + env(safe-area-inset-top));
	}
}

/* Position Variants */
.lxa-sticky-header.lxa-pos--sticky {
	position: -webkit-sticky;
	position: sticky;
}

.lxa-sticky-header.lxa-pos--fixed {
	width: 100%;
	max-width: 100%;
	top: 0;
	--lxa-radius: 0px;
}

/* Header Container (The Glass Card) */
.lxa-sticky-header__container {
	width: 100%;
	height: 100%;
	pointer-events: auto; /* Re-enable pointer events for the bar */
	background-color: var(--lxa-bg-color, rgba(15, 23, 42, 0.82));
	border: 1px solid var(--lxa-border-color, rgba(255, 255, 255, 0.12));
	border-radius: var(--lxa-radius, 18px);
	box-shadow: var(--lxa-shadow, 0 10px 30px rgba(0, 0, 0, 0.35));
	-webkit-backdrop-filter: blur(var(--lxa-blur, 18px)) saturate(var(--lxa-saturate, 180%));
	backdrop-filter: blur(var(--lxa-blur, 18px)) saturate(var(--lxa-saturate, 180%));
	position: relative;
	transition:
		background-color 300ms ease,
		border-color 300ms ease,
		box-shadow 300ms ease,
		border-radius 250ms ease;
}

/* Glossy Top Reflection Highlight */
.lxa-sticky-header.lxa-has-reflection .lxa-sticky-header__container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 45%;
	background: linear-gradient(180deg, rgba(255, 255, 255, var(--lxa-reflection-opacity, 0.12)) 0%, rgba(255, 255, 255, 0) 100%);
	border-top-left-radius: inherit;
	border-top-right-radius: inherit;
	pointer-events: none;
}

/* Subtle Edge Glow */
.lxa-sticky-header.lxa-has-glow .lxa-sticky-header__container {
	box-shadow: var(--lxa-shadow), 0 0 var(--lxa-glow-spread, 12px) var(--lxa-glow-color, rgba(99, 102, 241, 0.3));
}

/* Inner Layout */
.lxa-sticky-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 24px;
	position: relative;
	z-index: 2;
}

/* Brand / Logo */
.lxa-sticky-header__logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.lxa-sticky-header__logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	outline: none;
}

.lxa-sticky-header__logo-link:focus-visible {
	outline: 2px solid var(--lxa-menu-hover, #38bdf8);
	outline-offset: 4px;
	border-radius: 4px;
}

.lxa-sticky-header__logo-img {
	max-width: var(--lxa-logo-width, 140px);
	height: auto;
	display: block;
	transition: max-width 250ms ease;
}

.lxa-sticky-header__logo-text {
	font-weight: 700;
	font-size: 1.2rem;
	letter-spacing: -0.02em;
	color: var(--lxa-menu-color, #f8fafc);
	transition: color 200ms ease;
}

/* Navigation System */
.lxa-sticky-header__nav {
	display: flex;
	align-items: center;
	height: 100%;
}

.lxa-sticky-header__menu {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: var(--lxa-menu-spacing, 28px);
	height: 100%;
}

.lxa-sticky-header__item {
	position: relative;
	display: flex;
	align-items: center;
	height: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lxa-sticky-header__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	color: var(--lxa-item-color, var(--lxa-menu-color, #f1f5f9));
	font-size: var(--lxa-font-size, 15px);
	font-weight: var(--lxa-font-weight, 500);
	letter-spacing: var(--lxa-letter-spacing, 0.2px);
	text-transform: var(--lxa-text-transform, none);
	line-height: var(--lxa-line-height, 1.5);
	text-decoration: none;
	border-radius: 10px;
	position: relative;
	transition:
		color var(--lxa-transition-speed, 250ms) ease,
		background-color var(--lxa-transition-speed, 250ms) ease,
		transform 200ms ease;
	outline: none;
}

.lxa-sticky-header__link:focus-visible {
	outline: 2px solid var(--lxa-menu-hover, #38bdf8);
	outline-offset: 2px;
}

/* Hover & Active Effects */

/* Pill Hover */
.lxa-hover--pill .lxa-sticky-header__link:hover,
.lxa-hover--pill .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	background-color: var(--lxa-menu-pill-bg, rgba(255, 255, 255, 0.08));
	color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

/* Underline Hover */
.lxa-hover--underline .lxa-sticky-header__link::after {
	content: '';
	position: absolute;
	bottom: 6px;
	left: 14px;
	right: 14px;
	height: 2px;
	background-color: var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8));
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform var(--lxa-transition-speed, 250ms) cubic-bezier(0.16, 1, 0.3, 1);
}

.lxa-hover--underline .lxa-sticky-header__link:hover::after,
.lxa-hover--underline .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link::after {
	transform: scaleX(1);
	background-color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

.lxa-hover--underline .lxa-sticky-header__link:hover,
.lxa-hover--underline .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

/* Glow Hover */
.lxa-hover--glow .lxa-sticky-header__link:hover,
.lxa-hover--glow .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
	text-shadow: 0 0 12px var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

/* Scale Hover */
.lxa-hover--scale .lxa-sticky-header__link:hover,
.lxa-hover--scale .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	transform: translateY(-1px) scale(1.04);
	color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

/* Text Color Only Hover */
.lxa-hover--text_color .lxa-sticky-header__link:hover,
.lxa-hover--text_color .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	color: var(--lxa-menu-active, var(--lxa-item-hover, var(--lxa-menu-hover, #38bdf8)));
}

/* Chevron Arrow */
.lxa-sticky-header__arrow {
	display: inline-flex;
	align-items: center;
	margin-left: 2px;
}

.lxa-arrow-icon {
	width: 12px;
	height: 12px;
	transition: transform 200ms ease;
}

.lxa-sticky-header__item.lxa-has-dropdown:hover > .lxa-sticky-header__link .lxa-arrow-icon,
.lxa-sticky-header__item.lxa-has-dropdown:focus-within > .lxa-sticky-header__link .lxa-arrow-icon {
	transform: rotate(180deg);
}

/* Dropdown Submenus */
.lxa-sticky-header__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 210px;
	background-color: var(--lxa-dropdown-bg, rgba(15, 23, 42, 0.95));
	border: 1px solid var(--lxa-dropdown-border, rgba(255, 255, 255, 0.14));
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	list-style: none;
	margin: 0;
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
	pointer-events: none;
	z-index: 100;
}

.lxa-sticky-header__item.lxa-has-dropdown:hover > .lxa-sticky-header__dropdown,
.lxa-sticky-header__item.lxa-has-dropdown:focus-within > .lxa-sticky-header__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.lxa-sticky-header__dropdown .lxa-sticky-header__item {
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
}

.lxa-sticky-header__dropdown .lxa-sticky-header__link {
	width: 100%;
	display: flex;
	align-items: center;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--lxa-dropdown-text, #e2e8f0);
}

.lxa-sticky-header__dropdown .lxa-sticky-header__link:hover,
.lxa-sticky-header__dropdown .lxa-sticky-header__item.lxa-is-active > .lxa-sticky-header__link {
	color: var(--lxa-dropdown-hover, #38bdf8);
	background-color: var(--lxa-dropdown-hover-bg, rgba(255, 255, 255, 0.06));
}

/* Actions Section (CTA + Hamburger) */
.lxa-sticky-header__actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

/* CTA Button */
.lxa-sticky-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--lxa-cta-bg, #6366f1);
	color: var(--lxa-cta-text, #ffffff);
	border: 1px solid var(--lxa-cta-border, rgba(255, 255, 255, 0.2));
	border-radius: var(--lxa-cta-radius, 12px);
	padding: var(--lxa-cta-py, 10px) var(--lxa-cta-px, 20px);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.2px;
	text-decoration: none;
	line-height: 1.2;
	transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
	cursor: pointer;
	flex-shrink: 0;
	outline: none;
	position: relative;
	overflow: hidden;
}

.lxa-sticky-header__cta:hover {
	background: var(--lxa-cta-hover-bg, #4f46e5);
	color: var(--lxa-cta-hover-text, #ffffff);
	transform: translateY(-1px);
}

.lxa-sticky-header__cta:focus-visible {
	outline: 2px solid var(--lxa-cta-text, #ffffff);
	outline-offset: 2px;
}

.lxa-cta--glow {
	box-shadow: 0 4px 16px var(--lxa-cta-glow-color, rgba(99, 102, 241, 0.45));
}

.lxa-cta--glow:hover {
	box-shadow: 0 6px 24px var(--lxa-cta-glow-color, rgba(99, 102, 241, 0.65));
}

/* Mobile Hamburger Toggle - Precision Luxury Glass Badge */
.lxa-sticky-header__mobile-toggle {
	display: none;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	background-color: var(--lxa-hamburger-bg, rgba(255, 255, 255, 0.06));
	border: var(--lxa-hamburger-border-width, 1px) solid var(--lxa-hamburger-border, rgba(255, 255, 255, 0.15));
	border-radius: var(--lxa-hamburger-radius, 10px);
	cursor: pointer;
	outline: none;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
	box-sizing: border-box;
	line-height: 1;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	flex-shrink: 0;
	transition:
		background-color 260ms cubic-bezier(0.16, 1, 0.3, 1),
		border-color 260ms cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1),
		transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lxa-sticky-header__mobile-toggle:hover {
	background-color: var(--lxa-hamburger-hover-bg, rgba(255, 255, 255, 0.12));
	border-color: var(--lxa-hamburger-hover-border, var(--lxa-menu-hover, #38bdf8));
	box-shadow: 0 0 16px rgba(56, 189, 248, 0.28) !important;
}

.lxa-sticky-header__mobile-toggle:focus-visible {
	outline: 2px solid var(--lxa-hamburger-hover-border, var(--lxa-menu-hover, #38bdf8));
	outline-offset: 2px;
	border-color: var(--lxa-hamburger-hover-border, var(--lxa-menu-hover, #38bdf8));
}

/* Haptic tactile press feedback */
.lxa-sticky-header__mobile-toggle:active {
	transform: scale(0.91);
}

/* 3-Bar Precision Container with 180° Spin-Arc Motion */
.lxa-sticky-header__hamburger {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 20px;
	height: 14px;
	position: relative;
	transform: rotate(0deg);
	transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Precision Rounded Pill Bar Lines */
.lxa-sticky-header__hamburger-bar,
.lxa-sticky-header__hamburger span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--lxa-hamburger-color, var(--lxa-menu-color, #f8fafc));
	border-radius: 999px;
	transform-origin: center;
	transition:
		transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
		opacity 240ms ease,
		background-color 200ms ease;
}

/* Hover micro-interaction: middle bar playfully compresses */
.lxa-sticky-header__mobile-toggle:not(.lxa-is-active):hover .lxa-sticky-header__hamburger span:nth-child(2),
.lxa-sticky-header__mobile-toggle:not(.lxa-is-active):hover .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(2) {
	transform: scaleX(0.72);
}

.lxa-sticky-header__mobile-toggle:hover .lxa-sticky-header__hamburger span,
.lxa-sticky-header__mobile-toggle:hover .lxa-sticky-header__hamburger-bar,
.lxa-sticky-header__mobile-toggle:focus .lxa-sticky-header__hamburger span,
.lxa-sticky-header__mobile-toggle:focus .lxa-sticky-header__hamburger-bar {
	background-color: var(--lxa-hamburger-hover-color, var(--lxa-menu-hover, #38bdf8));
}

/* Active Morph into "X" when Mobile Drawer is Open */
.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger,
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger,
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger {
	transform: rotate(180deg);
}

.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger span:nth-child(1),
.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(1),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger span:nth-child(1),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(1),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger span:nth-child(1),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
	background-color: var(--lxa-hamburger-hover-color, var(--lxa-menu-hover, #38bdf8));
}

.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger span:nth-child(2),
.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(2),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger span:nth-child(2),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(2),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger span:nth-child(2),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger span:nth-child(3),
.lxa-sticky-header.lxa-drawer-active .lxa-sticky-header__mobile-toggle .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(3),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger span:nth-child(3),
.lxa-sticky-header__mobile-toggle.lxa-is-active .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(3),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger span:nth-child(3),
.lxa-sticky-header__mobile-toggle[aria-expanded="true"] .lxa-sticky-header__hamburger .lxa-sticky-header__hamburger-bar:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
	background-color: var(--lxa-hamburger-hover-color, var(--lxa-menu-hover, #38bdf8));
}

/* Icons */
.lxa-icon {
	width: 16px;
	height: 16px;
	vertical-align: middle;
	flex-shrink: 0;
}

.lxa-cta-icon {
	width: 15px;
	height: 15px;
}

.lxa-screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Sticky States Handled via JS */
.lxa-sticky-header.lxa-is-sticky {
	position: fixed;
}

/* Shrink Effect */
.lxa-sticky-header.lxa-is-shrunk {
	height: var(--lxa-shrink-height, 58px);
}

.lxa-sticky-header.lxa-is-shrunk .lxa-sticky-header__logo-img {
	max-width: var(--lxa-logo-shrink-width, 115px);
}

/* Scroll Direction Animation: Hide on Scroll Down, Reveal on Scroll Up */
.lxa-sticky-header.lxa-anim--slide.lxa-is-hidden {
	transform: translateY(-160%);
}

.lxa-sticky-header.lxa-anim--slide.lxa-is-revealed {
	transform: translateY(0);
}

.lxa-sticky-header.lxa-anim--fade.lxa-is-hidden {
	opacity: 0;
	pointer-events: none;
}

.lxa-sticky-header.lxa-anim--fade.lxa-is-revealed {
	opacity: 1;
	pointer-events: auto;
}

/* WordPress Admin Bar Top Adjustment */
body.admin-bar .lxa-sticky-header {
	top: calc(var(--lxa-top-offset, 16px) + 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .lxa-sticky-header {
		top: calc(var(--lxa-top-offset, 16px) + 46px);
	}
}
