/* ==========================================================================
   Vehicle detail — breadcrumb, gallery, specs, sticky mobile CTA bar.
   ========================================================================== */

.pm-crumbs {
	border-bottom: 1px solid var(--border);
	font-size: 0.8125rem;
	color: var(--text-muted);
}

.pm-crumbs .pm-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding-block: 0.875rem;
}

.pm-crumbs a {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	transition: color 0.2s var(--ease);
}

.pm-crumbs a:hover {
	color: var(--accent-text);
}

.pm-crumbs__current {
	color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Detail layout
   -------------------------------------------------------------------------- */

.pm-detail {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	padding-block: 1.75rem 3rem;
}

@media (min-width: 1024px) {
	.pm-detail {
		display: grid;
		grid-template-columns: 7fr 5fr;
		grid-template-areas:
			'gallery aside'
			'body    aside';
		align-items: start;
		column-gap: 2.5rem;
		row-gap: 2rem;
		padding-block: 2.5rem 4rem;
	}

	.pm-detail__gallery {
		grid-area: gallery;
	}

	.pm-detail__aside {
		grid-area: aside;
		position: sticky;
		top: calc(var(--header-h) + 1.5rem);
	}

	.pm-detail__body {
		grid-area: body;
	}
}

.pm-detail__headline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.pm-detail__price {
	margin-top: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border);
}

.pm-detail__price-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-secondary);
}

.pm-detail__price-value {
	margin-top: 0.25rem;
	font-family: var(--font-display);
	/* The full figure, not the compact one — this is the number a buyer
	   quotes back to the dealership. */
	font-size: clamp(1.875rem, 7vw, 2.5rem);
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--accent-text);
}

.pm-detail__ctas {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

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

.pm-gallery__stage {
	position: relative;
	aspect-ratio: 16 / 10;
	border-radius: var(--radius);
}

.pm-gallery__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.3s var(--ease);
}

.pm-gallery__slide.is-current {
	opacity: 1;
	z-index: 1;
}

/* Without the script every photo stacks in the document and the thumbnail
   anchors jump between them, so they must all be visible and in flow. */
html:not(.pm-js) .pm-gallery__slide {
	position: relative;
	opacity: 1;
	margin-bottom: 0.5rem;
}

html:not(.pm-js) .pm-gallery__stage {
	aspect-ratio: auto;
}

.pm-gallery__status {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 3;
	pointer-events: none;
}

.pm-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	transform: translateY(-50%);
	border-radius: 50%;
	background-color: rgba(10, 10, 11, 0.6);
	color: #fff;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color 0.2s var(--ease);
}

.pm-gallery__arrow:hover {
	background-color: rgba(10, 10, 11, 0.85);
}

.pm-gallery__arrow--prev {
	left: 0.5rem;
}

.pm-gallery__arrow--next {
	right: 0.5rem;
}

.pm-gallery__expand {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 32px;
	padding-inline: 0.625rem;
	border-radius: 999px;
	background-color: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 500;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.pm-gallery__thumbs {
	display: flex;
	gap: 0.75rem;
	margin-top: 1rem;
	overflow-x: auto;
}

.pm-gallery__thumb {
	position: relative;
	flex: 0 0 auto;
	width: 84px;
	height: 60px;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	opacity: 0.6;
	transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease),
		transform 0.2s var(--ease);
}

.pm-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pm-gallery__thumb:hover {
	opacity: 1;
}

.pm-gallery__thumb.is-current {
	opacity: 1;
	border-color: var(--accent);
	transform: scale(1.02);
}

.pm-gallery__note {
	margin-top: 0.75rem;
	font-size: 0.75rem;
	color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.pm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background-color: rgba(0, 0, 0, 0.95);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.pm-lightbox[hidden] {
	display: none;
}

.pm-lightbox__img {
	max-width: 92vw;
	max-height: 86vh;
	object-fit: contain;
}

/*
 * Always dark, independent of the site theme: these sit inside the
 * lightbox's own permanently-dark backdrop (rgba(0, 0, 0, 0.95) above),
 * over a photo, the same reasoning that keeps the whole gallery/lightbox
 * dark in light mode. var(--bg-elevated) would turn white here in light
 * mode and swallow the white icon.
 */
.pm-lightbox__close,
.pm-lightbox__arrow {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid #1e1e24;
	background-color: #16161a;
	color: #fff;
	transition: border-color 0.2s var(--ease);
}

.pm-lightbox__close:hover,
.pm-lightbox__arrow:hover {
	border-color: var(--accent);
}

.pm-lightbox__close {
	top: 1rem;
	right: 1rem;
}

.pm-lightbox__arrow--prev {
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
}

.pm-lightbox__arrow--next {
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
}

.pm-lightbox__count {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX(-50%);
	font-size: 0.8125rem;
	color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Specifications
   -------------------------------------------------------------------------- */

.pm-specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
}

.pm-specs__item {
	padding: 0.875rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background-color: var(--bg-elevated);
}

.pm-specs__item dt {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-secondary);
}

.pm-specs__item dt .pm-icon {
	color: var(--accent-text);
}

/* No text-transform here. `capitalize` rendered "78,000 km" as "78,000 Km";
   the select labels already arrive correctly cased from the field registry. */
.pm-specs__item dd {
	margin: 0.5rem 0 0;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--text-primary);
}

@media (min-width: 640px) {
	.pm-specs {
		gap: 1rem;
	}

	.pm-specs__item {
		padding: 1rem;
	}
}

/* --------------------------------------------------------------------------
   Description and trust strip
   -------------------------------------------------------------------------- */

.pm-detail__about {
	margin-top: 1.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}

/* .pm-prose itself moved to style.css — it's used on the About and Guide
   Pages too, neither of which loads this stylesheet. */

.pm-trust {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin: 1.5rem 0 0;
	padding: 1.5rem 0 0;
	border-top: 1px solid var(--border);
	list-style: none;
}

.pm-trust li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-secondary);
}

.pm-trust .pm-icon {
	color: var(--accent-text);
}

@media (min-width: 640px) {
	.pm-trust {
		flex-direction: row;
		justify-content: space-between;
	}
}

/* --------------------------------------------------------------------------
   Sticky mobile CTA bar
   -------------------------------------------------------------------------- */

.pm-sticky-bar {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 46;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: 64px;
	padding-inline: 1rem;
	/* Clears the home indicator on an iPhone. */
	padding-bottom: env(safe-area-inset-bottom);
	border-top: 1px solid var(--border);
	background-color: rgba(17, 17, 20, 0.92);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transform: translateY(100%);
	transition: transform 0.3s var(--ease);
}

[data-theme='light'] .pm-sticky-bar {
	background-color: rgba(255, 255, 255, 0.92);
}

.pm-sticky-bar.is-visible {
	transform: translateY(0);
}

.pm-sticky-bar[hidden] {
	display: none;
}

.pm-sticky-bar__price {
	flex: 1;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--accent-text);
}

.pm-sticky-bar__call,
.pm-sticky-bar__wa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	height: 40px;
	padding-inline: 0.875rem;
	border-radius: var(--radius-sm);
	font-family: var(--font-display);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.pm-sticky-bar__call {
	border: 1px solid var(--accent);
	color: var(--accent-text);
}

.pm-sticky-bar__wa {
	background-color: var(--whatsapp);
	/* Same contrast fix as .pm-btn--whatsapp in style.css. */
	color: #0a0a0b;
}

@media (min-width: 1024px) {
	.pm-sticky-bar {
		display: none;
	}
}

.pm-similar {
	margin-top: 2rem;
}
