/* ================================================
   WAVERICK HEADER & MOBILE MENU
   ================================================
   Overrides parent Traveler theme ElementorV2 header.
   Parent menu uses left:-150%/left:0 with transition:all.
   We replace with GPU-accelerated transform:translateX.
   Parent JS targets removed from DOM:
     .menu-toggle  → .wv-hamburger
     .back-menu    → .wv-close
     .overlay      → .wv-overlay
   ================================================ */

/* --- Custom Properties --- */
:root {
	--wv-menu-width: min(85vw, 380px);
	--wv-menu-bg: #ffffff;
	--wv-menu-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	--wv-menu-transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Hide parent's menu-toggle if it renders --- */
.header__left > .menu-toggle {
	display: none !important;
}


/* ================================================
   HAMBURGER BUTTON
   3 spans, hidden behind panel when menu open.
   .wv-close inside the panel handles closing.
   ================================================ */

.wv-hamburger {
	display: none;
	position: relative;
	width: 28px;
	height: 22px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	z-index: 102;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.wv-hamburger span {
	display: block;
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	background: #fff;
	border-radius: 2px;
	transition: background 0.3s ease, transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

/* On scroll or menu open: dark hamburger lines */
.header.wv-scrolled .wv-hamburger span,
.header.wv-menu-active .wv-hamburger span {
	background: var(--wv-navy, #191970);
}

.wv-hamburger span:nth-child(1) { top: 0; }
.wv-hamburger span:nth-child(2) { top: 10px; }
.wv-hamburger span:nth-child(3) { top: 20px; }

/* When menu is open, hide hamburger behind the panel.
   The .wv-close button inside the panel handles closing.
   z-index 99 < panel's 100, so panel covers hamburger. */
.wv-hamburger.is-open {
	z-index: 99;
	pointer-events: none;
}

/* Show hamburger on mobile — !important needed to survive
   WP Rocket CSS concatenation/reordering */
@media (max-width: 991px) {
	.wv-hamburger {
		display: flex !important;
		align-items: center;
		justify-content: center;
	}

	/* Override parent's margin-left:60px on logo — was designed for the
	   old .menu-toggle (24px wide). Our .wv-hamburger is a flex sibling,
	   no extra margin needed. */
	.header__left .logo {
		margin-left: 10px !important;
	}
}


/* ================================================
   MOBILE MENU PANEL (≤991px)
   GPU-accelerated slide from left
   ================================================ */

@media (max-width: 991px) {
	.header__center #st-main-menu {
		position: fixed !important;
		left: 0 !important;
		top: 0 !important;
		width: var(--wv-menu-width);
		max-width: none !important;
		height: 100vh !important;
		height: 100dvh !important;
		background: var(--wv-menu-bg);
		transform: translateX(-100%);
		transition: transform var(--wv-menu-transition),
		            box-shadow var(--wv-menu-transition) !important;
		will-change: transform;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		z-index: 100;
		box-shadow: none;
		border-radius: 0 16px 16px 0;
		display: flex !important;
		flex-direction: column;
	}

	.header__center #st-main-menu.open {
		transform: translateX(0);
		box-shadow: var(--wv-menu-shadow);
	}

	/* Admin bar offset */
	body.admin-bar .header__center #st-main-menu {
		top: 32px !important;
		height: calc(100vh - 32px) !important;
		height: calc(100dvh - 32px) !important;
	}

	/* Menu list padding */
	.header__center #st-main-menu .main-menu {
		padding: 8px 0 !important;
		margin-top: 56px;
		flex: 1;
	}
}

@media (max-width: 782px) {
	body.admin-bar .header__center #st-main-menu {
		top: 46px !important;
		height: calc(100vh - 46px) !important;
		height: calc(100dvh - 46px) !important;
	}
}


/* ================================================
   CLOSE BUTTON (X inside panel)
   ================================================ */

.wv-close {
	display: none;
}

@media (max-width: 991px) {
	.wv-close {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 16px;
		right: 16px;
		width: 36px;
		height: 36px;
		padding: 0;
		border: none;
		background: #f5f5f5;
		border-radius: 50%;
		cursor: pointer;
		z-index: 5;
		transition: background 0.2s ease, transform 0.2s ease;
		-webkit-tap-highlight-color: transparent;
	}

	.wv-close:hover,
	.wv-close:active {
		background: #eaeaea;
		transform: scale(1.05);
	}

	.wv-close span {
		display: block;
		position: absolute;
		width: 16px;
		height: 2px;
		background: #333;
		border-radius: 1px;
	}

	.wv-close span:nth-child(1) {
		transform: rotate(45deg);
	}
	.wv-close span:nth-child(2) {
		transform: rotate(-45deg);
	}
}


/* ================================================
   OVERLAY (Backdrop blur)
   JS moves this to <body> for proper fixed positioning
   ================================================ */

.wv-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--wv-menu-transition);
	z-index: 9998;
}

.wv-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}


/* ================================================
   DISABLE backdrop-filter ON HEADER WHEN MENU OPEN
   Prevents fixed children from being contained by
   the header's stacking context (CSS spec: backdrop-filter
   creates a containing block for fixed descendants).
   ================================================ */

.header.wv-scrolled.wv-menu-active {
	-webkit-backdrop-filter: none !important;
	backdrop-filter: none !important;
}

/* Keep opaque background when backdrop-filter is off.
   On mobile, ALWAYS force white bg when menu is open —
   scroll-driven animation is killed, so we need explicit bg. */
@media (max-width: 991px) {
	.header.wv-menu-active {
		background: rgba(255, 255, 255, 0.98) !important;
	}
}
@media (min-width: 992px) {
	.header.wv-scrolled.wv-menu-active {
		background: rgba(25, 25, 112, 0.95) !important;
	}
}


/* ================================================
   SCROLL LOCK (iOS-safe)
   ================================================ */

body.wv-scroll-locked {
	position: fixed;
	top: var(--wv-scroll-y, 0);
	left: 0;
	right: 0;
	overflow: hidden;
}


/* ================================================
   SUBMENU ACCORDION (CSS-powered, mobile only)
   Replaces parent's jQuery slideToggle with
   max-height transition
   ================================================ */

@media (max-width: 991px) {
	/* Override parent's display:none with max-height animation.
	   !important beats jQuery inline display:none.
	   Single selector covers all dropdown levels (top, nested, mega). */
	.header__center #st-main-menu .main-menu .menu-dropdown {
		display: block !important;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.3s ease;
		padding-top: 0 !important;
		padding-bottom: 0 !important;
		border: none !important;
		opacity: 0;
	}

	/* Open state */
	.header__center #st-main-menu .main-menu .wv-submenu-open > .menu-dropdown {
		max-height: 800px;
		padding-top: 3px !important;
		padding-bottom: 10px !important;
		opacity: 1;
	}

	/* Nested submenus (2nd level) */
	.header__center #st-main-menu .main-menu .menu-dropdown .menu-item-has-children.wv-submenu-open > .menu-dropdown {
		max-height: 600px;
		opacity: 1;
	}

	/* Chevron rotation */
	.header__center #st-main-menu .main-menu .menu-item-has-children > a .fa,
	.header__center #st-main-menu .main-menu .menu-item-has-children > .fa {
		transition: transform 0.25s ease;
	}

	.header__center #st-main-menu .main-menu .menu-item-has-children.wv-submenu-open > a .fa,
	.header__center #st-main-menu .main-menu .menu-item-has-children.wv-submenu-open > .fa {
		transform: rotate(180deg) !important;
	}
}


/* ================================================
   MENU ITEM STYLING (mobile)
   ================================================ */

@media (max-width: 991px) {
	/* Top-level items */
	.header__center #st-main-menu .main-menu > li > a {
		padding: 14px 20px !important;
		font-family: 'Poppins', sans-serif;
		font-size: 15px;
		font-weight: 600;
		color: #1a1a2e;
		border-bottom: 1px solid #f0f0f0;
		transition: background 0.15s ease, color 0.15s ease;
	}

	.header__center #st-main-menu .main-menu > li > a:hover {
		background: #fafafa;
	}

	/* Active page indicator (orange left border) */
	.header__center #st-main-menu .main-menu > li.current-menu-item > a,
	.header__center #st-main-menu .main-menu > li.current-menu-ancestor > a {
		color: var(--wv-orange, #FF8C00) !important;
		border-left: 3px solid var(--wv-orange, #FF8C00);
		padding-left: 17px !important;
	}

	/* Sub-menu items */
	.header__center #st-main-menu .main-menu .menu-dropdown li a {
		padding: 10px 20px 10px 32px !important;
		font-family: 'Poppins', sans-serif;
		font-size: 14px;
		font-weight: 500;
		color: #444;
	}

	.header__center #st-main-menu .main-menu .menu-dropdown li a:hover {
		color: var(--wv-orange, #FF8C00);
	}

	/* Dropdown arrow — full-height 56px-wide tap strip (meets 44px min).
	   JS adds 80px forgiveness zone on the link's right edge.
	   Total dropdown trigger: ~136px. Text on the left navigates. */
	.header__center #st-main-menu .main-menu li.menu-item-has-children > .fa {
		position: absolute;
		right: 0;
		top: 0;
		bottom: 0;
		width: 56px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 12px;
		cursor: pointer;
		z-index: 2;
		-webkit-tap-highlight-color: transparent;
	}

	/* Language/currency switcher at bottom of panel */
	#st-main-menu .st-list-mobile {
		padding: 16px 20px !important;
		margin-top: auto;
		border-top: 1px solid #f0f0f0;
		list-style: none;
		position: relative;
		z-index: 10;
	}

	#st-main-menu .st-list-mobile li {
		padding: 8px 0;
	}

	/* Force language switcher visible on all phone sizes.
	   Parent template has d-none d-sm-inline-block on the <li>,
	   hiding it on xs phones (≤575px). Override here. */
	#st-main-menu .st-list-mobile .dropdown-language {
		display: inline-block !important;
	}

	/* Language dropdown: render inline inside panel (not absolute).
	   z-index: 10 ensures it sits above menu item chevrons (z-index: 2). */
	#st-main-menu .st-list-mobile .dropdown-language .dropdown-menu {
		position: static !important;
		float: none;
		box-shadow: none;
		border: none;
		background: #fff;
		border-radius: 8px;
		padding: 4px 0;
		margin-top: 4px;
		min-width: 0;
		z-index: 10;
	}

	#st-main-menu .st-list-mobile .dropdown-language .dropdown-menu a {
		padding: 6px 12px;
		font-size: 14px;
		color: #333;
	}

	#st-main-menu .st-list-mobile .dropdown-language .dropdown-menu a:hover {
		background: #f0f0f0;
		color: var(--wv-orange, #FF8C00);
	}
}


/* ================================================
   DESKTOP REFINEMENTS (≥992px)
   ================================================ */

@media (min-width: 992px) {
	/* Smoother dropdown hover transitions */
	.header__center #st-main-menu .main-menu li.menu-item-has-children .menu-dropdown {
		border-radius: 8px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10),
		            0 2px 8px rgba(0, 0, 0, 0.06);
		border: 1px solid rgba(0, 0, 0, 0.06);
	}

	/* Hover transition on links */
	.header__center #st-main-menu .main-menu > li > a {
		transition: color 0.2s ease;
	}

	/* White text on transparent and scrolled header */
	.stt-menu-transparent .header__center #st-main-menu .main-menu > li > a,
	.header.wv-scrolled .header__center #st-main-menu .main-menu > li > a {
		color: #fff;
	}
	.stt-menu-transparent .header__center #st-main-menu .main-menu > li .fa,
	.header.wv-scrolled .header__center #st-main-menu .main-menu > li .fa {
		color: rgba(255, 255, 255, 0.7);
	}

	/* Header right items: white on transparent, inherit on scroll */
	.stt-menu-transparent .header__right .items > li > a,
	.stt-menu-transparent .header__right .dropdown-toggle {
		color: #fff;
	}
}
