/* H-Line Mega Menu — front-end styles.
   Colours are set as variables at the top of .hl-mm-panel so they are easy to tweak.
   Fonts use inherit so the menu matches your theme/template. */

.hl-mega-parent {
	position: relative;
}

.hl-mega-parent .hl-mm-chev {
	display: inline-flex;
	vertical-align: middle;
	margin-left: 5px;
	opacity: .7;
	transition: transform .25s ease;
}
.hl-mega-parent.is-open .hl-mm-chev {
	transform: rotate(180deg);
}

.hl-mm-panel {
	--hl-bg: #1b1b1b;
	--hl-border: rgba(255, 255, 255, .09);
	--hl-cat-active: #2d2d2d;
	--hl-cat-hover: #242424;
	--hl-btn: #242424;
	--hl-btn-border: rgba(255, 255, 255, .10);
	--hl-btn-hover: #333333;
	--hl-text: #e9e9e9;
	--hl-muted: #8b8b8b;
	--hl-mm-width: 820px;

	position: absolute;
	top: calc(100% + 12px);
	width: min(var(--hl-mm-width), 92vw);
	padding: 22px;
	background: var(--hl-bg);
	border: 1px solid var(--hl-border);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
	font-family: inherit;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity .22s ease, transform .22s ease, visibility .22s;
	z-index: 99999;
}

/* Keep padding inside the width everywhere so nothing overflows. */
.hl-mm-panel,
.hl-mm-panel * {
	box-sizing: border-box;
}

.hl-mm-panel.hl-mm-center { left: 50%; transform: translate(-50%, 8px); }
.hl-mm-panel.hl-mm-left   { left: 0; }
.hl-mm-panel.hl-mm-right  { right: 0; }

.hl-mega-parent.is-open .hl-mm-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.hl-mega-parent.is-open .hl-mm-panel.hl-mm-center { transform: translate(-50%, 0); }
.hl-mega-parent.is-open .hl-mm-panel.hl-mm-left,
.hl-mega-parent.is-open .hl-mm-panel.hl-mm-right { transform: translateY(0); }

.hl-mm-panel .hl-mm-grid {
	display: grid;
	grid-template-columns: minmax(220px, 1fr) 1px minmax(300px, 1.35fr);
	gap: 26px;
}
.hl-mm-panel .hl-mm-divider { background: var(--hl-border); }

/* Colours forced so a theme's menu styles cannot hide the text. */
.hl-mega-parent .hl-mm-panel .hl-mm-label {
	margin: 0 0 14px;
	color: var(--hl-muted) !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
	background: none !important;
}

.hl-mm-panel .hl-mm-cats {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hl-mm-panel .hl-mm-cats li {
	margin: 0;
	padding: 0;
	list-style: none;
	background: none !important;
	border: 0;
}
.hl-mega-parent .hl-mm-panel .hl-mm-cat {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	background: transparent !important;
	border: 1px solid transparent;
	color: var(--hl-text) !important;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	padding: 14px 16px;
	border-radius: 9px;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease;
}
.hl-mega-parent .hl-mm-panel .hl-mm-cat:hover { background: var(--hl-cat-hover) !important; }
.hl-mega-parent .hl-mm-panel .hl-mm-cat.is-active {
	background: var(--hl-cat-active) !important;
	border-color: var(--hl-border);
}
.hl-mm-panel .hl-mm-arrow {
	display: inline-flex;
	color: var(--hl-muted);
	opacity: 0;
	transition: opacity .18s ease;
}
.hl-mm-panel .hl-mm-cat.is-active .hl-mm-arrow { opacity: 1; }

.hl-mm-panel .hl-mm-subs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.hl-mega-parent .hl-mm-panel a.hl-mm-sub {
	display: block;
	text-decoration: none !important;
	background: var(--hl-btn) !important;
	border: 1px solid var(--hl-btn-border) !important;
	color: var(--hl-text) !important;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 14px 16px;
	border-radius: 9px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.hl-mega-parent .hl-mm-panel a.hl-mm-sub:hover {
	background: var(--hl-btn-hover) !important;
	border-color: rgba(255, 255, 255, .2) !important;
	transform: translateY(-1px);
}

/* -------------------------------------------------------------------------
 * INLINE MODE — used when the menu is collapsed into a hamburger.
 * The JS adds .hl-mm-inline to the menu item. The panel then flows
 * in-place, full width, instead of floating (which pushed it off-screen).
 * ---------------------------------------------------------------------- */
.hl-mega-parent.hl-mm-inline > .hl-mm-panel,
.hl-mega-parent.hl-mm-inline > .hl-mm-panel.hl-mm-center,
.hl-mega-parent.hl-mm-inline > .hl-mm-panel.hl-mm-left,
.hl-mega-parent.hl-mm-inline > .hl-mm-panel.hl-mm-right {
	position: static !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 8px 0 0 !important;
	padding: 16px !important;
	box-shadow: none !important;
	transform: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	display: none;
}
.hl-mega-parent.hl-mm-inline.is-open > .hl-mm-panel {
	display: block !important;
}
.hl-mega-parent.hl-mm-inline .hl-mm-grid {
	grid-template-columns: 1fr !important;
	gap: 16px;
}
.hl-mega-parent.hl-mm-inline .hl-mm-divider { display: none !important; }
.hl-mega-parent.hl-mm-inline .hl-mm-subs { grid-template-columns: 1fr !important; }
.hl-mega-parent.hl-mm-inline .hl-mm-sub { white-space: normal !important; }

@media (prefers-reduced-motion: reduce) {
	.hl-mm-panel,
	.hl-mega-parent .hl-mm-chev,
	.hl-mm-panel .hl-mm-sub,
	.hl-mm-panel .hl-mm-cat {
		transition: none !important;
	}
}
