/* Anchor the wide dropdown to the nav, the theme JS only positions it on page load so resizing misplaces it */
.qodef-header-navigation > ul > li.qodef-menu-item--wide.qodef-menu-item--wide {
	position: static;
}

/* Static positioning above makes this stray indicator span the whole nav, the sliding highlight covers it instead */
.qodef-header-navigation > ul > li.qodef-menu-item--wide.qodef-menu-item--wide:before {
	display: none !important;
}

.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second {
	left: calc((100% - 100vw) / 2) !important;
	right: calc((100% - 100vw) / 2);
	width: auto !important;
}

/* Vehicles mega dropdown panel */
.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second {
	-webkit-backdrop-filter: blur(40px);
	backdrop-filter: blur(40px);
	background-color: rgba(255, 255, 255, 0.3);
	box-shadow: 0 100vh 0 100vh rgba(0, 0, 0, 0.2);
}

/* Let the open panel grow past the JS-measured height */
.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second.qodef-drop-down--start {
	min-height: max-content;
}

/* Kill the sticky header's white dropdown overlay */
.qodef-header-sticky .qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second:before {
	content: none;
}

.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second-inner {
	width: 100%;
	max-width: none;
	padding: 0 2.5rem;
}

.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second-inner > ul {
	gap: 2rem;
	padding: 3.25rem 0;
	margin: 0;
}

.qodef-header-navigation ul li.qodef-menu-item--wide.qodef-menu-item--wide .qodef-drop-down-second-inner > ul > li {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
	padding: 0;
}

/* Vehicle cards */
.mega-menu-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	white-space: normal;
}

.mega-menu-card .mega-menu-card-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 428 / 306;
	object-fit: cover;
}

.mega-menu-card .mega-menu-card-title {
	margin-top: 0.75rem;
	font-family: "Oxanium", sans-serif;
	font-weight: 800;
	font-size: 2rem;
	line-height: 1.25;
	text-transform: uppercase;
	color: #ffffff;
}

/* Shared button style, replicates the theme's filled button (cards + header CTA) */
.mega-menu-card .mega-menu-card-button,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	height: 3.5rem;
	padding: 0 2rem;
	font-family: "Oxanium", sans-serif;
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.2;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
	background-color: #ffffff;
	color: #000000;
	transition: color 0.2s ease-out;
	z-index: 0;
}

/* Gold bar that swipes to fill on hover */
.mega-menu-card .mega-menu-card-button:after,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 0.375rem;
	height: 100%;
	background-color: #c4a75d;
	z-index: -1;
	transition: width 0.4s;
}

.mega-menu-card .mega-menu-card-button {
	margin-top: 0.75rem;
}

.mega-menu-card:hover .mega-menu-card-button,
.mega-menu-card:focus-visible .mega-menu-card-button,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:hover,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:focus-visible,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:hover .qodef-menu-item-text,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:focus-visible .qodef-menu-item-text {
	color: #ffffff;
}

.mega-menu-card:hover .mega-menu-card-button:after,
.mega-menu-card:focus-visible .mega-menu-card-button:after,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:hover:after,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:focus-visible:after {
	width: 100%;
}

/* Button text with the rotating plus icon */
.mega-menu-card .mega-menu-card-button-text,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a .qodef-menu-item-text {
	position: relative;
	display: flex;
	align-items: center;
	color: #000000;
}

.mega-menu-card .mega-menu-card-button-text:before,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a .qodef-menu-item-text:before {
	content: "";
	flex-shrink: 0;
	align-self: center;
	width: 0.875rem;
	height: 0.875rem;
	/* Optical lift, uppercase text sits above the line-box centre */
	margin-top: -0.0625rem;
	margin-right: 0.625rem;
	background: linear-gradient(currentColor, currentColor) center / 0.875rem 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 0.875rem no-repeat;
	transform: rotate(0);
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mega-menu-card:hover .mega-menu-card-button-text:before,
.qodef-header-navigation > ul > li.menu-cta.menu-cta > a:hover .qodef-menu-item-text:before {
	transform: rotate(-90deg);
}

/* Header CTA item, pinned to the container edge */
@media only screen and (min-width: 64.0625rem) {
	#qodef-page-header-inner:has(li.menu-cta) .qodef-widget-holder,
	#qodef-page-header .qodef-header-sticky-inner:has(li.menu-cta) .qodef-widget-holder {
		display: none;
	}

	/* Overrides the !important nav-centring hack in the child style.css */
	.qodef-header-standard--center #qodef-page-header-inner .qodef-header-navigation:has(li.menu-cta) {
		margin-left: 0 !important;
		margin-right: 0 !important;
		transform: none;
	}

	.qodef-header-navigation:has(li.menu-cta) {
		flex-grow: 1;
	}

	.qodef-header-navigation > ul > li.menu-cta {
		position: absolute;
		top: 0;
		right: 0;
		display: flex;
		align-items: center;
		height: 100%;
		padding-right: 0 !important;
	}
}

/* The full nav doesn't fit below 1320px, swap to the mobile header sooner */
@media only screen and (min-width: 64.0625rem) and (max-width: 82.4375rem) {
	#qodef-page-header:has(li.menu-cta) {
		display: none;
	}

	body:has(#qodef-page-header li.menu-cta) #qodef-page-mobile-header {
		display: block;
	}
}

/* Narrow desktop: links right-aligned; logo stays pinned or the dropdown misaligns */
@media only screen and (min-width: 82.5rem) and (max-width: 90.9375rem) {
	.qodef-header-navigation:has(li.menu-cta) {
		min-width: 0;
	}

	/* Sticky header keeps its logo in flow by default, pin it like the main one */
	#qodef-page-header .qodef-header-sticky-inner:has(li.menu-cta) > .qodef-header-logo-link {
		position: absolute;
		top: 50%;
		left: 2.5rem;
		transform: translateY(-50%);
		z-index: 1;
	}

	#qodef-page-header-inner:has(li.menu-cta) .qodef-header-logo {
		z-index: 1;
	}

	/* Left padding clears the pinned logo, right padding clears the button */
	.qodef-header-navigation:has(li.menu-cta) > ul {
		justify-content: flex-end;
		padding-right: 17rem;
		padding-left: 14rem;
	}

	.qodef-header-navigation:has(li.menu-cta) > ul > li {
		padding: 0 0.25rem !important;
	}

	.qodef-header-navigation:has(li.menu-cta) > ul > li > a {
		font-size: 0.8125rem;
	}

	/* Room for the chevron, it hangs 12px outside the link */
	.qodef-header-navigation:has(li.menu-cta) > ul > li.qodef-menu-item--wide > a {
		padding-right: 1.25rem;
	}
}

/* Wide screens, the design layout: links truly centred, clear of the logo and button */
@media only screen and (min-width: 91rem) {
	.qodef-header-navigation:has(li.menu-cta) > ul {
		justify-content: center;
		padding: 0 16.25rem;
	}

	/* Sticky header keeps its logo in flow, pin it so the nav centres like the main header */
	#qodef-page-header .qodef-header-sticky-inner:has(li.menu-cta) > .qodef-header-logo-link {
		position: absolute;
		top: 50%;
		left: 2.5rem;
		transform: translateY(-50%);
		z-index: 1;
	}

	/* The full-width nav sits over the pinned logos, lift them so they stay clickable */
	#qodef-page-header-inner:has(li.menu-cta) .qodef-header-logo {
		z-index: 1;
	}

	/* Room for the chevron so the hover block covers the full label */
	.qodef-header-navigation:has(li.menu-cta) > ul > li.qodef-menu-item--wide > a {
		padding-right: 1.25rem;
	}
}

/* Nine links only just fit centred below 1800px, tighten the gaps */
@media only screen and (min-width: 91rem) and (max-width: 112.4375rem) {
	.qodef-header-navigation:has(li.menu-cta) > ul {
		padding: 0 17rem 0 14.5rem;
	}

	/* Gap scales with the room available: 4px at 1456px up to the full 22px by 1800px */
	.qodef-header-navigation:has(li.menu-cta) > ul > li {
		padding: 0 clamp(0.25rem, calc(0.25rem + (100vw - 91rem) * 0.052), 1.375rem) !important;
	}
}

.qodef-header-navigation > ul > li.menu-cta:hover {
	background-color: transparent;
}

/* Sticky header is white, invert the CTA */
#qodef-page-header .qodef-header-sticky .qodef-header-navigation > ul > li.menu-cta > a {
	background-color: #000000;
}

#qodef-page-header .qodef-header-sticky .qodef-header-navigation > ul > li.menu-cta > a .qodef-menu-item-text {
	color: #ffffff;
}

/* Stop the sliding hover block appearing behind the CTA button */
#qodef-page-header-inner:has(li.menu-cta:hover) .qodef-main-menu-background,
#qodef-page-header .qodef-header-sticky-inner:has(li.menu-cta:hover) .qodef-main-menu-background {
	visibility: hidden;
}

.qodef-header-navigation > ul > li.menu-cta:before {
	display: none;
}
