/* Homepage vehicle search: sentence form on white + compact quick-link row on the grey strip.
   Every class is dn-hvs- prefixed so nothing here can reach the theme's own rules. */

.dn-hvs {
	font-family: inherit;
	color: #464646;
}

/* Reserved height so filling the dropdowns and the count never shifts the page.
   Values are the measured hydrated height of the default (New) state per breakpoint. */
.dn-hvs-search {
	background: #fff;
	padding: 30px 20px 22px;
	min-height: 112px;
	box-sizing: border-box;
}

.dn-hvs-form {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 18px 28px;
}

.dn-hvs-sentence {
	margin: 0;
	color: #111;
	font-weight: 500;
	font-size: clamp(19px, 2.2vw, 30px);
	line-height: 1.9;
	text-align: center;
}

.dn-hvs-lead {
	white-space: nowrap;
}

/* Inline select: no box, red underline, black text (Nissan and model names stay black). */
.dn-hvs-sel {
	position: relative;
	display: inline-block;
}

.dn-hvs-sel[hidden] {
	display: none;
}

.dn-hvs-sel select,
.dn-hvs-measure {
	font-family: inherit;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.3;
}

.dn-hvs-sel select {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-bottom: 3px solid #c3002f;
	border-radius: 0;
	background: transparent;
	/* Nissan and model names must be pure black (brand compliance) */
	color: #000;
	padding: 0 24px 0 2px;
	margin: 0;
	max-width: 100%;
	cursor: pointer;
}

.dn-hvs-sel select:disabled {
	color: #000;
	opacity: 1;
	border-bottom-color: #c5cad0;
	cursor: not-allowed;
}

.dn-hvs-sel select.dn-hvs-empty {
	color: #6d747b;
}

.dn-hvs-sel::after {
	content: "";
	position: absolute;
	right: 6px;
	top: 50%;
	width: .3em;
	height: .3em;
	border-right: 2px solid #111;
	border-bottom: 2px solid #111;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

/* Off-screen twin of the select text, used to size each select to its chosen word. */
.dn-hvs-measure {
	position: absolute;
	left: -9999px;
	top: 0;
	visibility: hidden;
	white-space: pre;
}

.dn-hvs-go {
	height: 50px;
	border: 0;
	border-radius: 0;
	background: #c3002f;
	color: #fff;
	cursor: pointer;
	white-space: nowrap;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
	padding: 0 26px;
}

.dn-hvs-go:hover,
.dn-hvs-go:focus {
	background: #9d0026;
}

.dn-hvs-go-text {
	font-variant-numeric: tabular-nums;
}

/* Side view of the chosen model. Collapsed to 0 until a model with a render is picked;
   opens below the button so the button itself never moves. */
.dn-hvs-preview {
	display: grid;
	grid-template-rows: 0fr;
	width: min(100%, 340px);
	margin: 0 auto;
	transition: grid-template-rows .25s ease;
}

.dn-hvs-preview.is-open {
	grid-template-rows: 1fr;
}

.dn-hvs-preview-inner {
	min-height: 0;
	overflow: hidden;
}

.dn-hvs-preview-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 640 / 260;
	object-fit: contain;
	margin-top: 10px;
	opacity: 0;
	transition: opacity .2s ease;
}

.dn-hvs-preview-img.is-loaded {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.dn-hvs-preview,
	.dn-hvs-preview-img {
		transition: none;
	}
}

/* Quick links: the four destinations that used to be the big grey tile block. */
.dn-hvs-quick {
	background: #e3e3e3;
	padding: 14px 20px;
}

.dn-hvs-quick ul {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 1100px;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.dn-hvs-quick li {
	margin: 0;
	padding: 0;
	display: flex;
}

.dn-hvs-quick a {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: #fff;
	color: #05141f;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	padding: 10px 12px;
	min-height: 54px;
	transition: background-color .2s ease-in-out;
}

.dn-hvs-quick a:hover {
	background: #dfdfdf;
}

.dn-hvs-icon {
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	fill: #c3002f;
}

.dn-hvs :focus-visible {
	outline: 3px solid #05141f;
	outline-offset: 2px;
}

/* Touch tablets get the desktop layout, so keep the 44px tap target there too */
@media (pointer: coarse) {
	.dn-hvs-sel select {
		min-height: 44px;
	}
}

@media screen and (max-width: 760px) {
	.dn-hvs-search {
		padding: 22px 16px 18px;
		min-height: 198px;
	}

	.dn-hvs-form {
		gap: 14px;
	}

	.dn-hvs-sentence {
		line-height: 2.3;
	}

	.dn-hvs-sel select {
		min-height: 44px;
	}

	.dn-hvs-go {
		width: 100%;
	}

	.dn-hvs-quick {
		padding: 12px 16px;
	}

	.dn-hvs-quick ul {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}

	.dn-hvs-quick a {
		font-size: 13px;
		gap: 8px;
		padding: 8px;
	}

	.dn-hvs-icon {
		width: 26px;
		height: 26px;
	}
}
