/*
  Component: mega menu overlay.
  Figma: 703:11732.

  Full-bleed overlay that drops from the top of the viewport. Opens for both
  the hamburger and the search button (search-focus only differs).
*/

.c-mega {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: block;
}

.c-mega[hidden] { display: none; }

.c-mega__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 200ms ease;
}

.c-mega__panel {
	position: relative;
	background: var(--c-light);
	box-shadow: var(--shadow-card);
	padding-bottom: var(--space-8);
	transform: translateY(-8px);
	opacity: 0;
	transition: opacity 220ms ease, transform 220ms ease;
}

.c-mega.is-open .c-mega__backdrop { opacity: 1; }
.c-mega.is-open .c-mega__panel {
	transform: translateY(0);
	opacity: 1;
}

/* ---------- top strip (80px) ---------- */
.c-mega__top {
	position: sticky;
	top: 0;
	background: var(--c-light);
	border-bottom: 1px solid var(--c-border);
	height: 80px;
	display: flex;
	align-items: center;
}

.c-mega__top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-8);
	height: 100%;
}

.c-mega__brand-group {
	display: flex;
	align-items: center;
	gap: var(--space-3);
}

.c-mega__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--radius-sm);
	color: var(--c-fg);
	cursor: pointer;
}
.c-mega__close:hover { background: var(--c-grey-light); }
.c-mega__close:focus-visible {
	outline: 2px solid var(--c-accent);
	outline-offset: 2px;
}

.c-mega__brand {
	display: inline-flex;
	align-items: center;
	color: var(--c-fg);
	font-weight: var(--fw-bold);
	font-size: 22px;
	letter-spacing: -0.4px;
	text-decoration: none;
}
.c-mega__brand img { height: 39px; width: auto; }

.c-mega__utils {
	display: flex;
	align-items: center;
	gap: var(--space-8);
}

.c-mega__lang {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}
.c-mega__lang li + li .c-mega__lang-link {
	border-left: 1px solid var(--c-border);
}
.c-mega__lang-link {
	display: inline-flex;
	align-items: center;
	padding-inline: 6px;
	font-size: var(--fs-link-14);
	line-height: var(--lh-link-14);
	font-weight: var(--fw-semibold);
	color: var(--c-grey-dark);
	text-decoration: none;
}
.c-mega__lang-link.is-active { color: var(--c-accent); }

/* search input (Figma 414×42, F4F4F9 bg, 8px radius) */
.c-mega__search {
	position: relative;
	width: 414px;
	max-width: 100%;
}
.c-mega__search-icon {
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	width: 24px;
	height: 24px;
	/* color: var(--c-fg-muted); */
	pointer-events: none;
}
.c-mega__search-input {
	width: 100%;
	height: 42px;
	padding: 0 14px 0 44px;
	border: 0;
	border-radius: var(--radius-md);
	background: var(--c-grey-light);
	font-size: var(--fs-link-14);
	color: var(--c-fg);
}
.c-mega__search-input::placeholder { color: var(--c-fg-muted); }
.c-mega__search-input:focus {
	outline: 2px solid var(--c-accent);
	outline-offset: 2px;
}

/* ---------- columns ---------- */
.c-mega__body {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--space-6);
	padding-top: var(--space-8);
}

.c-mega__col {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	min-width: 0;
	flex: 1 1 0;
	max-width: 148px;
}

.c-mega__col-title {
	font-size: var(--fs-heading-14);
	line-height: var(--lh-heading-14);
	font-weight: var(--fw-semibold);
	letter-spacing: -0.42px;
	text-transform: uppercase;
	color: var(--c-grey-dark);
	margin: 0;
}

.c-mega__list {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* wp_nav_menu wraps each item in <li class="menu-item"><a>…</a></li>, so we
   target the inner <a> with our hover styles too. */
.c-mega__link,
.c-mega__list a {
	display: inline-block;
	font-size: var(--fs-link-18);
	line-height: var(--lh-link-18);
	font-weight: var(--fw-semibold);
	letter-spacing: -0.6px;
	color: var(--c-fg);
	text-decoration: none;
	font-weight: 300;
}
.c-mega__link:hover,
.c-mega__list a:hover,
.c-mega__link.is-active,
.c-mega__list a.current-menu-item {
	color: var(--c-accent);
	text-decoration: none;
}

/* ---------- footer wordmark ---------- */
.c-mega__footer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-3);
	padding-top: var(--space-8);
}
.c-mega__rule {
	display: block;
	width: 100%;
	height: 1px;
	background: var(--c-border);
}
.c-mega__wordmark {
	display: inline-flex;
	color: var(--c-fg);
	text-decoration: none;
	font-weight: var(--fw-bold);
	font-size: 16px;
}
.c-mega__wordmark img { height: 17px; width: auto; }
.c-mega__wordmark svg {
	display: block;
	width: 69px;
	height: 17px;
}

/* ---------- when active, prevent body scroll ---------- */
body.has-mega-open { overflow: hidden; }

/* ---------- responsive: stack columns ---------- */
@media (max-width: 900px) {
	.c-mega__top { height: 64px; }
	.c-mega__top-inner { gap: var(--space-3); }
	.c-mega__utils { gap: var(--space-3); flex: 1; justify-content: flex-end; }
	.c-mega__lang { display: none; }
	.c-mega__search { width: auto; flex: 1; max-width: none; }

	.c-mega__body {
		flex-direction: column;
		gap: var(--space-6);
	}
	.c-mega__col {
		flex: 0 0 auto;
		max-width: none;
		width: 100%;
		gap: var(--space-3);
	}
	.c-mega__list { gap: var(--space-3); }
}

/* Hide overflow scrollbar but allow scroll inside the panel itself. */
.c-mega__panel {
	max-height: 100vh;
	overflow-y: auto;
}
