/* Wastewise Theme Advanced Header Menu CSS */

.theme-nav-bar {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	position: relative; /* Position dropdown relative to the whole nav bar */
	gap: 30px;
}

.theme-nav-item {
	position: static; /* Important so dropdown aligns to nav bar */
}

.theme-nav-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	text-transform: uppercase;
	font-weight: 600;
	font-size: 14px;
	color: #cccccc;
	transition: color 0.3s ease;
	position: relative;
	padding: 30px 5px; /* taller padding for header */
}

.theme-nav-link:hover, .theme-nav-item:hover .theme-nav-link {
	color: #ffffff;
}

/* Hover orange line effect */
.theme-nav-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 3px;
	background-color: #f39c12; /* Default orange, controlled by Elementor */
	transition: all 0.3s ease;
	transform: translateX(-50%);
}

.theme-nav-item:hover .theme-nav-link::after,
.theme-nav-item.current-menu-item .theme-nav-link::after {
	width: 100%;
}

/* ---------------------------------------------------------
   MEGA MENU DROPDOWN PANEL
--------------------------------------------------------- */
.theme-mega-dropdown {
	position: absolute !important;
	top: 100% !important;
	left: 50% !important;
	right: auto !important;
	width: 1400px !important; /* Constrained container width */
	max-width: 98vw !important;
	margin-left: 0 !important;
	transform: translate(-50%, 15px) !important; /* Center it horizontally */
	background-color: #2b2b2b; /* Let Elementor control this */
	border-radius: 6px; /* Let Elementor control this */
	border-top: 1px solid rgba(255,255,255,0.05);
	box-shadow: 0 20px 50px rgba(0,0,0,0.6);
	z-index: 9999;
	padding: 0 !important; /* Reset elementor padding so container works */
	
	/* Hidden by default */
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	pointer-events: none;
}

/* Show dropdown on hover */
.theme-nav-item:hover .theme-mega-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0) !important;
	pointer-events: auto;
}

.tmm-container {
	max-width: 1400px; /* Constrains the grid on ultra-wide screens */
	margin: 0 auto;
	padding: 30px 20px 10px 20px; /* Reduced bottom padding to compensate for column margin */
}

.tmm-columns-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0 30px; /* Row gap handled by column margin/padding for the divider line */
}

.tmm-column {
	padding-bottom: 25px;
	margin-bottom: 25px;
	border-bottom: 1px solid rgba(255,255,255,0.05); /* Divider line between rows */
}

/* ---------------------------------------------------------
   COLUMN HEADINGS
--------------------------------------------------------- */
.tmm-col-heading {
	margin: 0 0 15px 0;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff; /* Brighter heading */
	text-transform: uppercase;
	border-bottom: 2px solid rgba(255,255,255,0.05); /* Clear separation line */
	padding-bottom: 8px;
	letter-spacing: 0.5px;
}

.tmm-col-items {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ---------------------------------------------------------
   SUB ITEMS
--------------------------------------------------------- */
.tmm-item {
	display: flex;
	align-items: flex-start;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
}

/* Add a cool chevron arrow before each item to make it clear it's a child link */
.tmm-item::before {
	content: '\203A'; /* Chevron right › */
	font-size: 18px;
	color: #f39c12; /* Theme orange */
	margin-right: 8px;
	line-height: 1;
	transition: transform 0.3s ease;
}

.tmm-item:hover {
	transform: translateX(5px);
}

.tmm-item:hover::before {
	transform: translateX(3px);
}

.tmm-item-content {
	display: flex;
	flex-direction: column;
	margin-top: 2px; /* Align with chevron */
}

.tmm-item-title {
	font-size: 14px;
	font-weight: 400;
	color: #bbbbbb; /* Dimmer item title to contrast with bright heading */
	transition: color 0.2s ease;
}

.tmm-item:hover .tmm-item-title {
	color: #f39c12; /* Orange hover */
}

.tmm-item-subtitle {
	font-size: 11px;
	color: rgba(255,255,255,0.5);
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
/* Desktop-specific adjustments can go here. All mobile layout is handled directly in the widget inline CSS to ensure priority and avoid caching. */

/* =========================================================
   DESKTOP TWO-PANEL MEGA MENU  (screen > 1024px)
   ========================================================= */
@media (min-width: 1025px) {

	/* Align dropdown to its parent item instead of the whole nav bar */
	.theme-nav-item {
		position: relative !important;
	}

	.theme-nav-item:hover .theme-mega-dropdown {
		transform: translate(0, 0) !important;
	}

	/* Container: zero padding — two-panel handles all spacing */
	.wastewise-mega-menu-wrapper .theme-mega-dropdown .tmm-container {
		padding: 0 !important;
		margin: 0 !important;
		max-width: 100% !important;
	}

	/* White dropdown panel with purple top-accent border */
	.theme-mega-dropdown {
		background-color: #ffffff !important;
		border: 1px solid #e8eaf0 !important;
		border-top: 3px solid #4D509C !important;
		box-shadow: 0 24px 64px rgba(0,0,0,0.10), 0 6px 18px rgba(77,80,156,0.08) !important;
		border-radius: 0 0 12px 12px !important;
		width: 270px !important;
		min-width: 270px !important;
		max-width: 96vw !important;
		overflow: visible !important;
		left: 0 !important;
		transform: translate(0, 15px) !important;
	}

	/* Hide original multi-column grid on desktop (mobile accordion uses it) */
	.tmm-columns-grid.tmm-mobile-only {
		display: none !important;
	}

	/* ─── Two-Panel Container ─────────────────────────────── */
	.tmm-two-panel-layout {
		display: block;
		min-height: auto;
		width: 100%;
		border-radius: 0 0 12px 12px;
		overflow: visible;
	}

	/* ─── Left Sidebar ────────────────────────────────────── */
	.tmm-desktop-sidebar {
		width: 100%;
		background: #f6f7fb;
		padding: 10px 0;
	}

	.tmm-desktop-sidebar-item {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 13px 14px 13px 18px;
		font-size: 15px; /* Increased from 13px */
		font-weight: 600;
		color: #444444;
		cursor: pointer;
		border-left: 3px solid transparent;
		border-bottom: 1px solid #ebebeb;
		transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
		text-transform: uppercase;
		letter-spacing: 0.4px;
		line-height: 1.4;
		user-select: none;
		gap: 8px;
	}

	.tmm-desktop-sidebar-item:last-child {
		border-bottom: none;
	}

	.tmm-desktop-sidebar-item .tmm-sidebar-label {
		flex: 1;
	}

	.tmm-desktop-sidebar-item .tmm-sidebar-arrow {
		font-size: 18px;
		color: #cccccc;
		line-height: 1;
		transition: color 0.2s ease, transform 0.2s ease;
		flex-shrink: 0;
	}

	.tmm-desktop-sidebar-item:hover,
	.tmm-desktop-sidebar-item.tmm-sidebar-active {
		background: #ffffff;
		color: #4D509C;
		border-left-color: #4D509C;
	}

	.tmm-desktop-sidebar-item:hover .tmm-sidebar-arrow,
	.tmm-desktop-sidebar-item.tmm-sidebar-active .tmm-sidebar-arrow {
		color: #4D509C;
		transform: translateX(3px);
	}

	.tmm-desktop-sidebar-item.tmm-sidebar-active {
		font-weight: 700;
	}

	/* ─── Right Content Panel (Flyout) ───────────────────────── */
	.tmm-desktop-panel {
		display: none;
		position: absolute;
		left: 100%;
		top: -3px; /* Align slightly over the border */
		width: 480px;
		background: #ffffff;
		border: 1px solid #e8eaf0;
		border-left: none; /* Touches sidebar seamlessly */
		border-radius: 0 8px 8px 8px;
		box-shadow: 12px 12px 30px rgba(0,0,0,0.08);
		padding: 24px 32px 20px 32px;
		z-index: 999;
	}

	/* Show panel purely via CSS hover */
	.tmm-desktop-sidebar-item:hover .tmm-desktop-panel,
	.tmm-desktop-sidebar-item.tmm-sidebar-active .tmm-desktop-panel {
		display: block;
		animation: tmmPanelIn 0.22s ease forwards;
	}

	/* Creates an invisible bridge so cursor doesn't fall out when moving to panel */
	.tmm-desktop-panel::before {
		content: '';
		position: absolute;
		left: -15px;
		top: 0;
		bottom: 0;
		width: 15px;
		background: transparent;
	}

	@keyframes tmmPanelIn {
		from { opacity: 0; transform: translateX(8px); }
		to   { opacity: 1; transform: translateX(0); }
	}

	/* Active category title shown above items */
	.tmm-panel-title {
		font-size: 11.5px;
		font-weight: 700;
		color: #4D509C;
		text-transform: uppercase;
		letter-spacing: 0.8px;
		padding-bottom: 10px;
		margin-bottom: 16px;
		border-bottom: 2px solid #4D509C;
		display: inline-block;
	}

	/* Single-column list with separator lines — matches reference design */
	.tmm-panel-items-grid {
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	/* ─── Items inside the desktop right panel ───────────── */
	.tmm-desktop-panel .tmm-item {
		display: flex !important;
		align-items: center !important;
		text-decoration: none !important;
		padding: 12px 10px 12px 4px !important;
		border-radius: 0 !important;
		border-bottom: 1px solid #f2f2f2 !important;
		transition: background 0.18s ease, transform 0.18s ease !important;
		gap: 6px;
		transform: none !important;
	}

	.tmm-desktop-panel .tmm-item:last-child {
		border-bottom: none !important;
	}

	.tmm-desktop-panel .tmm-item::before {
		content: '›' !important;
		font-size: 18px !important;
		color: #cccccc !important;
		margin-right: 0 !important;
		line-height: 1 !important;
		flex-shrink: 0;
		transition: color 0.18s ease, transform 0.18s ease !important;
		font-weight: 400 !important;
	}

	.tmm-desktop-panel .tmm-item:hover {
		background: #f6f7fb !important;
		transform: translateX(4px) !important;
	}

	.tmm-desktop-panel .tmm-item:hover::before {
		color: #4D509C !important;
		transform: translateX(2px);
	}

	.tmm-desktop-panel .tmm-item .tmm-item-title {
		font-size: 13px !important; /* Decreased from 15px */
		font-weight: 400 !important;
		color: #444444 !important;
		transition: color 0.18s ease !important;
		line-height: 1.4;
	}

	.tmm-desktop-panel .tmm-item:hover .tmm-item-title {
		color: #4D509C !important;
	}

	.tmm-desktop-panel .tmm-item-content {
		flex: 1;
	}

	.tmm-desktop-panel .tmm-item-subtitle {
		font-size: 11px;
		color: #999999;
		margin-top: 2px;
	}
}

