/*
 * Detailseite eines Fahrzeugs – templates/single-vehicle.php
 * Farben wie die Übersicht; Schriften kommen vom Theme.
 * Knöpfe setzen alle Zustände selbst, weil Hello Elementor (reset.css)
 * Buttons bei :hover/:focus magenta färbt und nach uns lädt.
 */

.rft-vehicle {
	--rft-green: #009036;
	--rft-green-dark: #007a2e;
	--rft-orange: #ee7f01;
	--rft-orange-dark: #d16f00;
	--rft-text: #171717;
	--rft-muted: #595959;
	--rft-line: #dedede;
	--rft-panel: #f4f4f4;
	--rft-radius: 3px;
	/* Hintergründe wie auf den übrigen Seiten der Website */
	--rft-band-light: #a4a4a4;
	--rft-band-dark: #666666;
	--rft-green-on-dark: #7fdc9f;

	margin: 0;
	padding: 0;
	color: var(--rft-text);
}

/* Hello Elementor begrenzt .site-main auf 1140 px; die Bänder gehen über die volle Breite */
body.single-mobile-api-vehicle .site-main.rft-vehicle-page {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.rft-vehicle *,
.rft-vehicle *::before,
.rft-vehicle *::after {
	box-sizing: border-box;
}

.rft-vehicle [hidden] {
	display: none !important;
}

.rft-vehicle .rft-icon {
	flex: none;
	vertical-align: middle;
}

html.rft-no-scroll {
	overflow: hidden;
}

/* Kopf */

.rft-vehicle__back {
	margin: 0 0 16px;
	font-size: 14px;
}

.rft-vehicle .rft-vehicle__back a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--rft-text);
	font-weight: 700;
	text-decoration: none;
}

.rft-vehicle .rft-vehicle__back a:hover {
	color: var(--rft-text);
	text-decoration: underline;
}

.rft-vehicle__head {
	margin-bottom: 20px;
}

.rft-vehicle__meta {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--rft-text);
}

.rft-vehicle .rft-vehicle__title {
	margin: 0 0 12px;
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-style: var(--e-global-typography-primary-font-style, normal);
	font-weight: var(--e-global-typography-primary-font-weight, 600);
	font-size: clamp(24px, 3vw, 34px);
	line-height: 1.2;
	color: var(--rft-green); /* wie die Überschriften der übrigen Seiten */
}

.rft-vehicle__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rft-vehicle__badges li {
	margin: 0;
	padding: 4px 10px;
	border: 1px solid var(--rft-line);
	border-radius: var(--rft-radius);
	background: #ffffff;
	font-size: 13px;
	color: var(--rft-muted);
}

.rft-vehicle__badges li.is-rent {
	border-color: var(--rft-orange);
	color: var(--rft-orange-dark);
	font-weight: 700;
}

/* Bänder: hell- und dunkelgrau im Wechsel, Inhalt mittig mit max. 1240 px */

.rft-band {
	padding: 48px 20px;
}

.rft-band--intro {
	padding-top: 28px;
}

.rft-band__inner {
	max-width: 1240px;
	margin: 0 auto;
}

.rft-band--light {
	background: var(--rft-band-light);
}

.rft-band--dark {
	background: var(--rft-band-dark);
	color: #ffffff;
}

/* Reifenspuren wie auf den übrigen Seiten (Grafiken der Website, 17 % Deckkraft) */
.rft-band--tracks-1,
.rft-band--tracks-2 {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.rft-band--tracks-1::before,
.rft-band--tracks-2::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-repeat: no-repeat;
	opacity: 0.17;
	pointer-events: none;
}

.rft-band--tracks-1::before {
	background-image: url("images/reifenspur-1.png");
	background-position: left 40px;
	background-size: min(800px, 70%) auto;
}

.rft-band--tracks-2::before {
	background-image: url("images/reifenspur-2.png");
	background-position: left bottom;
	background-size: auto min(800px, 100%);
}

.rft-band .rft-section:last-child,
.rft-band .rft-card-box:last-child {
	margin-bottom: 0;
}

/* Weiße Karten auf hellgrauem Band (Beschreibung, Anfrage) */
.rft-vehicle .rft-card-box {
	margin: 0 0 24px;
	padding: 32px;
	border-radius: var(--rft-radius);
	background: #ffffff;
}

/* Raster: Galerie | Angebot. Mobil untereinander */

.rft-vehicle__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	grid-template-areas: "gallery aside";
	gap: 32px 40px;
	align-items: start;
}

.rft-vehicle__gallery {
	grid-area: gallery;
	min-width: 0;
}

.rft-vehicle__aside {
	grid-area: aside;
}

.rft-vehicle__content {
	grid-area: content;
	min-width: 0;
}

/* Galerie */

.rft-gallery__stage {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #1d1d1d;
	border-radius: var(--rft-radius);
	overflow: hidden;
}

.rft-vehicle .rft-gallery__open {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.rft-gallery__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.rft-gallery__zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	padding: 8px;
	border-radius: var(--rft-radius);
	background: rgba(0, 0, 0, 0.5);
	color: #ffffff;
	opacity: 0;
	transition: opacity 0.2s;
	pointer-events: none;
}

.rft-gallery__stage:hover .rft-gallery__zoom {
	opacity: 1;
}

.rft-gallery__counter {
	position: absolute;
	left: 12px;
	bottom: 12px;
	padding: 3px 10px;
	border-radius: var(--rft-radius);
	background: rgba(0, 0, 0, 0.6);
	color: #ffffff;
	font-size: 13px;
	pointer-events: none;
}

/* Pfeile auf dem großen Bild und im Vollbild */
.rft-vehicle .rft-gallery__nav,
.rft-vehicle .rft-gallery__nav:focus,
.rft-vehicle .rft-gallery__nav:active,
.rft-vehicle .rft-lightbox__btn,
.rft-vehicle .rft-lightbox__btn:focus,
.rft-vehicle .rft-lightbox__btn:active {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--rft-text);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.rft-vehicle .rft-gallery__nav:hover,
.rft-vehicle .rft-gallery__nav:focus-visible,
.rft-vehicle .rft-lightbox__btn:hover,
.rft-vehicle .rft-lightbox__btn:focus-visible {
	background: var(--rft-green);
	color: #ffffff;
}

.rft-vehicle .rft-gallery__nav:focus-visible,
.rft-vehicle .rft-lightbox__btn:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

.rft-vehicle .rft-gallery__nav {
	top: 50%;
	transform: translateY(-50%);
}

.rft-vehicle .rft-gallery__nav--prev {
	left: 12px;
}

.rft-vehicle .rft-gallery__nav--next {
	right: 12px;
}

.rft-vehicle .rft-icon {
	width: 22px;
	height: 22px;
}

/* Vorschaubilder */
.rft-gallery__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 4px;
}

.rft-vehicle .rft-gallery__thumb {
	flex: none;
	display: block;
	width: 92px;
	aspect-ratio: 4 / 3;
	border: 2px solid transparent;
	border-radius: var(--rft-radius);
	overflow: hidden;
	opacity: 0.65;
	transition: opacity 0.15s, border-color 0.15s;
}

.rft-vehicle .rft-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rft-vehicle .rft-gallery__thumb:hover,
.rft-vehicle .rft-gallery__thumb.is-active {
	opacity: 1;
}

.rft-vehicle .rft-gallery__thumb.is-active {
	border-color: var(--rft-green);
}

/* Vollbild */
.rft-vehicle .rft-lightbox {
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	max-height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(10, 10, 10, 0.96);
	color: #ffffff;
}

.rft-vehicle .rft-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.rft-lightbox::backdrop {
	background: rgba(10, 10, 10, 0.96);
}

.rft-lightbox__image {
	display: block;
	max-width: calc(100vw - 140px);
	max-height: calc(100dvh - 80px);
	width: auto;
	height: auto;
	object-fit: contain;
}

.rft-vehicle .rft-lightbox__close {
	top: 16px;
	right: 16px;
}

.rft-vehicle .rft-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

.rft-vehicle .rft-lightbox__nav--prev {
	left: 16px;
}

.rft-vehicle .rft-lightbox__nav--next {
	right: 16px;
}

.rft-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

/* Angebot (Preis und Anfrage) */

.rft-offer {
	padding: 24px;
	background: #ffffff;
	border-top: 4px solid var(--rft-green);
	border-radius: 0 0 var(--rft-radius) var(--rft-radius);
}

.rft-offer__price {
	margin: 0 0 16px;
	line-height: 1.3;
}

.rft-offer__price strong {
	display: block;
	font-size: 34px;
	line-height: 1.1;
	color: var(--rft-text);
}

.rft-offer__price span {
	display: block;
	font-size: 14px;
	color: var(--rft-muted);
}

.rft-offer__price .rft-offer__gross {
	margin-top: 2px;
	font-size: 13px;
}

.rft-offer__rent {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 16px;
	font-weight: 700;
	color: var(--rft-orange-dark);
}

.rft-offer__actions {
	display: grid;
	gap: 10px;
}

.rft-offer__note {
	margin: 16px 0 0;
	font-size: 13px;
	color: var(--rft-muted);
}

.rft-vehicle .rft-btn,
.rft-vehicle .rft-btn:focus,
.rft-vehicle .rft-btn:active {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	border: 2px solid var(--rft-orange);
	border-radius: var(--rft-radius);
	background: var(--rft-orange);
	color: #ffffff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.rft-vehicle .rft-btn:hover,
.rft-vehicle .rft-btn:focus-visible {
	background: var(--rft-orange-dark);
	border-color: var(--rft-orange-dark);
	color: #ffffff;
}

.rft-vehicle .rft-btn--secondary,
.rft-vehicle .rft-btn--secondary:focus,
.rft-vehicle .rft-btn--secondary:active {
	background: #ffffff;
	color: var(--rft-text);
}

.rft-vehicle .rft-btn--secondary:hover,
.rft-vehicle .rft-btn--secondary:focus-visible {
	background: var(--rft-orange);
	border-color: var(--rft-orange);
	color: #ffffff;
}

.rft-vehicle .rft-btn:focus-visible {
	outline: 2px solid var(--rft-green);
	outline-offset: 2px;
}

.rft-vehicle .rft-btn .rft-icon {
	width: 18px;
	height: 18px;
}

/* Inhalte */

.rft-section {
	margin: 0 0 40px;
}

.rft-vehicle .rft-section h2 {
	margin: 0 0 16px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--rft-green);
	/* Überschriftenschrift der Website (Elementor: globale Typografie "Primary") */
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-style: var(--e-global-typography-primary-font-style, normal);
	font-weight: var(--e-global-typography-primary-font-weight, 600);
	font-size: 28px;
	line-height: 1.3;
	color: var(--rft-green);
}

/* Auf Dunkelgrau: weiße Überschriften und Texte */
.rft-vehicle .rft-band--dark .rft-section h2 {
	color: var(--rft-orange);
	border-bottom-color: var(--rft-orange);
}

.rft-band--dark .rft-facts__item {
	background: rgba(255, 255, 255, 0.1);
}

.rft-band--dark .rft-facts dt,
.rft-band--dark .rft-specs dt {
	color: #e8e8e8;
}

.rft-band--dark .rft-facts dd,
.rft-band--dark .rft-specs dd,
.rft-band--dark .rft-features li {
	color: #ffffff;
}

.rft-vehicle .rft-band--dark .rft-features .rft-icon {
	color: var(--rft-green-on-dark);
}

.rft-band--dark .rft-specs__row {
	border-bottom-color: rgba(255, 255, 255, 0.25);
}

.rft-vehicle .rft-band--dark .rft-related__all a,
.rft-vehicle .rft-band--dark .rft-related__all a:hover {
	color: #ffffff;
}

/* Eckdaten als Kacheln */
.rft-facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 12px;
	margin: 0;
}

.rft-facts__item {
	padding: 14px 16px;
	background: var(--rft-panel);
	border-radius: var(--rft-radius);
}

.rft-facts dt {
	margin: 0 0 2px;
	font-size: 13px;
	color: var(--rft-muted);
}

.rft-facts dd {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

/* Ausstattung */
.rft-highlights {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.rft-highlights li {
	margin: 0;
	padding: 6px 12px;
	border-radius: var(--rft-radius);
	background: var(--rft-green);
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
}

.rft-features {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rft-features li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.rft-vehicle .rft-features .rft-icon {
	width: 18px;
	height: 18px;
	color: var(--rft-green);
}

/* Beschreibung (HTML aus mobile.de) */
.rft-description {
	line-height: 1.6;
}

.rft-description ul {
	margin: 0 0 16px;
	padding-left: 20px;
}

.rft-description li {
	margin: 0 0 4px;
}

.rft-description p {
	margin: 0 0 12px;
}

.rft-description hr {
	margin: 16px 0;
	border: 0;
	border-top: 1px solid var(--rft-line);
}

.rft-description .mobile-api-ad-number,
.rft-description__ad {
	font-size: 13px;
	color: var(--rft-muted);
}

/* Beschreibung gekürzt: drei Zeilen, Rest per "Weiterlesen" (single.js) */
.rft-description__body:not(.is-collapsed) {
	max-height: none !important;
}

.rft-description__body.is-collapsed {
	position: relative;
	max-height: 4.8em; /* 3 Zeilen; single.js setzt die genaue Höhe */
	overflow: hidden;
}

.rft-description__body.is-collapsed::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 1.6em;
	background: linear-gradient(rgba(255, 255, 255, 0), #ffffff);
	pointer-events: none;
}

.rft-vehicle .rft-description__toggle,
.rft-vehicle .rft-description__toggle:focus,
.rft-vehicle .rft-description__toggle:active,
.rft-vehicle .rft-description__toggle:hover {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0 12px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rft-green);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	box-shadow: none;
}

.rft-vehicle .rft-description__toggle:hover {
	color: var(--rft-green-dark);
	text-decoration: underline;
}

.rft-vehicle .rft-description__toggle:focus-visible {
	outline: 2px solid var(--rft-green);
	outline-offset: 2px;
}

.rft-vehicle .rft-description__toggle::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.15s;
}

.rft-vehicle .rft-description__toggle[aria-expanded="true"]::after {
	margin-top: 4px;
	transform: rotate(-135deg);
}

/* Anfrageformular (Elementor-Vorlage aus den Einstellungen) */
.rft-inquiry {
	scroll-margin-top: 120px;
}

.rft-inquiry.is-highlight {
	animation: rft-highlight 1.2s ease-out;
}

@keyframes rft-highlight {
	from { box-shadow: 0 0 0 6px rgba(0, 144, 54, 0.25); }
	to { box-shadow: 0 0 0 6px rgba(0, 144, 54, 0); }
}

/* Ähnliche Fahrzeuge (Karten aus listing.css) */
.rft-vehicle .rft-related {
	margin: 0 auto; /* mittig wie .rft-band__inner */
}

.rft-vehicle .rft-related h2 {
	margin-bottom: 24px;
}

.rft-vehicle .rft-related__all {
	margin: 24px 0 0;
	text-align: center;
}

.rft-vehicle .rft-related__all a {
	color: var(--rft-green);
	font-weight: 700;
	text-decoration: none;
}

.rft-vehicle .rft-related__all a:hover {
	color: var(--rft-green-dark);
	text-decoration: underline;
}

/* Technische Daten */
.rft-specs {
	margin: 0;
	columns: 2;
	column-gap: 40px;
}

.rft-specs__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rft-line);
	break-inside: avoid;
}

.rft-specs dt {
	margin: 0;
	color: var(--rft-muted);
}

.rft-specs dd {
	margin: 0;
	font-weight: 700;
	text-align: right;
}

.rft-vehicle__source {
	margin: 0;
	font-size: 13px;
	color: var(--rft-text);
}

.rft-vehicle .rft-vehicle__source a {
	color: var(--rft-text);
	text-decoration: underline;
}

/* Tablet und Handy */

@media (max-width: 1000px) {
	.rft-vehicle__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"gallery"
			"aside";
		gap: 24px;
	}
}

@media (max-width: 700px) {
	.rft-band {
		padding: 32px 16px;
	}

	.rft-band--intro {
		padding-top: 16px;
	}

	.rft-vehicle .rft-card-box {
		padding: 20px 16px;
	}

	.rft-vehicle .rft-gallery__nav,
	.rft-vehicle .rft-gallery__nav:focus,
	.rft-vehicle .rft-gallery__nav:active {
		width: 40px;
		height: 40px;
	}

	.rft-vehicle .rft-gallery__thumb {
		width: 72px;
	}

	.rft-lightbox__image {
		max-width: 100vw;
	}

	.rft-vehicle .rft-lightbox__nav {
		top: auto;
		bottom: 12px;
		transform: none;
	}

	.rft-facts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rft-specs {
		columns: 1;
	}
}
