/**
 * Lume Mega Menu — Frontend Styles
 *
 * Desktop navigation with mega panel support + mobile overlay drawer.
 */

/* ── Reset ── */
.lf-mega-menu-nav,
.lf-mega-menu-nav *,
.lf-mobile-overlay,
.lf-mobile-overlay * {
	box-sizing: border-box;
}

/* ════════════════════════════════════
   DESKTOP
   ════════════════════════════════════ */

.lf-mega-menu-nav {
	position: relative;
	width: 100%;
}

/* ── Top-level menu list ── */
.lf-mega-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	align-items: center;
}

.lf-layout-vertical .lf-mega-menu {
	flex-direction: column;
	align-items: stretch;
}

/* ── Menu items ── */
.lf-menu-item {
	position: relative;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lf-menu-item > a {
	display: flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, background-color 0.2s ease;
	padding: 10px 16px;
	color: inherit;
}

.lf-menu-arrow {
	display: inline-flex;
	align-items: center;
	transition: transform 0.2s ease;
}

/* ── Sub-menu (standard dropdown) ── */
.lf-submenu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	z-index: 1000;
}

.lf-layout-vertical .lf-submenu {
	top: 0;
	left: 100%;
}

.lf-submenu .lf-submenu {
	top: 0;
	left: 100%;
}

.lf-submenu .lf-menu-item > a {
	padding: 8px 16px;
	white-space: nowrap;
}

/* ── Mega Panel ── */
.lf-mega-panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	padding: 20px;
}


/* Full-width: JS portals the panel to the header element so
   it positions relative to the header, not the widget.
   The panel offset control adds to --lf-panel-offset. */
.lf-mega-panel-portal {
	display: none;
	position: absolute;
	top: calc(100% + var(--lf-panel-offset, 0px));
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9999;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 0;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	padding: 20px;
}

.lf-mega-panel-portal.lf-panel-open {
	display: block;
}

.lf-mega-width-auto > .lf-mega-panel {
	min-width: 400px;
}

/* ── Ensure header is the positioning context for portalled panels ── */
.lf-mega-menu-header-ctx {
	position: relative;
}

/* ── Hover open (desktop) — standard submenus only ── */
.lf-mega-menu-nav .lf-has-dropdown:hover > .lf-submenu {
	display: block;
}

/* Mega panels are shown/hidden by JS after portal move */
.lf-mega-menu-nav .lf-has-mega.lf-panel-active > a .lf-menu-arrow {
	transform: rotate(180deg);
}

.lf-mega-menu-nav .lf-has-dropdown:hover > a .lf-menu-arrow {
	transform: rotate(180deg);
}

/* ── Focus-within for keyboard nav — standard submenus ── */
.lf-mega-menu-nav .lf-has-dropdown:focus-within > .lf-submenu {
	display: block;
}

/* ── Mobile Toggle (in the nav bar) ── */
.lf-mega-menu-toggle-wrap {
	display: none;
	align-items: center;
}

.lf-mega-menu-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
}

.lf-mega-menu-toggle svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* ── Responsive: show toggle, hide desktop menu ── */
.lf-mega-menu-nav.lf-mobile-active .lf-mega-menu-toggle-wrap {
	display: flex;
}

.lf-mega-menu-nav.lf-mobile-active .lf-mega-menu {
	display: none;
}

/* ════════════════════════════════════
   MOBILE OVERLAY
   ════════════════════════════════════ */

.lf-mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.5);
	display: none;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.lf-mobile-overlay.lf-overlay-open {
	display: flex;
	opacity: 1;
}

/* ── Drawer ── */
.lf-mobile-drawer {
	position: absolute;
	top: 0;
	right: 0;
	width: 85%;
	max-width: 400px;
	height: 100%;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.lf-overlay-open .lf-mobile-drawer {
	transform: translateX(0);
}

/* ── Header ── */
.lf-mobile-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.lf-mobile-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.lf-mobile-logo {
	max-height: 36px;
	width: auto;
}

.lf-mobile-site-name {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lf-mobile-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	flex-shrink: 0;
}

.lf-mobile-close svg {
	width: 24px;
	height: 24px;
}

/* ── Body / Screens ── */
.lf-mobile-body {
	flex: 1;
	position: relative;
	overflow: hidden;
}

.lf-mobile-screen {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px 0;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.lf-mobile-screen.lf-mobile-screen-active {
	transform: translateX(0);
}

.lf-mobile-screen.lf-mobile-screen-left {
	transform: translateX(-30%);
}

/* ── Back button ── */
.lf-mobile-back {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 12px 20px;
	font-size: 14px;
	color: inherit;
	opacity: 0.7;
	width: 100%;
	text-align: left;
}

.lf-mobile-back:hover {
	opacity: 1;
}

/* ── Screen title ── */
.lf-mobile-screen-title {
	padding: 4px 20px 12px;
	font-size: 16px;
	font-weight: 700;
}

/* ── Menu list ── */
.lf-mobile-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lf-mobile-item-row {
	display: flex;
	align-items: center;
}

.lf-mobile-item-row a {
	flex: 1;
	padding: 12px 20px;
	text-decoration: none;
	color: inherit;
	font-size: 16px;
	transition: background-color 0.15s ease;
}

.lf-mobile-item-row a:hover {
	background: rgba(0, 0, 0, 0.04);
}

.lf-mobile-arrow {
	background: none;
	border: none;
	cursor: pointer;
	padding: 12px 20px 12px 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	opacity: 0.5;
	flex-shrink: 0;
}

.lf-mobile-arrow:hover {
	opacity: 1;
}

/* ── Mega content in mobile ── */
.lf-mobile-mega-content {
	padding: 12px 20px;
}

/* ── Footer CTA ── */
.lf-mobile-footer {
	padding: 16px 20px;
	border-top: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex-shrink: 0;
}

.lf-mobile-cta {
	display: block;
	text-align: center;
	padding: 12px 20px;
	border-radius: 6px;
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	transition: opacity 0.2s ease;
}

.lf-mobile-cta:hover {
	opacity: 0.85;
}

.lf-mobile-cta-primary {
	background: #000;
	color: #fff;
}

.lf-mobile-cta-secondary {
	background: transparent;
	color: #000;
	border: 1px solid #ddd;
}

/* ── Accessibility ── */
.lf-mega-menu-nav a:focus-visible,
.lf-mobile-overlay a:focus-visible,
.lf-mobile-overlay button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}
