:root {
	--vehicle-carousel-red: #ed1b2f;
	--vehicle-carousel-background: #f1f1f1;
	--vehicle-carousel-gap: 48px;
}

.vehicle-carousel {
	position: relative;
  box-sizing: border-box;
	padding: 50px 82px 42px;
	overflow: hidden;
	background: var(--vehicle-carousel-background);
}

.vehicle-carousel__viewport {
	width: 100%;
	max-width: 1320px;
	margin-inline: auto;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
}

.vehicle-carousel__viewport::-webkit-scrollbar {
	display: none;
}

.vehicle-carousel__viewport:focus-visible {
	outline: 2px solid var(--vehicle-carousel-red);
	outline-offset: 4px;
}

.vehicle-carousel__track {
	display: flex;
	gap: var(--vehicle-carousel-gap);
	align-items: stretch;
}

.vehicle-carousel__item {
	flex: 0 0 calc(
		(100% - (2 * var(--vehicle-carousel-gap))) / 3
	);
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	text-align: center;
}

.vehicle-carousel__link {
	display: grid;
	grid-template-rows: auto auto auto;
	width: 100%;
	height: 100%;
	align-content: start;
	justify-items: center;
	color: #111;
	text-decoration: none;
}

.vehicle-carousel__link:hover,
.vehicle-carousel__link:focus-visible {
	color: #111;
	text-decoration: none;
}

.vehicle-carousel__link:focus-visible {
	outline: 2px solid var(--vehicle-carousel-red);
	outline-offset: 4px;
}

.vehicle-carousel__image {
	position: relative;
	flex: none;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin-bottom: 15px;
	overflow: hidden;
}

.vehicle-carousel__image-element {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center bottom;
	transition: transform 180ms ease;
}

.vehicle-carousel__link:hover .vehicle-carousel__image-element {
	transform: scale(1.025);
}

.vehicle-carousel__image-placeholder {
	display: flex;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
	color: #777;
	border: 1px dashed #bbb;
	font-size: 14px;
}

.vehicle-carousel__title {
	box-sizing: content-box;
	width: 100%;
	height: 2.5em;
	margin: 0 0 6px;
	overflow: hidden;
	color: #111;
	font-family: inherit;
	font-size: clamp(18px, 1.3vw, 22px);
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-transform: uppercase;
}

.vehicle-carousel__details {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--vehicle-carousel-red);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-transform: uppercase;
	justify-self: center;
}

.vehicle-carousel__details svg {
	width: 7px;
	height: 12px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 150ms ease;
}

.vehicle-carousel__link:hover .vehicle-carousel__details svg {
	transform: translateX(3px);
}

.vehicle-carousel__nav {
	position: absolute;
	z-index: 2;
	top: 50%;
	display: flex;
	width: 52px;
	height: 52px;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	color: var(--vehicle-carousel-red);
	border: 1px solid #ddd;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
	cursor: pointer;
	transform: translateY(-50%);
	appearance: none;
}

.vehicle-carousel__nav:hover,
.vehicle-carousel__nav:focus-visible {
	color: #fff;
	border-color: var(--vehicle-carousel-red);
	background: var(--vehicle-carousel-red);
}

.vehicle-carousel__nav:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

.vehicle-carousel__nav svg {
	width: 15px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.vehicle-carousel__nav--previous {
	left: 80px;
}

.vehicle-carousel__nav--next {
	right: 80px;
}

@media (max-width: 1199px) {
	.vehicle-carousel {
		padding-inline: 70px;
	}

	.vehicle-carousel__item {
		flex-basis: calc(
			(100% - var(--vehicle-carousel-gap)) / 2
		);
	}
}

@media (max-width: 767px) {
	:root {
		--vehicle-carousel-gap: 20px;
	}

	.vehicle-carousel {
		--vehicle-carousel-gap: 20px;
		padding: 36px 0 32px;
	}

	.vehicle-carousel__viewport {
		box-sizing: border-box;
		padding-inline: 20px;
		scroll-padding-inline: 20px;
	}

	.vehicle-carousel__item {
		flex-basis: 85%;
	}

	.vehicle-carousel__nav {
		display: none;
	}

	.vehicle-carousel__title {
		height: 2.5em;
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vehicle-carousel__viewport {
		scroll-behavior: auto;
	}

	.vehicle-carousel__image-element,
	.vehicle-carousel__details svg {
		transition: none;
	}
}