/* ==========================================================================
   Artwallz DE – Mega Menu
   Font: Roboto | Top-nav links: 17px uppercase black
              | Mega-menu items: 15px black
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Top-level nav links (desktop)
   -------------------------------------------------------------------------- */

.main-header-menu > li > a,
.main-header-menu > li > .menu-link {
	font-family: 'Roboto', sans-serif;
	font-size: 17px;
	font-weight: 500;
	color: #000;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   2. Positioning context
      .mega-menu-dropdown uses position:fixed (like the search overlay) so it
      always spans the full viewport regardless of Astra's intermediate
      positioned ancestors.  No positioning shim needed on .main-header-bar.
   -------------------------------------------------------------------------- */

/* Each mega-menu <li> stays static — no interception */
.main-header-menu > li.mega-menu-item {
	position: static;
}

/* --------------------------------------------------------------------------
   3. Mega-menu dropdown panel
   -------------------------------------------------------------------------- */

.mega-menu-dropdown {
	display: block;
	position: fixed;
	top: 132px;   /* matches search overlay — bottom edge of Astra header */
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	background: #fff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	border-top: 2px solid #000;

	/* Hidden state — same animation as search bar */
	opacity: 0;
	transform: translateY(10px);
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

/* Visible state (JS adds .awz-mega-open to the <li>) */
.main-header-menu > li.mega-menu-item.awz-mega-open > .mega-menu-dropdown {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	visibility: visible;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
}

/* --------------------------------------------------------------------------
   4. Mega-menu grid
      grid-template-columns is set via inline style by the walker
      (CSS custom properties cannot be used as repeat() counts).
      Centering matches .awz-search-overlay-inner.
   -------------------------------------------------------------------------- */

.mega-menu-grid {
	display: grid;
	/* columns set inline: grid-template-columns:repeat(N,1fr) */
	gap: 0;
	max-width: 1280px;
	margin: 0 auto;
	padding: 1.25rem 2rem;
}

/* Each column — span is set inline by walker: grid-column:span N */
.mega-col {
	padding: 0 1rem;
	border-right: 1px solid #f0f0f0;
}

.mega-col:last-child {
	border-right: none;
}

/* --------------------------------------------------------------------------
   5. Column heading (h4)
   -------------------------------------------------------------------------- */

.mega-col-heading {
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: #000;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 30px;
	margin: 0 0 0.25rem 0;
	padding-bottom: 0.25rem;
	border-bottom: 1px solid #e0e0e0;
}

.mega-col-heading a {
	color: inherit;
	text-decoration: none;
}

.mega-col-heading a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Regular links inside mega menu
   -------------------------------------------------------------------------- */

.mega-menu-link {
	display: block;
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	font-weight: 400;
	color: #000;
	text-decoration: none;
	line-height: 30px;
	padding: 0;
	transition: color 0.15s ease, padding-left 0.15s ease;
}

.mega-menu-link:hover,
.mega-menu-link:focus {
	color: #555;
	padding-left: 4px;
	text-decoration: none;
}

.mega-menu-link.current-menu-item {
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. Banner inside a mega-col
   -------------------------------------------------------------------------- */

.mega-banner {
	display: block;
	text-decoration: none;
	color: #000;
	overflow: hidden;
	border-radius: 2px;
	margin-top: 0.5rem;
	transition: opacity 0.2s ease;
}

.mega-banner:hover {
	opacity: 0.85;
}

.mega-banner-img {
	display: block;
	width: 100%;
}

.mega-banner-img img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.mega-banner-text {
	display: block;
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: #000;
	line-height: 30px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   8. Chevron-down on mega-menu parent links (desktop)
   -------------------------------------------------------------------------- */

/* Hide Astra's default right-pointing arrow for mega-menu parents */
.mega-menu-item > a .dropdown-menu-toggle,
.mega-menu-item > a .ast-header-navigation-arrow {
	display: none !important;
}

/* CSS border-triangle chevron inside the link */
.mega-menu-item > a::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid #000;
	margin-left: 7px;
	vertical-align: middle;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

/* Rotate when open */
.mega-menu-item.awz-mega-open > a::after {
	transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   9. Mobile toggle button (visible only at mobile breakpoint)
   -------------------------------------------------------------------------- */

.awz-mega-toggle {
	display: none;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	vertical-align: middle;
	transition: transform 0.2s ease;
}

.awz-mega-toggle svg {
	fill: #000;
	display: block;
}

.mega-menu-item.awz-mega-open > .awz-mega-toggle {
	transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   10. Suppress Astra's own sub-menu for mega items on desktop
   -------------------------------------------------------------------------- */

.main-header-menu > li.mega-menu-item > ul.sub-menu {
	display: none !important;
}

/* --------------------------------------------------------------------------
   11. Mobile (≤ 921px — Astra's default breakpoint)
   -------------------------------------------------------------------------- */

@media (max-width: 921px) {

	.mega-menu-item .awz-mega-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.mega-menu-item > a::after {
		display: none;
	}

	/* Reset to in-flow block, hidden by max-height */
	.mega-menu-dropdown {
		position: static !important;
		width: 100% !important;
		box-shadow: none;
		border-top: none;
		opacity: 1 !important;
		transform: none !important;
		visibility: visible !important;
		pointer-events: auto !important;
		transition: none !important;
		overflow: hidden;
		max-height: 0;
		padding: 0;
	}

	.mega-menu-item.awz-mega-open > .mega-menu-dropdown {
		max-height: 9999px;
		padding: 0.5rem 0;
		transition: max-height 0.35s ease;
	}

	.mega-menu-grid {
		display: block;
		padding: 0;
	}

	.mega-col {
		border-right: none;
		border-bottom: 1px solid #f0f0f0;
		padding: 0.5rem 1rem;
		grid-column: unset;
	}

	.mega-col:last-child {
		border-bottom: none;
	}

	.mega-menu-link {
		line-height: 30px;
	}
}
