/*
 * AlienTech custom navigation
 * Desktop: horizontal white links, hover yellow, 3-level dropdowns with grow animation
 * Tablet/mobile (≤1024px): hamburger → side panel with cascading links
 */

:root {
	--at-nav-yellow: #FFEE00;
	--at-nav-white: #ffffff;
	--at-nav-ink: #0f172a;
	--at-nav-ink-muted: #475569;
	--at-nav-border: #e5e7eb;
	--at-nav-bg-dark: #0a0a0a;
	--at-nav-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

.alientech-nav,
.alientech-nav *,
.alientech-nav *::before,
.alientech-nav *::after {
	box-sizing: border-box;
}

.alientech-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.alientech-nav a {
	color: inherit;
	text-decoration: none;
}

/* Hard reset for buttons inside the nav — Elementor's kit applies global button styles
   (yellow background, padding, border-radius, uppercase) to ALL <button> elements,
   which would inflate our toggle/hamburger/close buttons and make them wrap. */
.alientech-nav button,
.alientech-nav button:hover,
.alientech-nav button:focus,
.alientech-nav button:active {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto;
	height: auto;
	box-shadow: none !important;
	font: inherit !important;
	color: inherit;
	letter-spacing: normal !important;
	text-transform: none !important;
	line-height: normal !important;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

/* ---------- Top-level container ---------- */

.alientech-nav {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-family: "Roboto Flex", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ============================================================
   DESKTOP NAV (>1024px)
   ============================================================ */

.alientech-nav__desktop > ul.alientech-nav__menu {
	display: flex;
	align-items: center;
	gap: 2rem;
}

.alientech-nav__desktop .alientech-nav__menu > li {
	position: relative;
}

/* The mobile sub-toggle button is hidden on desktop; caret is rendered inside the link */
.alientech-nav__desktop .alientech-nav__sub-toggle {
	display: none;
}

.alientech-nav__desktop .alientech-nav__menu > li > .alientech-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.6rem 0;
	color: var(--at-nav-white);
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.01em;
	transition: color 0.2s var(--at-nav-easing);
}

.alientech-nav__desktop .alientech-nav__menu > li:hover > .alientech-nav__link,
.alientech-nav__desktop .alientech-nav__menu > li:focus-within > .alientech-nav__link,
.alientech-nav__desktop .alientech-nav__menu > li > .alientech-nav__link:hover,
.alientech-nav__desktop .alientech-nav__menu > li > .alientech-nav__link:focus-visible {
	color: var(--at-nav-yellow);
}

/* caret (top-level, points down, rotates on open) */
.alientech-nav__desktop .alientech-nav__caret {
	display: inline-flex;
	align-items: center;
	transition: transform 0.25s var(--at-nav-easing);
}

.alientech-nav__desktop .alientech-nav__menu > li:hover > .alientech-nav__link .alientech-nav__caret,
.alientech-nav__desktop .alientech-nav__menu > li:focus-within > .alientech-nav__link .alientech-nav__caret {
	transform: rotate(180deg);
}

/* item icon (any depth) */
.alientech-nav__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: currentColor;
}

.alientech-nav__icon svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.alientech-nav__icon-img {
	max-width: 100%;
	max-height: 100%;
	display: block;
}

/* ---------- Dropdowns (light theme, depths 1, 2, 3) ---------- */

.alientech-nav__desktop .alientech-nav__sub {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	padding: 0.4rem;
	background: var(--at-nav-white);
	border: 1px solid var(--at-nav-border);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
	transform-origin: top center;
	transform: scaleY(0.92) translateY(-6px);
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.22s var(--at-nav-easing),
		transform 0.28s var(--at-nav-easing);
	z-index: 1000;
}

/* Bridge: invisible hit-area filling the gap between trigger and dropdown
   so cursor doesn't fall into "no-hover" land while moving down. */
.alientech-nav__desktop .alientech-nav__sub::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -12px;
	height: 14px;
}

.alientech-nav__desktop .alientech-nav__has-children:hover > .alientech-nav__sub,
.alientech-nav__desktop .alientech-nav__has-children:focus-within > .alientech-nav__sub,
.alientech-nav__desktop .alientech-nav__has-children.is-open > .alientech-nav__sub,
.alientech-nav__desktop .alientech-nav__sub:hover {
	opacity: 1;
	transform: scaleY(1) translateY(8px);
	pointer-events: auto;
}

/* Nested submenu opens to the right */
.alientech-nav__desktop .alientech-nav__sub .alientech-nav__sub {
	top: -0.4rem;
	left: calc(100% + 6px);
	transform-origin: top left;
	transform: scale(0.96) translateX(-6px);
}

.alientech-nav__desktop .alientech-nav__sub .alientech-nav__sub::before {
	top: 0;
	bottom: 0;
	left: -10px;
	right: auto;
	width: 12px;
	height: auto;
}

.alientech-nav__desktop .alientech-nav__sub .alientech-nav__has-children:hover > .alientech-nav__sub,
.alientech-nav__desktop .alientech-nav__sub .alientech-nav__has-children:focus-within > .alientech-nav__sub,
.alientech-nav__desktop .alientech-nav__sub .alientech-nav__sub:hover {
	transform: scale(1) translateX(0);
}

.alientech-nav__desktop .alientech-nav__sub li {
	position: relative;
}

.alientech-nav__desktop .alientech-nav__sub .alientech-nav__link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.75rem;
	color: var(--at-nav-ink);
	font-size: 0.9rem;
	font-weight: 500;
	border-radius: 8px;
	transition: color 0.18s var(--at-nav-easing), background-color 0.18s var(--at-nav-easing);
}

.alientech-nav__desktop .alientech-nav__sub .alientech-nav__text {
	flex: 1;
	min-width: 0;
}

.alientech-nav__desktop .alientech-nav__sub li:hover > .alientech-nav__link,
.alientech-nav__desktop .alientech-nav__sub li:focus-within > .alientech-nav__link {
	color: var(--at-nav-ink);
	background-color: var(--at-nav-yellow);
}

/* Sub-level caret points right (indicates "more →") */
.alientech-nav__desktop .alientech-nav__sub .alientech-nav__caret {
	transform: rotate(-90deg);
	color: var(--at-nav-ink-muted);
	margin-left: auto;
}

.alientech-nav__desktop .alientech-nav__sub li:hover > .alientech-nav__link .alientech-nav__caret {
	color: var(--at-nav-ink);
}

/* Hamburger hidden on desktop, panel hidden on desktop */
.alientech-nav__hamburger,
.alientech-nav__panel,
.alientech-nav__backdrop {
	display: none;
}

/* ============================================================
   TABLET LANDSCAPE & BELOW (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {

	.alientech-nav__desktop {
		display: none;
	}

	/* ---------- Hamburger ---------- */
	.alientech-nav .alientech-nav__hamburger {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		color: var(--at-nav-white);
		transition: color 0.2s var(--at-nav-easing);
	}

	.alientech-nav .alientech-nav__hamburger-bar {
		display: block;
		width: 26px;
		height: 2.5px;
		background: #ffffff;
		border-radius: 2px;
		transition: transform 0.35s var(--at-nav-easing), opacity 0.2s var(--at-nav-easing);
	}

	.alientech-nav__hamburger:hover {
		color: var(--at-nav-yellow);
	}

	.alientech-nav__hamburger[aria-expanded="true"] .alientech-nav__hamburger-bar:nth-child(1) {
		transform: translateY(7.5px) rotate(45deg);
	}
	.alientech-nav__hamburger[aria-expanded="true"] .alientech-nav__hamburger-bar:nth-child(2) {
		opacity: 0;
	}
	.alientech-nav__hamburger[aria-expanded="true"] .alientech-nav__hamburger-bar:nth-child(3) {
		transform: translateY(-7.5px) rotate(-45deg);
	}

	/* ---------- Side panel ---------- */
	.alientech-nav__panel {
		display: block;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(360px, 88vw);
		background: var(--at-nav-white);
		color: var(--at-nav-ink);
		transform: translateX(100%);
		transition: transform 0.42s var(--at-nav-easing);
		z-index: 9998;
		overflow: hidden;
	}

	.alientech-nav.is-open .alientech-nav__panel {
		transform: translateX(0);
	}

	.alientech-nav__panel-inner {
		display: flex;
		flex-direction: column;
		height: 100%;
		overflow: hidden;
	}

	/* ---------- Backdrop ---------- */
	.alientech-nav__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.45);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.32s var(--at-nav-easing);
		z-index: 9997;
	}

	.alientech-nav.is-open .alientech-nav__backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	/* ---------- Header (search + close) ---------- */
	.alientech-nav__panel-header {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		padding: 0.875rem 1rem;
		border-bottom: 1px solid var(--at-nav-border);
		flex-shrink: 0;
	}

	.alientech-nav__search {
		position: relative;
		flex: 1;
	}

	.alientech-nav__search-icon {
		position: absolute;
		top: 50%;
		left: 0.85rem;
		transform: translateY(-50%);
		color: #94a3b8;
		pointer-events: none;
		z-index: 1;
	}

	.alientech-nav__search-input {
		width: 100%;
		border: 1px solid #d0d5dd;
		border-radius: 8px;
		padding: 0.6rem 0.75rem 0.6rem 2.75rem !important;
		font-size: 0.9rem;
		color: #1e293b;
		background: #fff;
		transition: border-color 0.18s ease, box-shadow 0.18s ease;
		-webkit-appearance: none;
		appearance: none;
		text-indent: 0;
	}

	.alientech-nav__search-input:focus {
		outline: none;
		border-color: #1d4ed8;
		box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
	}

	.alientech-nav__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		color: var(--at-nav-ink);
		border-radius: 8px;
		transition: background-color 0.18s var(--at-nav-easing);
		flex-shrink: 0;
	}

	.alientech-nav__close:hover,
	.alientech-nav__close:focus-visible {
		background: #f1f5f9;
	}

	/* ---------- Mobile menu (cascading) ---------- */
	.alientech-nav__mobile {
		flex: 1;
		overflow-y: auto;
		overflow-x: hidden;
		padding: 0.5rem 0;
		-webkit-overflow-scrolling: touch;
	}

	.alientech-nav__mobile .alientech-nav__menu li {
		opacity: 0;
		transform: translateX(20px);
		transition:
			opacity 0.4s var(--at-nav-easing),
			transform 0.4s var(--at-nav-easing);
	}

	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li {
		opacity: 1;
		transform: translateX(0);
	}

	/* cascading delays */
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(1)  { transition-delay: 0.10s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(2)  { transition-delay: 0.16s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(3)  { transition-delay: 0.22s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(4)  { transition-delay: 0.28s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(5)  { transition-delay: 0.34s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(6)  { transition-delay: 0.40s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(7)  { transition-delay: 0.46s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(8)  { transition-delay: 0.52s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(9)  { transition-delay: 0.58s; }
	.alientech-nav.is-open .alientech-nav__mobile .alientech-nav__menu > li:nth-child(n+10) { transition-delay: 0.64s; }

	.alientech-nav__mobile .alientech-nav__menu > li {
		border-bottom: 1px solid var(--at-nav-border);
	}

	/* Every li (any depth) lays out: link | toggle | sub-menu (wrapped below) */
	.alientech-nav__mobile li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.alientech-nav__mobile .alientech-nav__link {
		flex: 1;
		min-width: 0;
		display: flex;
		align-items: center;
		gap: 0.7rem;
		padding: 0.85rem 1.1rem;
		color: var(--at-nav-ink);
		font-weight: 600;
		font-size: 1rem;
		transition: color 0.18s var(--at-nav-easing);
	}

	/* Hide the in-link caret on mobile — the toggle button next to the link handles it */
	.alientech-nav__mobile .alientech-nav__caret {
		display: none;
	}

	/* Smaller icon on mobile to keep rows compact */
	.alientech-nav__mobile .alientech-nav__icon {
		width: 22px;
		height: 22px;
	}

	.alientech-nav__mobile .alientech-nav__link:hover,
	.alientech-nav__mobile .alientech-nav__link:focus-visible {
		color: var(--at-nav-yellow);
	}

	/* ---- mobile sub-toggle button (replaces hover) ---- */
	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 44px !important;
		height: 44px !important;
		margin-right: 0.4rem;
		color: var(--at-nav-ink-muted);
		flex-shrink: 0;
		pointer-events: auto;
		transform: rotate(0deg);
		transition: transform 0.3s var(--at-nav-easing), background-color 0.18s var(--at-nav-easing);
	}

	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle:hover,
	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle:focus-visible {
		background-color: rgba(15, 23, 42, 0.06) !important;
		transform: rotate(0deg);
	}

	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle[aria-expanded="true"],
	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle[aria-expanded="true"]:hover,
	.alientech-nav .alientech-nav__mobile .alientech-nav__sub-toggle[aria-expanded="true"]:focus-visible {
		transform: rotate(180deg);
	}

	/* ---- mobile submenus (accordion) ---- */
	.alientech-nav__mobile .alientech-nav__sub {
		flex-basis: 100%;
		max-height: 0;
		overflow: hidden;
		background: #f8fafc;
		transition: max-height 0.4s var(--at-nav-easing);
	}

	.alientech-nav__mobile .alientech-nav__has-children.is-open > .alientech-nav__sub {
		max-height: 1500px;
	}

	.alientech-nav__mobile .alientech-nav__sub li {
		opacity: 1;
		transform: none;
		border-bottom: 1px solid var(--at-nav-border);
	}

	.alientech-nav__mobile .alientech-nav__sub li:last-child {
		border-bottom: 0;
	}

	.alientech-nav__mobile .alientech-nav__sub .alientech-nav__link {
		padding-left: 2rem;
		font-weight: 500;
		font-size: 0.95rem;
		color: #334155;
	}

	/* depth 2 (3rd level) */
	.alientech-nav__mobile .alientech-nav__sub .alientech-nav__sub {
		background: #f1f5f9;
	}

	.alientech-nav__mobile .alientech-nav__sub .alientech-nav__sub .alientech-nav__link {
		padding-left: 3rem;
		font-size: 0.9rem;
		color: var(--at-nav-ink-muted);
	}

	/* ---------- Footer (auth, call, contact) ---------- */
	.alientech-nav__panel-footer {
		flex-shrink: 0;
		padding: 1rem 1.1rem 1.25rem;
		border-top: 1px solid var(--at-nav-border);
		background: #fff;
		display: flex;
		flex-direction: column;
		gap: 0.75rem;
	}

	.alientech-nav__auth {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		justify-content: center;
		font-size: 0.875rem;
	}

	.alientech-nav__auth-link {
		color: var(--at-nav-ink-muted);
		font-weight: 600;
		padding: 0.25rem 0.4rem;
		transition: color 0.18s var(--at-nav-easing);
	}

	.alientech-nav__auth-link:hover,
	.alientech-nav__auth-link:focus-visible {
		color: var(--at-nav-ink);
	}

	.alientech-nav__auth-sep {
		color: #cbd5e1;
	}

	.alientech-nav__call {
		display: flex;
		align-items: baseline;
		justify-content: center;
		gap: 0.4rem;
		text-align: center;
		color: var(--at-nav-ink);
		padding: 0.4rem 0;
	}

	.alientech-nav__call-label {
		font-size: 0.8125rem;
		color: var(--at-nav-ink-muted);
		font-weight: 500;
	}

	.alientech-nav__call-number {
		font-size: 1.125rem;
		font-weight: 700;
		letter-spacing: 0.01em;
	}

	.alientech-nav__call:hover .alientech-nav__call-number,
	.alientech-nav__call:focus-visible .alientech-nav__call-number {
		color: var(--at-nav-yellow);
		filter: brightness(0.85);
	}

	.alientech-nav__contact-btn {
		display: block;
		width: 100%;
		padding: 0.85rem 1rem;
		text-align: center;
		font-weight: 700;
		font-size: 0.95rem;
		letter-spacing: 0.02em;
		text-transform: uppercase;
		color: var(--at-nav-ink);
		background: var(--at-nav-yellow);
		border-radius: 10px;
		transition: background-color 0.2s var(--at-nav-easing), transform 0.15s var(--at-nav-easing);
	}

	.alientech-nav__contact-btn:hover,
	.alientech-nav__contact-btn:focus-visible {
		background: #ffe600;
		transform: translateY(-1px);
	}
}

/* lock body scroll while panel open */
body.alientech-nav-open {
	overflow: hidden;
}

/* Hide the old (broken) Elementor menu */
#old-menu {
	display: none !important;
}

/* Hide the empty top-of-page Elementor container that creates a white gap */
.elementor-element-5c9a25f {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.alientech-nav *,
	.alientech-nav *::before,
	.alientech-nav *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
