/**
 * Fibre Systems Core — product mega menu.
 * Desktop: dropdown panel with columns. Mobile (<=1024px): off-canvas accordion drawer.
 * Light-on-dark; re-themeable via --fsc-mega-* vars.
 */
.fsc-mega {
	--fsc-mega-bg: #0f172a;
	--fsc-mega-fg: #ffffff;
	--fsc-mega-muted: rgba( 255, 255, 255, 0.7 );
	--fsc-mega-border: rgba( 255, 255, 255, 0.12 );
	--fsc-mega-accent: #4ea3ff;
	position: relative;
	display: inline-block;
}

.fsc-mega__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
	padding: 8px 4px;
}

.fsc-mega__caret {
	transition: transform 0.2s ease;
	font-size: 0.8em;
}

.fsc-mega.is-open .fsc-mega__caret {
	transform: rotate( 180deg );
}

/* ---------- Desktop dropdown ---------- */
@media ( min-width: 1025px ) {
	.fsc-mega__panel {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 999;
		min-width: 720px;
		max-width: 92vw;
		background: var( --fsc-mega-bg );
		color: var( --fsc-mega-fg );
		border: 1px solid var( --fsc-mega-border );
		border-radius: 12px;
		box-shadow: 0 24px 48px -12px rgba( 0, 0, 0, 0.5 );
		padding: 20px;
		opacity: 0;
		visibility: hidden;
		transform: translateY( 8px );
		transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	}

	.fsc-mega:hover .fsc-mega__panel,
	.fsc-mega.is-open .fsc-mega__panel {
		opacity: 1;
		visibility: visible;
		transform: translateY( 0 );
	}

	.fsc-mega__inner {
		display: grid;
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
		gap: 18px 28px;
	}

	.fsc-mega__seg-toggle {
		display: none;
	}
}

/* ---------- Columns (shared) ---------- */
.fsc-mega__col {
	min-width: 0;
}

.fsc-mega__seg {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	gap: 8px;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var( --fsc-mega-border );
	padding: 6px 0;
	margin-bottom: 6px;
	cursor: pointer;
	text-align: left;
}

.fsc-mega__heading {
	color: var( --fsc-mega-fg );
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none;
}

.fsc-mega__heading:hover {
	color: var( --fsc-mega-accent );
}

.fsc-mega__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fsc-mega__list .fsc-mega__list {
	margin-left: 12px;
	border-left: 1px solid var( --fsc-mega-border );
	padding-left: 10px;
}

.fsc-mega__item > a {
	display: inline-block;
	color: var( --fsc-mega-muted );
	text-decoration: none;
	font-size: 0.85rem;
	padding: 3px 0;
}

.fsc-mega__item > a:hover {
	color: var( --fsc-mega-accent );
}

.fsc-mega__count {
	opacity: 0.5;
	font-size: 0.75em;
}

.fsc-mega__footer {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid var( --fsc-mega-border );
}

.fsc-mega__viewall {
	color: var( --fsc-mega-accent );
	font-weight: 600;
	text-decoration: none;
}

/* ---------- Mobile off-canvas ---------- */
@media ( max-width: 1024px ) {
	body.fsc-mega-lock {
		overflow: hidden;
	}

	.fsc-mega__panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 100000;
		width: min( 88vw, 380px );
		background: var( --fsc-mega-bg );
		color: var( --fsc-mega-fg );
		padding: 24px 20px;
		overflow-y: auto;
		transform: translateX( 100% );
		transition: transform 0.25s ease;
		box-shadow: -20px 0 40px rgba( 0, 0, 0, 0.4 );
	}

	.fsc-mega.is-open .fsc-mega__panel {
		transform: translateX( 0 );
	}

	.fsc-mega__inner {
		display: block;
	}

	.fsc-mega__col {
		border-bottom: 1px solid var( --fsc-mega-border );
	}

	.fsc-mega__seg-toggle {
		font-size: 1.2rem;
		color: var( --fsc-mega-muted );
	}

	/* Children hidden until the segment is expanded. */
	.fsc-mega__col > .fsc-mega__list {
		display: none;
		padding-bottom: 10px;
	}

	.fsc-mega__col.is-expanded > .fsc-mega__list {
		display: block;
	}

	.fsc-mega__col.is-expanded .fsc-mega__seg-toggle {
		transform: rotate( 45deg );
	}

	.fsc-mega__item > a {
		font-size: 0.95rem;
		padding: 6px 0;
	}
}

/* =========================================================================
   Site-wide category bar (.fsc-catbar) — printed under the header globally.
   Shares the dark palette with the mega menu.
   ========================================================================= */
.fsc-catbar {
	--fsc-catbar-bg: #0f172a;
	--fsc-catbar-fg: #ffffff;
	--fsc-catbar-muted: rgba( 255, 255, 255, 0.75 );
	--fsc-catbar-border: rgba( 255, 255, 255, 0.12 );
	--fsc-catbar-accent: #4ea3ff;
	/* --fsc-catbar-top is set by mega-menu.js to the live sticky-header height so the bar
	   pins directly beneath the (also-sticky) Elementor header instead of overlapping it.
	   The fallback (79px = current header height) covers first paint before JS runs. */
	--fsc-catbar-top: 79px;
	position: sticky !important;
	top: var( --fsc-catbar-top, 79px ) !important;
	z-index: 990 !important;
	background: var( --fsc-catbar-bg ) !important;
	color: var( --fsc-catbar-fg ) !important;
	border-bottom: 1px solid var( --fsc-catbar-border ) !important;
	margin: 0 !important;
	padding: 0 !important;
	font-family: inherit;
}

.fsc-catbar__inner {
	display: flex !important;
	align-items: stretch !important;
	gap: 4px !important;
	max-width: 1280px !important;
	margin: 0 auto !important;
	padding: 0 20px !important;
}

.fsc-catbar__all {
	display: inline-flex !important;
	align-items: center !important;
	color: var( --fsc-catbar-accent ) !important;
	font-weight: 700 !important;
	font-size: 0.85rem !important;
	text-transform: uppercase !important;
	letter-spacing: 0.03em !important;
	text-decoration: none !important;
	padding: 12px 14px !important;
	margin: 0 !important;
	white-space: nowrap !important;
}

.fsc-catbar__list {
	display: flex !important;
	align-items: stretch !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
}

.fsc-catbar__item {
	position: relative !important;
	display: flex !important;
	align-items: stretch !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	background: none !important;
}

.fsc-catbar__item::before {
	display: none !important; /* kill theme list bullets */
}

.fsc-catbar__link {
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px !important;
	color: var( --fsc-catbar-muted ) !important;
	font-size: 0.85rem !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	padding: 12px 14px !important;
	margin: 0 !important;
	white-space: nowrap !important;
	border-bottom: 2px solid transparent !important;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.fsc-catbar__link:hover,
.fsc-catbar__item:focus-within > .fsc-catbar__link {
	color: var( --fsc-catbar-fg );
}

.fsc-catbar__item.is-active > .fsc-catbar__link,
.fsc-catbar__all.is-active {
	color: var( --fsc-catbar-fg );
	border-bottom-color: var( --fsc-catbar-accent );
}

.fsc-catbar__caret {
	font-size: 0.7em;
	transition: transform 0.2s ease;
}

/* ---------- Desktop dropdown (>=1025px) ---------- */
@media ( min-width: 1025px ) {
	.fsc-catbar__drop {
		position: absolute !important;
		top: 100% !important;
		left: 0 !important;
		z-index: 999 !important;
		min-width: 240px !important;
		background: var( --fsc-catbar-bg ) !important;
		border: 1px solid var( --fsc-catbar-border ) !important;
		border-top: 0 !important;
		border-radius: 0 0 10px 10px !important;
		box-shadow: 0 24px 48px -12px rgba( 0, 0, 0, 0.5 ) !important;
		padding: 12px 16px !important;
		margin: 0 !important;
		opacity: 0;
		visibility: hidden;
		transform: translateY( 6px );
		transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	}

	.fsc-catbar__item:hover > .fsc-catbar__drop,
	.fsc-catbar__item:focus-within > .fsc-catbar__drop {
		opacity: 1;
		visibility: visible;
		transform: translateY( 0 );
	}

	.fsc-catbar__item:hover .fsc-catbar__caret {
		transform: rotate( 180deg );
	}

	.fsc-catbar__drop .fsc-mega__list {
		list-style: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.fsc-catbar__drop .fsc-mega__item {
		margin: 0 !important;
		padding: 0 !important;
		background: none !important;
	}

	.fsc-catbar__drop .fsc-mega__item::before {
		display: none !important;
	}

	.fsc-catbar__drop .fsc-mega__item > a {
		display: block !important;
		color: var( --fsc-catbar-muted ) !important;
		text-decoration: none !important;
		font-size: 0.85rem !important;
		padding: 5px 0 !important;
		margin: 0 !important;
		white-space: nowrap !important;
	}

	.fsc-catbar__drop .fsc-mega__item > a:hover {
		color: var( --fsc-catbar-accent ) !important;
	}
}

/* ---------- Mobile: horizontally-scrollable row, no dropdowns (<=1024px) ---------- */
@media ( max-width: 1024px ) {
	.fsc-catbar__inner {
		overflow-x: auto !important;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 0 12px !important;
	}

	.fsc-catbar__inner::-webkit-scrollbar {
		display: none;
	}

	/* Sub-category dropdowns collapse on mobile — the category link goes to the archive. */
	.fsc-catbar__drop {
		display: none !important;
	}

	.fsc-catbar__caret {
		display: none !important;
	}

	.fsc-catbar__link,
	.fsc-catbar__all {
		padding: 11px 12px !important;
	}
}
