/**
 * Archipolitan Mega Menu
 * Full-width mega panel, rendered at <body> level (moved there by the script)
 * so it never collides with the theme's own menu engine (Elementor/SmartMenus).
 * Visibility + positioning are handled by the script. All selectors scoped .apm-*.
 */

:root {
	--apm-panel-bg: #14161a;
	--apm-panel-border: rgba(255, 255, 255, 0.10);
	--apm-heading-color: #ffffff;
	--apm-link-color: #b9b9b9;
	--apm-link-hover: #ffffff;
	--apm-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
	--apm-max-width: 1200px;
}

/* ---- Chevron on the top-level items that have a mega menu ---- */
.apm-caret {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}
/* Flip the chevron up while the panel is open. */
.apm-has-mega.apm-open .apm-caret {
	transform: translateY(1px) rotate(225deg);
}

/* ---- The full-width panel ---- */
.apm-mega {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 99999;
	background: var(--apm-panel-bg);
	color: var(--apm-link-color);
	border-top: 1px solid var(--apm-panel-border);
	box-shadow: var(--apm-shadow);
	max-height: min(80vh, 720px);
	overflow-y: auto;

	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}
.apm-mega.apm-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition-delay: 0s;
}

/* Centered content container with the columns. */
.apm-inner {
	max-width: var(--apm-max-width);
	margin: 0 auto;
	padding: 36px 32px 44px;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 32px 48px;
}

/* A category-with-children column: heading + its child links. */
.apm-col {
	flex: 0 0 auto;
	min-width: 150px;
}

/* The block holding all the plain leaf links; flows into two sub-columns. */
.apm-col-leaves {
	width: 340px;
}
.apm-leaflist {
	column-count: 2;
	column-gap: 36px;
}

/* Category heading (only for categories that have children). */
.apm-parent-link {
	display: block;
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--apm-heading-color);
	text-decoration: none;
}

.apm-children {
	display: block;
}

/* Child links (under a heading) and plain leaf items share the link style. */
.apm-child,
.apm-item {
	display: block;
	padding: 5px 0;
	font-size: 14px;
	line-height: 1.3;
	color: var(--apm-link-color);
	text-decoration: none;
	break-inside: avoid;
}
.apm-child:hover,
.apm-child:focus,
.apm-item:hover,
.apm-item:focus,
.apm-parent-link:hover,
.apm-parent-link:focus {
	color: var(--apm-link-hover);
}

/* Slim scrollbar for very tall panels. */
.apm-mega::-webkit-scrollbar {
	width: 8px;
}
.apm-mega::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.18);
	border-radius: 8px;
}

/* Narrow screens: single column flow. */
@media (max-width: 782px) {
	.apm-inner {
		gap: 20px 28px;
		padding: 20px;
	}
	.apm-col-leaves {
		width: auto;
	}
	.apm-leaflist {
		column-count: 1;
	}
}
