/**
 * Achol Core — Mega Menu
 *
 * Loaded site-wide only when the Header is enabled (see
 * modules/mega-menu/register-mega-menu.php). Reuses the same
 * --achol-* CSS variables already defined in achol-blocks.css — no
 * brand color/token is redefined here.
 */

/* -----------------------------------------------------------------
 * Desktop — panel positioning
 *
 * Positioned absolute relative to .achol-header (the nearest
 * positioned ancestor — .achol-mega-menu__item deliberately has no
 * position of its own), so the panel is centered under the FULL
 * header container width regardless of which top-level item
 * triggered it — matching the approved "container-width" decision.
 * ----------------------------------------------------------------- */

/* Higher-specificity selector than .achol-header__nav-menu li (which
 * sets position: relative for the plain fallback nav's .sub-menu
 * dropdown) — Mega Menu items must stay position: static so their
 * absolutely-positioned panel's containing block resolves up to
 * .achol-header (full width), not to this narrow <li>. */
.achol-header__nav-menu li.achol-mega-menu__item {
	position: static;
}

.achol-mega-menu__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.achol-mega-menu__panel {
	display: none;
}

@media (min-width: 1024px) {

	.achol-mega-menu__panel {
		position: absolute;
		top: 100%;
		left: 50%;
		transform: translateX(-50%);
		width: 100%;
		max-width: var(--achol-container-max-width, 1280px);
		background-color: var(--achol-bg);
		border: 1px solid var(--achol-border);
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
		z-index: 150; /* Above the Header (100), below the Mobile Drawer (200) — no overlap in practice since each is breakpoint-exclusive. */
	}

	.achol-mega-menu__panel:not([hidden]) {
		display: block;
	}

	.achol-mega-menu__panel-inner {
		padding: 36px 48px;
		display: flex;
		align-items: flex-start;
		gap: 56px;
	}

	.achol-mega-menu__panel--visual .achol-mega-menu__columns {
		flex: 1;
	}
}

/* -----------------------------------------------------------------
 * Desktop — columns / groups / subcategory links
 * ----------------------------------------------------------------- */

@media (min-width: 1024px) {

	.achol-mega-menu__columns {
		display: flex;
		flex-wrap: wrap;
		gap: 40px;
		flex: 1;
	}

	.achol-mega-menu__group {
		min-width: 160px;
	}

	.achol-mega-menu__group-heading {
		margin: 0 0 14px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--achol-text-secondary);
	}

	.achol-mega-menu__group-list {
		margin: 0;
		padding: 0;
		list-style: none;
		display: flex;
		flex-direction: column;
		gap: 10px;
	}

	.achol-mega-menu__sub-link {
		color: var(--achol-text-primary);
		font-size: 14px;
		text-decoration: none;
	}

	.achol-mega-menu__sub-link:hover,
	.achol-mega-menu__sub-link:focus-visible {
		color: var(--achol-primary);
	}

	.achol-mega-menu__group--single-link .achol-mega-menu__group-link {
		display: block;
		font-weight: 700;
		font-size: 14px;
		color: var(--achol-text-primary);
		text-decoration: none;
	}

	.achol-mega-menu__group--single-link .achol-mega-menu__group-link:hover,
	.achol-mega-menu__group--single-link .achol-mega-menu__group-link:focus-visible {
		color: var(--achol-primary);
	}

	.achol-mega-menu__view-all {
		display: inline-block;
		margin-top: 20px;
		font-size: 13px;
		font-weight: 700;
		color: var(--achol-primary);
		text-decoration: none;
		border-bottom: 1px solid var(--achol-primary);
		padding-bottom: 2px;
	}

	.achol-mega-menu__view-all:hover,
	.achol-mega-menu__view-all:focus-visible {
		color: var(--achol-primary-hover);
		border-color: var(--achol-primary-hover);
	}
}

/* -----------------------------------------------------------------
 * Desktop — Featured Collection card (Visual type only)
 * ----------------------------------------------------------------- */

@media (min-width: 1024px) {

	.achol-mega-menu__featured {
		flex: 0 0 260px;
		display: flex;
		flex-direction: column;
	}

	.achol-mega-menu__featured-image {
		display: block;
		width: 100%;
		height: 180px;
		object-fit: cover;
		border-radius: 4px;
	}

	.achol-mega-menu__featured-content {
		padding-top: 14px;
	}

	.achol-mega-menu__featured-eyebrow {
		display: block;
		margin-bottom: 6px;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--achol-primary);
	}

	.achol-mega-menu__featured-title {
		margin: 0 0 10px;
		font-size: 17px;
		font-weight: 700;
		color: var(--achol-secondary);
		line-height: 1.3;
	}

	.achol-mega-menu__featured-cta {
		display: inline-block;
		font-size: 13px;
		font-weight: 700;
		color: var(--achol-primary);
		text-decoration: none;
		border-bottom: 1px solid var(--achol-primary);
		padding-bottom: 2px;
	}

	.achol-mega-menu__featured-cta:hover,
	.achol-mega-menu__featured-cta:focus-visible {
		color: var(--achol-primary-hover);
		border-color: var(--achol-primary-hover);
	}
}

/* -----------------------------------------------------------------
 * Nav badge (subtle, top-level label pill)
 * ----------------------------------------------------------------- */

.achol-mega-menu__nav-badge {
	display: inline-block;
	padding: 1px 7px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.6;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.achol-mega-menu__nav-badge--new {
	background-color: var(--achol-primary);
	color: var(--achol-secondary);
}

.achol-mega-menu__nav-badge--sale {
	background-color: var(--achol-danger);
	color: #FFFFFF;
}

.achol-mega-menu__nav-badge--featured {
	background-color: var(--achol-secondary);
	color: #FFFFFF;
}

/* -----------------------------------------------------------------
 * Mobile — multi-screen slide navigation (inside the Header's
 * existing Mobile Drawer)
 * ----------------------------------------------------------------- */

.achol-mega-menu-mobile {
	position: relative;
	overflow: hidden;
}

.achol-mega-menu-mobile__screen[hidden] {
	display: none;
}

.achol-mega-menu-mobile__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 14px 4px;
	min-height: 44px;
	background: transparent;
	border: none;
	color: var(--achol-text-primary);
	font-weight: 600;
	font-size: 16px;
	text-align: left;
	cursor: pointer;
}

.achol-mega-menu-mobile__chevron {
	color: var(--achol-text-secondary);
	font-size: 18px;
}

.achol-mega-menu-mobile__back {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 16px;
	padding: 10px 4px;
	min-height: 44px;
	background: transparent;
	border: none;
	color: var(--achol-text-secondary);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.achol-mega-menu-mobile__group {
	margin-bottom: 20px;
}

.achol-mega-menu-mobile__group-heading {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--achol-text-secondary);
}

.achol-mega-menu-mobile__group-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.achol-mega-menu-mobile__group-list li {
	border-bottom: 1px solid var(--achol-border);
}

.achol-mega-menu-mobile__group-list a,
.achol-mega-menu-mobile__group--single-link a {
	display: block;
	padding: 12px 4px;
	min-height: 44px;
	color: var(--achol-text-primary);
	font-size: 15px;
	text-decoration: none;
}

.achol-mega-menu-mobile__group--single-link {
	font-weight: 700;
	border-bottom: 1px solid var(--achol-border);
}

.achol-mega-menu-mobile__view-all {
	display: inline-block;
	margin-top: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--achol-primary);
	text-decoration: none;
}
