/*
 * WMS spare parts mega menu - shared stylesheet
 * Used by the Flynax main navigation and by the Gambio shop navigation.
 * All class names are prefixed with wms-mm- to stay clear of Flynax and Bootstrap styles.
 */

.wms-mm,
.wms-mm * {
	box-sizing: border-box;
}

/* ---------- panel shell ---------- */
.wms-mm {
	display: none;
	position: absolute;
	z-index: 1200;
	left: 0;
	right: 0;
	margin: 0 auto;
	padding: 18px;
	max-width: 1180px;
	background: #fff;
	border: 1px solid #e3e8ef;
	border-top: 3px solid #1769e0;
	border-radius: 0 0 14px 14px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
	color: #0b1220;
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}

.wms-mm.is-open {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 18px;
}

.wms-mm[hidden] {
	display: none;
}

/* invisible bridge over the gap between the menu row and the panel, so moving the mouse down does not close it */
.wms-mm:not(.wms-mm--single):not(.wms-mm--accordion)::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -40px;
	height: 40px;
}

/* shop navigation already lists the main categories itself, so the rail is not needed there */
.wms-mm--single.is-open {
	grid-template-columns: 1fr;
}

.wms-mm--single .wms-mm-rail {
	display: none;
}

/* ---------- category rail ---------- */
.wms-mm-rail {
	margin: 0;
	padding: 0 18px 0 0;
	list-style: none;
	border-right: 1px solid #eef1f6;
	max-height: 420px;
	overflow-y: auto;
}

.wms-mm-rail li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wms-mm-rail button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0 0 2px;
	padding: 9px 12px;
	background: none;
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-weight: 600;
	color: #0b1220;
	text-align: left;
	cursor: pointer;
}

.wms-mm-rail button:hover,
.wms-mm-rail button:focus-visible {
	background: #f3f6fb;
	outline: none;
}

.wms-mm-rail button[aria-selected="true"] {
	background: #1769e0;
	color: #fff;
}

.wms-mm-rail .wms-mm-n {
	font-weight: 500;
	font-size: 12.5px;
	opacity: .65;
	flex: 0 0 auto;
}

/* ---------- detail pane ---------- */
.wms-mm-body {
	min-width: 0;
}

.wms-mm-pane {
	display: none;
	grid-template-columns: 300px 1fr;
	gap: 20px;
	align-items: start;
	min-width: 0;
}

.wms-mm-pane.is-open {
	display: grid;
}

.wms-mm-pane.wms-mm-pane--noSubs {
	grid-template-columns: 300px minmax(0, 420px);
}

.wms-mm-media {
	margin: 0;
	min-width: 0;
}

.wms-mm-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 750 / 273;
	object-fit: cover;
	border-radius: 10px;
	background: #f3f6fb;
}

@supports not (aspect-ratio: 1 / 1) {
	.wms-mm-media img {
		max-height: 110px;
	}
}

.wms-mm-title {
	margin: 10px 0 2px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.wms-mm-meta {
	margin: 0 0 10px;
	font-size: 12.5px;
	color: #64748b;
}

/* links: the host templates style a:link / a:visited, so these rules need a higher specificity */
.wms-mm a.wms-mm-cta,
.wms-mm a.wms-mm-cta:link,
.wms-mm a.wms-mm-cta:visited {
	display: inline-block;
	padding: 8px 14px;
	background: #1769e0;
	border-radius: 8px;
	color: #fff;
	font-weight: 600;
	font-size: 13.5px;
	text-decoration: none;
}

.wms-mm a.wms-mm-cta:hover,
.wms-mm a.wms-mm-cta:focus-visible {
	background: #1257bb;
	color: #fff;
	text-decoration: none;
}

/* ---------- subcategory table ---------- */
.wms-mm-subs {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px 18px;
	align-content: start;
}

.wms-mm-subs li {
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.wms-mm a.wms-mm-sub,
.wms-mm a.wms-mm-sub:link,
.wms-mm a.wms-mm-sub:visited {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 6px;
	color: #243244;
	text-decoration: none;
}

.wms-mm a.wms-mm-sub:hover,
.wms-mm a.wms-mm-sub:focus-visible {
	background: #f3f6fb;
	color: #1769e0;
	text-decoration: none;
	outline: none;
}

.wms-mm-sub-name {
	min-width: 0;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.wms-mm-sub .wms-mm-n {
	flex: 0 0 auto;
	font-size: 12px;
	color: #94a3b8;
	font-variant-numeric: tabular-nums;
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
	.wms-mm-subs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 991px) {
	.wms-mm-pane,
	.wms-mm-pane.wms-mm-pane--noSubs {
		grid-template-columns: 1fr;
	}
	.wms-mm-media {
		max-width: 320px;
	}
}

/* ---------- accordion (mobile) ---------- */
[data-wms-mega] {
	position: relative;
}

.wms-mm-toggle {
	display: none;
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.wms-mm-toggle::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: 14px auto 0;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .15s ease;
}

.wms-mm-toggle[aria-expanded="true"]::after {
	transform: rotate(-135deg);
	margin-top: 18px;
}

@media (max-width: 991px) {
	.wms-mm-toggle {
		display: block;
	}
}

/* the accordion only ever exists on small screens */
.wms-mm--accordion {
	display: none;
}

@media (min-width: 992px) {
	.wms-mm--accordion,
	.wms-mm--accordion.is-open {
		display: none !important;
	}
}

.wms-mm--accordion {
	position: static;
	max-width: none;
	padding: 6px 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
}

.wms-mm--accordion.is-open {
	display: block;
}

.wms-mm--accordion .wms-mm-rail {
	border-right: 0;
	padding-right: 0;
	max-height: none;
	overflow: visible;
}

.wms-mm--accordion .wms-mm-rail button {
	border-radius: 0;
	border-bottom: 1px solid #eef1f6;
	padding: 12px 10px;
}

.wms-mm--accordion .wms-mm-rail button[aria-expanded="true"] {
	background: #f3f6fb;
	color: #0b1220;
}

.wms-mm--accordion .wms-mm-pane {
	grid-template-columns: 1fr;
	padding: 10px 10px 16px;
}

.wms-mm--accordion .wms-mm-subs {
	grid-template-columns: 1fr;
}

.wms-mm--accordion .wms-mm-media {
	max-width: 260px;
}

/* the Flynax mobile menu is dark, so the accordion uses a light-on-dark scheme */
.wms-mm--accordion .wms-mm-rail button {
	color: #e5e9f0;
	border-bottom-color: rgba(255, 255, 255, .12);
}

.wms-mm--accordion .wms-mm-rail button:hover,
.wms-mm--accordion .wms-mm-rail button:focus-visible,
.wms-mm--accordion .wms-mm-rail button[aria-expanded="true"] {
	background: rgba(255, 255, 255, .08);
	color: #fff;
}

.wms-mm--accordion .wms-mm-title {
	color: #fff;
}

.wms-mm--accordion .wms-mm-meta {
	color: #9fb0c4;
}

.wms-mm--accordion a.wms-mm-sub,
.wms-mm--accordion a.wms-mm-sub:link,
.wms-mm--accordion a.wms-mm-sub:visited {
	color: #d5deea;
}

.wms-mm--accordion a.wms-mm-sub:hover,
.wms-mm--accordion a.wms-mm-sub:focus-visible {
	background: rgba(255, 255, 255, .08);
	color: #fff;
}

.wms-mm--accordion .wms-mm-sub .wms-mm-n {
	color: #8da0b6;
}

/* ---------- shop: hide Gambio's native text dropdowns once the mega menu is active (desktop only) ---------- */
html.wms-mm-shop #categories .wms-mm-has > ul.level-2,
html.wms-mm-shop #categories .wms-mm-has > .dropdown-menu {
	display: none !important;
}
