/**
 * Single vehicle listing.
 *
 * Figma desktop 10344:4989 — 1440 wide, 120px inset. Search band 106 tall over a
 *   container padded 80 top and bottom. Inside it, 780px of detail beside a
 *   380px sidebar, 40 apart, rows 24 apart: gallery 780 × 400 radius 20, title
 *   block 72, two 384 spec panels 12 apart, Seller's Notes. The sidebar is a
 *   price card and a loan calculator, both white, radius 10, padding 24,
 *   shadow 0 1px 4px rgba(2,2,2,.1), 24 apart.
 * Figma mobile 10344:5415 — 375 wide, 20px inset, container padded 40. The
 *   gallery goes full bleed at 375 × 240 with the "view all" control on a black
 *   bar beneath it instead of overlaid. The sidebar splits: the price card sits
 *   above the two spec panels and the calculator below them, so those four are
 *   siblings in one column rather than a nested aside.
 *
 * Type is the same in both frames apart from the listing title, so only that
 * one interpolates.
 */

.ae-vehicle {
	width: 100%;
}

/* -------------------------------------------------------------------------
 * Search band
 * ---------------------------------------------------------------------- */

.ae-vehicle-search {
	width: 100%;
	padding: 20px;
}

.ae-vehicle-search__form {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-inline: auto;
	padding: 12px 12px 12px 20px;
	border: 0.6px solid var(--ae-color-grey-400, #c7c7c7);
	border-radius: 40px;
	/* Figma mobile fills the pill grey; desktop fills it white. */
	background-color: var(--ae-color-grey-100, #f8f8f8);
}

.ae-vehicle-search__icon {
	display: none;
	flex: none;
}

.ae-vehicle-search__input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 18px;
	line-height: 28px;
	font-weight: 400;
	color: var(--ae-color-grey-600, #676767);
	-webkit-appearance: none;
	appearance: none;
}

.ae-vehicle-search__input::placeholder {
	color: var(--ae-color-grey-600, #676767);
	opacity: 1;
}

.ae-vehicle-search__input:focus {
	outline: none;
}

.ae-vehicle-search__form:focus-within {
	border-color: var(--ae-color-blue-600, #0c8ce9);
}

.ae-vehicle-search__submit {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.ae-vehicle-search__submit-text {
	display: none;
}

/* -------------------------------------------------------------------------
 * Layout
 * ---------------------------------------------------------------------- */

.ae-vehicle__body {
	/* The gallery bleeds to the edges at mobile, so the top space is on the
	 * title block instead of here. */
	padding-block: 0 40px;
}

.ae-vehicle__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

/*
 * One column, in the order the mobile frame stacks it, with the exact space the
 * frame puts above each block. `display: contents` dissolves the detail column
 * and the sidebar so their contents interleave freely; both become real boxes
 * again further up. Specs stays a flex column so the two panels can gap.
 */
.ae-vehicle__main,
.ae-vehicle__aside {
	display: contents;
}

.ae-vehicle__gallery {
	order: 1;
	/* Full bleed out of the container's 20px inset. */
	margin-inline: -20px;
}

.ae-vehicle__head {
	order: 2;
	margin-top: 40px;
}

.ae-vehicle__card--price {
	order: 3;
	margin-top: 32px;
}

.ae-vehicle__specs {
	display: flex;
	flex-direction: column;
	order: 4;
	gap: 10px;
	margin-top: 10px;
}

.ae-vehicle__card--loan {
	order: 6;
	margin-top: 10px;
}

.ae-vehicle__notes {
	order: 7;
	margin-top: 20px;
}

/* -------------------------------------------------------------------------
 * Gallery
 * ---------------------------------------------------------------------- */

.ae-vehicle__gallery {
	position: relative;
}

.ae-vehicle__gallery-frame {
	position: relative;
	overflow: hidden;
	/* Figma mobile: 375 × 240. */
	aspect-ratio: 375 / 240;
}

.ae-vehicle__gallery-track {
	display: flex;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.ae-vehicle__gallery-track::-webkit-scrollbar {
	display: none;
}

.ae-vehicle__gallery-slide {
	flex: 0 0 100%;
	height: 100%;
	scroll-snap-align: start;
}

.ae-vehicle__gallery-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ae-vehicle__gallery-nav {
	position: absolute;
	/* Figma: the arrow pair is inset 20px from both edges, centred vertically. */
	top: 50%;
	right: 20px;
	left: 20px;
	display: flex;
	justify-content: space-between;
	transform: translateY(-50%);
	pointer-events: none;
}

.ae-vehicle__gallery-arrow {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
}

.ae-vehicle__gallery-arrow--next .ae-icon {
	transform: scaleX(-1);
}

.ae-vehicle__gallery-actions {
	display: flex;
	justify-content: center;
	padding: 20px;
	background-color: var(--ae-color-black, #000);
}

.ae-vehicle__gallery-all {
	padding: 16px 32px;
	border: 0;
	border-radius: 200px;
	background-color: var(--ae-color-white, #fff);
	font-family: inherit;
	font-size: 18px;
	line-height: 18px;
	font-weight: 400;
	letter-spacing: 0.72px;
	text-transform: uppercase;
	color: var(--ae-color-black, #000);
	cursor: pointer;
}

.ae-vehicle__gallery-all:hover,
.ae-vehicle__gallery-all:focus-visible {
	background-color: var(--ae-color-blue-600, #0c8ce9);
	color: var(--ae-color-white, #fff);
}

/* -------------------------------------------------------------------------
 * Photo lightbox
 * ---------------------------------------------------------------------- */

.ae-vehicle-lightbox {
	width: calc(100% - 32px);
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--ae-color-grey-900, #222);
	box-shadow: var(--ae-shadow-basic, 5px 5px 20px 0 rgba(0, 0, 0, 0.1));
	color: var(--ae-color-white, #fff);
	overflow: hidden;
}

@media (min-width: 1025px) {
	.ae-vehicle-lightbox {
		width: 77.78%; /* 1120 / 1440 */
	}
}

.ae-vehicle-lightbox::backdrop {
	background: rgba(34, 34, 34, 0.88);
}

.ae-vehicle-lightbox__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 16px;
}

.ae-vehicle-lightbox__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 200px;
	background: var(--ae-color-white, #fff);
	font-size: 28px;
	line-height: 1;
	color: var(--ae-color-grey-900, #222);
	cursor: pointer;
}

.ae-vehicle-lightbox__close:hover,
.ae-vehicle-lightbox__close:focus-visible {
	background-color: var(--ae-color-blue-600, #0c8ce9);
	color: var(--ae-color-white, #fff);
}

.ae-vehicle-lightbox__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ae-vehicle-lightbox__track {
	display: flex;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	border-radius: 8px;
	background: var(--ae-color-black, #000);
}

.ae-vehicle-lightbox__track::-webkit-scrollbar {
	display: none;
}

.ae-vehicle-lightbox__slide {
	flex: 0 0 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: min(62vh, 640px);
	scroll-snap-align: start;
}

.ae-vehicle-lightbox__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ae-vehicle-lightbox__nav {
	position: absolute;
	top: 50%;
	right: 12px;
	left: 12px;
	display: flex;
	justify-content: space-between;
	transform: translateY(-50%);
	pointer-events: none;
}

.ae-vehicle-lightbox__arrow {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
}

.ae-vehicle-lightbox__arrow--next .ae-icon {
	transform: scaleX(-1);
}

.ae-vehicle-lightbox__count {
	position: absolute;
	left: 50%;
	bottom: 12px;
	margin: 0;
	padding: 6px 12px;
	border-radius: 200px;
	background: rgba(0, 0, 0, 0.55);
	font-size: 14px;
	line-height: 18px;
	font-weight: 400;
	letter-spacing: 0.56px;
	transform: translateX(-50%);
	pointer-events: none;
}

.ae-vehicle-lightbox__thumbs {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0 4px 4px;
	overflow-x: auto;
	list-style: none;
	scrollbar-width: thin;
}

.ae-vehicle-lightbox__thumb {
	flex: 0 0 auto;
}

.ae-vehicle-lightbox__thumb-btn {
	display: block;
	width: 72px;
	height: 52px;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 6px;
	background: var(--ae-color-black, #000);
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.ae-vehicle-lightbox__thumb-btn:hover,
.ae-vehicle-lightbox__thumb-btn:focus-visible {
	opacity: 1;
}

.ae-vehicle-lightbox__thumb-btn.is-active {
	border-color: var(--ae-color-blue-600, #0c8ce9);
	opacity: 1;
}

.ae-vehicle-lightbox__thumb-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (min-width: 768px) {

	.ae-vehicle-lightbox__panel {
		gap: 20px;
		padding: 24px;
	}

	.ae-vehicle-lightbox__thumb-btn {
		width: 96px;
		height: 64px;
	}
}

/* -------------------------------------------------------------------------
 * Title block
 * ---------------------------------------------------------------------- */

.ae-vehicle__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"posted stats"
		"title  title";
	align-items: center;
	column-gap: 16px;
	row-gap: 16px;
}

.ae-vehicle__head-main {
	display: contents;
}

.ae-vehicle__posted {
	grid-area: posted;
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	line-height: 22px;
	font-weight: 400;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__posted .ae-icon {
	flex: none;
	/* Figma pads the 16px glyph out to a 22px box. */
	margin: 3px;
	/* Same vertical flip as Figma's Icon frame (-scale-y-100). */
	transform: scaleY(-1);
}

.ae-vehicle__posted .ae-icon path {
	/* Match the default heart icon (Figma Grey 600). */
	fill: var(--ae-color-grey-600, #676767);
}

.ae-vehicle__title {
	grid-area: title;
	margin: 0;
	/* Figma: 28/38 at 375 → 32/42 at 1440. */
	font-size: clamp(28px, calc(28px + 4 * var(--ae-fluid)), 32px);
	line-height: clamp(38px, calc(38px + 4 * var(--ae-fluid)), 42px);
	font-weight: 600;
	text-transform: uppercase;
	color: var(--ae-color-grey-900, #222);
	overflow-wrap: break-word;
}

.ae-vehicle__stats {
	grid-area: stats;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
}

.ae-vehicle__stat {
	display: flex;
	align-items: flex-start;
	gap: 2px;
}

/* The inlined icons lose the export's own display rule; they keep the box. */
svg.ae-icon {
	display: block;
	flex: none;
}

/*
 * Two of the three marks are buttons. Figma draws them as bare glyphs, so the
 * button is stripped back to the glyph and only the pointer and the focus ring
 * say it can be pressed.
 */
button.ae-vehicle__stat {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.ae-vehicle__stat--save .ae-icon path,
.ae-vehicle__save-icon path {
	transition: fill 0.15s ease-in-out;
}

/* The saved state is not drawn in Figma; it fills the heart in the palette red. */
.ae-vehicle__stat--save.is-saved .ae-icon path,
.ae-vehicle__save.is-saved .ae-vehicle__save-icon path {
	fill: var(--ae-color-red-600, #e90c0c);
}

.ae-vehicle__stat-value {
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
	color: var(--ae-color-grey-600, #676767);
}

/* Where the share button reports back. Empty until it has something to say. */
.ae-vehicle__stats-message:not(:empty) {
	align-self: center;
	font-size: 12px;
	line-height: 18px;
	color: var(--ae-color-grey-600, #676767);
}

/* -------------------------------------------------------------------------
 * Specification panels
 * ---------------------------------------------------------------------- */

.ae-vehicle__spec {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 20px;
	border-radius: 20px;
	background-color: var(--ae-color-grey-100, #f8f8f8);
}

.ae-vehicle__spec-row {
	font-size: 18px;
	line-height: 28px;
	overflow-wrap: break-word;
}

.ae-vehicle__spec-label {
	display: inline;
	font-weight: 400;
	color: var(--ae-color-black, #000);
}

.ae-vehicle__spec-value {
	display: inline;
	margin: 0;
	font-weight: 600;
	color: var(--ae-color-blue-700, #0067b3);
}

/* Figma sets the last two rows of the left panel in bold rather than semibold. */
.ae-vehicle__spec-value--strong {
	font-weight: 700;
}

/* -------------------------------------------------------------------------
 * Seller's Notes
 * ---------------------------------------------------------------------- */

.ae-vehicle__notes {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.ae-vehicle__notes-heading {
	margin: 0;
	font-size: 22px;
	line-height: 30px;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--ae-color-black, #000);
}

.ae-vehicle__note {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ae-vehicle__note-title {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	font-weight: 700;
	color: var(--ae-color-blue-700, #0067b3);
}

.ae-vehicle__note-body {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	font-weight: 400;
	color: var(--ae-color-grey-800, #404040);
	overflow-wrap: break-word;
}

/* -------------------------------------------------------------------------
 * Sidebar cards
 * ---------------------------------------------------------------------- */

.ae-vehicle__card {
	display: flex;
	flex-direction: column;
	/* Figma mobile pads these 32/20; desktop 24 all round. */
	padding: 32px 20px;
	border-radius: 10px;
	background-color: var(--ae-color-white, #fff);
	box-shadow: var(--ae-shadow-card, 0 1px 4px 0 rgba(2, 2, 2, 0.1));
}

.ae-vehicle__card--price {
	gap: 16px;
}

.ae-vehicle__card--loan {
	gap: 24px;
}

/* Price -------------------------------------------------------------- */

.ae-vehicle__price-block {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ae-vehicle__price {
	margin: 0;
	font-size: 32px;
	line-height: 42px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--ae-color-red-600, #e90c0c);
}

.ae-vehicle__price-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
	font-size: 14px;
	line-height: 22px;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__price-meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Figma separates the two with a hairline rule, 12px clear on each side. */
.ae-vehicle__price-meta-item + .ae-vehicle__price-meta-item {
	padding-left: 12px;
	border-left: 1px solid var(--ae-color-grey-300, #dbdbdb);
}

.ae-vehicle__price-meta-item .ae-icon {
	flex: none;
}

@media (max-width: 767px) {
	.ae-vehicle__price-meta {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}

	.ae-vehicle__price-meta-item {
		display: flex;
		align-items: center;
		gap: 6px;
		width: 100%;
		padding-left: 0;
	}

	.ae-vehicle__price-meta-item .ae-icon {
		flex: 0 0 22px;
		width: 22px;
		height: 22px;
	}

	.ae-vehicle__price-meta-item + .ae-vehicle__price-meta-item {
		padding-left: 0;
		padding-top: 4px;
		border-left: 0;
		border-top: 1px solid var(--ae-color-grey-300, #dbdbdb);
	}
}

/* Seller ------------------------------------------------------------- */

.ae-vehicle__seller {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* The rule Figma draws between the price and the seller block. */
.ae-vehicle__price-block + .ae-vehicle__seller {
	padding-top: 16px;
	border-top: 1px solid var(--ae-color-grey-300, #dbdbdb);
}

.ae-vehicle__seller-label {
	margin: 0;
	font-size: 14px;
	line-height: 14px;
	font-weight: 600;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__seller-badge {
	/* Shown at its drawn size — without this the column stretches it to fill. */
	align-self: flex-start;
	width: auto;
	max-width: 100%;
}

.ae-vehicle__seller-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ae-vehicle__seller-name {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	font-weight: 700;
	color: var(--ae-color-grey-900, #222);
	overflow-wrap: break-word;
}

.ae-vehicle__seller-name a {
	text-decoration: none;
}

.ae-vehicle__seller-name a:hover,
.ae-vehicle__seller-name a:focus-visible {
	text-decoration: underline;
}

.ae-vehicle__seller-facts {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ae-vehicle__seller-fact {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	line-height: 22px;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__seller-fact .ae-icon {
	flex: none;
}

/* Contact ------------------------------------------------------------ */

.ae-vehicle__contact {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ae-vehicle__agent {
	display: flex;
	align-items: center;
	gap: 20px;
	/* Figma insets the content 13/17 from the stroke, which the border occupies. */
	padding: 12px 16px;
	border: 1px solid var(--ae-color-grey-300, #dbdbdb);
	border-radius: 10px;
}

.ae-vehicle__agent-identity {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
	font-size: 16px;
	line-height: 24px;
	color: var(--ae-color-grey-900, #222);
	overflow-wrap: break-word;
}

.ae-vehicle__agent-phone {
	font-weight: 700;
}

.ae-vehicle__agent-links {
	display: flex;
	flex: none;
	gap: 6px;
}

.ae-vehicle__agent-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 24px;
	background-color: var(--ae-color-blue-600, #0c8ce9);
}

.ae-vehicle__agent-link:hover,
.ae-vehicle__agent-link:focus-visible {
	background-color: var(--ae-color-blue-700, #0067b3);
}

.ae-vehicle__agent-link .ae-icon {
	flex: none;
	/* Figma Icon frame uses -scale-y-100 on the 26px glyph. */
	transform: scaleY(-1);
}

.ae-vehicle__save {
	display: flex;
	align-items: center;
	width: 100%;
	/* As the agent box: Figma's 17 is measured from the stroke. */
	padding: 16px;
	border: 1px solid var(--ae-color-grey-300, #dbdbdb);
	border-radius: 10px;
	background: none;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.ae-vehicle__save-icon {
	flex: none;
	margin-right: 16px;
}

.ae-vehicle__save-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__save-title {
	font-size: 16px;
	line-height: 24px;
	font-weight: 700;
}

.ae-vehicle__save-count {
	font-size: 12px;
	line-height: 18px;
}

/* -------------------------------------------------------------------------
 * Loan calculator
 * ---------------------------------------------------------------------- */

.ae-vehicle__loan-heading {
	margin: 0;
	font-size: 22px;
	line-height: 30px;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__loan-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.ae-vehicle__loan-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
}

.ae-vehicle__loan-label {
	font-size: 14px;
	line-height: 21px;
	font-weight: 600;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__loan-input {
	width: 100%;
	margin: 0;
	padding: 8px 12px;
	border: 0.6px solid var(--ae-color-grey-400, #c7c7c7);
	border-radius: 2px;
	background-color: var(--ae-color-grey-100, #f8f8f8);
	font-family: inherit;
	font-size: 18px;
	line-height: 28px;
	font-weight: 400;
	color: var(--ae-color-grey-600, #676767);
	-webkit-appearance: none;
	appearance: none;
}

.ae-vehicle__loan-input:focus {
	outline: none;
	border-color: var(--ae-color-blue-600, #0c8ce9);
}

/* Figma puts a 28px caret 12px in from the right of the period control. */
select.ae-vehicle__loan-input {
	padding-right: 46px;
	background-image: url("../images/icon-caret-down.svg");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 28px 28px;
}

.ae-vehicle__upfront {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 15px 16px 20px;
	border-radius: 10px;
	background-color: var(--ae-color-red-050, #fbebeb);
}

.ae-vehicle__upfront-heading {
	margin: 0;
	font-size: 16px;
	line-height: 19.2px;
	font-weight: 600;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__upfront-row {
	display: flex;
	align-items: center;
	margin: 0;
	color: var(--ae-color-grey-900, #222);
}

.ae-vehicle__upfront-row .ae-icon {
	flex: none;
	margin-right: 8px;
}

.ae-vehicle__upfront-label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14px;
	line-height: 21px;
	font-weight: 400;
}

.ae-vehicle__upfront-value {
	flex: none;
	font-size: 16px;
	line-height: 24px;
	font-weight: 700;
	text-align: right;
}

.ae-vehicle__upfront-row--total {
	margin-top: 5px;
	padding-top: 11px;
	border-top: 1px solid var(--ae-color-grey-400, #c7c7c7);
}

/* -------------------------------------------------------------------------
 * Promo strip
 * ---------------------------------------------------------------------- */

.ae-vehicle__promo,
.ae-vehicle__promo-link {
	display: block;
	width: 100%;
}

.ae-vehicle__promo-image {
	width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------------
 * Tablet — no Figma frame. The gallery stops bleeding and takes the desktop
 * frame's proportion, radius and overlaid control; the spec panels pair up
 * rather than stretching to the full width of the column.
 * ---------------------------------------------------------------------- */

@media (min-width: 768px) {

	.ae-vehicle-search {
		padding-inline: 60px;
	}

	.ae-vehicle-search__icon {
		display: block;
	}

	.ae-vehicle-search__form {
		padding-left: 24px;
		background-color: var(--ae-color-white, #fff);
	}

	.ae-vehicle-search__submit {
		padding: 12px 24px;
		border-radius: 200px;
		background-color: var(--ae-color-blue-600, #0c8ce9);
	}

	.ae-vehicle-search__submit:hover,
	.ae-vehicle-search__submit:focus-visible {
		background-color: var(--ae-color-blue-700, #0067b3);
	}

	.ae-vehicle-search__submit-text {
		display: block;
		font-size: 18px;
		line-height: 18px;
		font-weight: 600;
		text-transform: capitalize;
		color: var(--ae-color-white, #fff);
	}

	.ae-vehicle-search__submit-icon {
		display: none;
	}

	.ae-vehicle__body {
		padding-block: 40px;
	}

	.ae-vehicle__gallery {
		margin-inline: 0;
	}

	.ae-vehicle__gallery-frame {
		/* Figma desktop: 780 × 400, radius 20. */
		aspect-ratio: 780 / 400;
		border-radius: 20px;
	}

	.ae-vehicle__gallery-actions {
		position: absolute;
		right: 0;
		bottom: 0;
		padding: 20px;
		background: none;
	}

	.ae-vehicle__head {
		margin-top: 24px;
	}

	.ae-vehicle__specs {
		display: flex;
		flex-direction: row;
		order: 4;
		gap: 12px;
		margin-top: 10px;
	}

	.ae-vehicle__spec--1,
	.ae-vehicle__spec--2 {
		margin-top: 0;
	}
}

/* -------------------------------------------------------------------------
 * Desktop — the two-column frame.
 * ---------------------------------------------------------------------- */

@media (min-width: 1025px) {

	.ae-vehicle-search {
		/* Figma: 120px of 1440. */
		padding-inline: 8.3333%;
	}

	.ae-vehicle-search__form {
		/* Figma: an 800px pill in the 1200px content box. */
		max-width: 66.6667%;
	}

	.ae-vehicle__body {
		padding-block: 80px;
	}

	/*
	 * Two independent columns rather than shared rows. Sharing them would let
	 * the taller sidebar stretch the detail column's rows and open a gap under
	 * the title; the two only have to start level, not line up row by row.
	 */
	.ae-vehicle__layout {
		/* Figma: 780 and 380 of the 1200 content box, 40 apart. */
		grid-template-columns: minmax(0, 780fr) minmax(0, 380fr);
		column-gap: 40px;
	}

	.ae-vehicle__main,
	.ae-vehicle__aside {
		display: flex;
		flex-direction: column;
		gap: 24px;
		min-width: 0;
	}

	.ae-vehicle__gallery,
	.ae-vehicle__head,
	.ae-vehicle__specs,
	.ae-vehicle__notes,
	.ae-vehicle__card--price,
	.ae-vehicle__card--loan {
		margin-top: 0;
	}

	.ae-vehicle__head {
		grid-template-areas: "main stats";
		align-items: start;
		row-gap: 0;
	}

	.ae-vehicle__head-main {
		display: flex;
		grid-area: main;
		flex-direction: column;
		gap: 8px;
		min-width: 0;
	}

	.ae-vehicle__card {
		padding: 24px;
	}
}

/* -------------------------------------------------------------------------
 * Auth modal — save listing (guests)
 * ---------------------------------------------------------------------- */

.ae-auth-modal {
	width: calc(100% - 32px);
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: var(--ae-color-white, #fff);
	box-shadow: var(--ae-shadow-basic, 5px 5px 20px 0 rgba(0, 0, 0, 0.1));
	color: var(--ae-color-grey-900, #222);
	overflow: hidden;
}

.ae-auth-modal::backdrop {
	background: rgba(34, 34, 34, 0.72);
}

.ae-auth-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 28px 20px 24px;
}

.ae-auth-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 200px;
	background: var(--ae-color-grey-050, #f5f5f5);
	font-size: 28px;
	line-height: 1;
	color: var(--ae-color-grey-900, #222);
	cursor: pointer;
}

.ae-auth-modal__close:hover,
.ae-auth-modal__close:focus-visible {
	background-color: var(--ae-color-blue-600, #0c8ce9);
	color: var(--ae-color-white, #fff);
}

.ae-auth-modal__intro {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-right: 36px;
}

.ae-auth-modal__title {
	margin: 0;
	font-size: 24px;
	line-height: 32px;
	font-weight: 700;
	color: var(--ae-color-grey-900, #222);
}

.ae-auth-modal__text {
	margin: 0;
	font-size: 16px;
	line-height: 24px;
	font-weight: 400;
	color: var(--ae-color-grey-600, #676767);
}

.ae-auth-modal__tabs {
	display: flex;
	gap: 8px;
	padding: 4px;
	border-radius: 200px;
	background: var(--ae-color-grey-050, #f5f5f5);
}

.ae-auth-modal__tab {
	flex: 1 1 0;
	padding: 12px 16px;
	border: 0;
	border-radius: 200px;
	background: transparent;
	font-size: 16px;
	line-height: 20px;
	font-weight: 600;
	color: var(--ae-color-grey-800, #404040);
	cursor: pointer;
}

.ae-auth-modal__tab.is-active {
	background: var(--ae-color-white, #fff);
	color: var(--ae-color-blue-600, #0c8ce9);
	box-shadow: var(--ae-shadow-card, 0 1px 4px 0 rgba(2, 2, 2, 0.1));
}

.ae-auth-modal__error {
	margin: 0;
	padding: 12px 14px;
	border-radius: 8px;
	background: rgba(220, 38, 38, 0.08);
	font-size: 14px;
	line-height: 20px;
	color: #b42318;
}

.ae-auth-modal__form-panel[hidden] {
	display: none;
}

.ae-auth-modal__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ae-auth-modal__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ae-auth-modal__label {
	font-size: 14px;
	line-height: 18px;
	font-weight: 600;
	color: var(--ae-color-grey-800, #404040);
}

.ae-auth-modal__input {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--ae-color-grey-400, #c7c7c7);
	border-radius: 8px;
	background: var(--ae-color-white, #fff);
	font-size: 16px;
	line-height: 24px;
	color: var(--ae-color-grey-900, #222);
}

.ae-auth-modal__input:focus {
	outline: 2px solid var(--ae-color-blue-600, #0c8ce9);
	outline-offset: 1px;
}

.ae-auth-modal__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 16px 24px;
	border: 0;
	border-radius: 200px;
	background-color: var(--ae-color-blue-600, #0c8ce9);
	font-size: 16px;
	line-height: 20px;
	font-weight: 600;
	color: var(--ae-color-white, #fff);
	cursor: pointer;
}

.ae-auth-modal__submit:hover,
.ae-auth-modal__submit:focus-visible {
	background-color: var(--ae-color-blue-300, #7fc9ff);
	color: var(--ae-color-black, #000);
}

.ae-auth-modal__submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

@media (min-width: 768px) {
	.ae-auth-modal {
		width: 28%;
		min-width: 420px;
		max-width: 480px;
	}

	.ae-auth-modal__panel {
		padding: 32px;
	}
}
