/*
 * Off-canvas mobile/tablet drawer. Astra supplies the shell (overlay,
 * focus trap, ESC/outside-click close); this reskins it as a navy glass
 * panel with a gold hairline, matching the floating header treatment
 * (see header-scroll.css) and the footer's social icon styling.
 */

#ast-mobile-popup.ast-mobile-popup-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
}

#ast-mobile-popup.ast-mobile-popup-drawer.active {
	visibility: visible;
	pointer-events: auto;
}

#ast-mobile-popup .ast-mobile-popup-overlay {
	position: absolute;
	inset: 0;
	background: rgba(3, 8, 17, 0.55);
	opacity: 0;
	transition: opacity 0.35s ease;
}

#ast-mobile-popup.active .ast-mobile-popup-overlay {
	opacity: 1;
}

#ast-mobile-popup .ast-mobile-popup-inner {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(85vw, 380px);
	height: 100vh;
	height: 100dvh;
	background: var(--exegypt-navy-glass);
	-webkit-backdrop-filter: blur(20px) saturate(140%);
	backdrop-filter: blur(20px) saturate(140%);
	border-left: 1px solid var(--exegypt-gold-hairline);
	box-shadow: -24px 0 60px -24px rgba(3, 8, 17, 0.65);
	transform: translateX(100%);
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
	overflow-y: auto;
	padding: 1.5rem 1.5rem 2rem;
}

#ast-mobile-popup.active .ast-mobile-popup-inner {
	transform: translateX(0);
}

/* Left-side variant, kept in sync in case the slide direction is ever switched. */
#ast-mobile-popup.ast-mobile-popup-left .ast-mobile-popup-inner {
	right: auto;
	left: 0;
	border-left: 0;
	border-right: 1px solid var(--exegypt-gold-hairline);
	box-shadow: 24px 0 60px -24px rgba(3, 8, 17, 0.65);
	transform: translateX(-100%);
}

#ast-mobile-popup.ast-mobile-popup-left.active .ast-mobile-popup-inner {
	transform: translateX(0);
}

/* Close button */
#ast-mobile-popup .ast-mobile-popup-header {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.25rem;
}

#ast-mobile-popup .menu-toggle-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: transparent;
	color: var(--exegypt-body-text);
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#ast-mobile-popup .menu-toggle-close svg {
	width: 16px;
	height: 16px;
}

#ast-mobile-popup .menu-toggle-close:hover,
#ast-mobile-popup .menu-toggle-close:focus-visible {
	background-color: var(--exegypt-gold-hairline);
	color: var(--exegypt-gold);
	transform: rotate(90deg);
}

/* Logo */
#ast-mobile-popup .ast-mobile-popup-content .site-logo-img {
	display: block;
	margin-bottom: 2rem;
}

#ast-mobile-popup .ast-mobile-popup-content .site-logo-img img {
	max-width: 130px;
	width: 130px;
}

/* Nav menu */
#ast-mobile-popup .main-header-menu {
	display: flex;
	flex-direction: column;
	background-color: transparent;
	margin-bottom: 1.75rem;
}

#ast-mobile-popup .main-header-menu .menu-item {
	border-bottom: 1px solid var(--exegypt-gold-hairline);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

#ast-mobile-popup .main-header-menu .menu-item:first-child {
	border-top: 1px solid var(--exegypt-gold-hairline);
}

#ast-mobile-popup.active .main-header-menu .menu-item {
	opacity: 1;
	transform: translateY(0);
}

#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(1) { transition-delay: 0.1s; }
#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(2) { transition-delay: 0.14s; }
#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(3) { transition-delay: 0.18s; }
#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(4) { transition-delay: 0.22s; }
#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(5) { transition-delay: 0.26s; }
#ast-mobile-popup.active .main-header-menu .menu-item:nth-child(6) { transition-delay: 0.3s; }

#ast-mobile-popup .main-header-menu .menu-link {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 56px;
	background-color: transparent;
	color: var(--exegypt-body-text);
	font-family: 'Montserrat', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}

#ast-mobile-popup .main-header-menu .menu-link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 2px;
	background-color: var(--exegypt-gold);
	transition: width 0.3s ease;
}

#ast-mobile-popup .main-header-menu .menu-item:hover .menu-link,
#ast-mobile-popup .main-header-menu .menu-item.current-menu-item .menu-link,
#ast-mobile-popup .main-header-menu .menu-item.current-menu-ancestor .menu-link {
	background-color: transparent;
	color: var(--exegypt-gold);
}

#ast-mobile-popup .main-header-menu .menu-item:hover .menu-link::after,
#ast-mobile-popup .main-header-menu .menu-item.current-menu-item .menu-link::after {
	width: 100%;
}

/* "Programs" submenu expand arrow: Astra renders this with its own default
   icon color (#475467, a dark slate meant for light backgrounds) — on this
   dark navy-glass drawer that's only ~2.4:1 contrast and reads as a stray
   wrong-colored icon next to the light menu text around it. Match it to
   the drawer's own text color instead, gold to match on hover/focus/open. */
#ast-mobile-popup .main-header-menu .ast-menu-toggle {
	color: var(--exegypt-body-text);
}

#ast-mobile-popup .main-header-menu .ast-menu-toggle svg,
#ast-mobile-popup .main-header-menu .ast-menu-toggle path {
	fill: currentColor;
}

#ast-mobile-popup .main-header-menu .ast-menu-toggle:hover,
#ast-mobile-popup .main-header-menu .ast-menu-toggle:focus-visible,
#ast-mobile-popup .main-header-menu .ast-menu-toggle[aria-expanded="true"] {
	color: var(--exegypt-gold);
}

/* CTA button (reuses the desktop "Apply Now" component/colors, just widened into a pill) */
#ast-mobile-popup .ast-builder-button-wrap {
	margin-bottom: 2rem;
}

#ast-mobile-popup .ast-builder-button-wrap .ast-custom-button-link {
	display: flex;
	width: 100%;
}

#ast-mobile-popup .ast-builder-button-wrap .ast-custom-button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border-radius: 999px;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#ast-mobile-popup .ast-builder-button-wrap .ast-custom-button-link:hover .ast-custom-button {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -12px rgba(201, 162, 75, 0.6);
}

/* Social icons row, pinned to the bottom of the panel */
#ast-mobile-popup .exegypt-drawer-socials {
	display: flex;
	gap: 0.6rem;
	margin-top: auto;
	padding-top: 1.5rem;
	border-top: 1px solid var(--exegypt-gold-hairline);
}

/* Link box grew from 20x20 to 32x32 — a 20px tap target fails the WCAG 2.2
   24x24px minimum, and this is a touch-only surface (off-canvas drawer). */
#ast-mobile-popup .exegypt-drawer-socials a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--exegypt-body-text-muted);
	transition: color 0.25s ease, transform 0.25s ease;
}

#ast-mobile-popup .exegypt-drawer-socials svg {
	width: 20px;
	height: 20px;
}

#ast-mobile-popup .exegypt-drawer-socials a:hover {
	color: var(--exegypt-gold);
	transform: translateY(-2px);
}

/*
 * Hamburger icon fix: Astra's line-to-X swap keys off a `.toggled` class
 * that its off-canvas trigger path never adds (only `aria-expanded`).
 * Key the swap off aria-expanded instead so the icon actually animates.
 */
.menu-toggle[aria-expanded="true"] .ast-close-svg {
	display: block;
}

.menu-toggle[aria-expanded="true"] .ast-menu-svg {
	display: none;
}

.main-header-menu-toggle {
	transition: transform 0.2s ease;
}

.main-header-menu-toggle:hover {
	transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
	#ast-mobile-popup .ast-mobile-popup-overlay,
	#ast-mobile-popup .ast-mobile-popup-inner,
	#ast-mobile-popup .main-header-menu .menu-item,
	#ast-mobile-popup .menu-toggle-close,
	#ast-mobile-popup .ast-builder-button-wrap .ast-custom-button,
	#ast-mobile-popup .exegypt-drawer-socials a,
	.main-header-menu-toggle {
		transition: none !important;
		transform: none !important;
	}

	#ast-mobile-popup .main-header-menu .menu-item {
		opacity: 1;
	}
}
