/*
 * Optimum Transfert : flotte de véhicules.
 * Structure uniquement (grilles, positions, défilement). Couleurs, typographies,
 * tailles et espacements viennent des contrôles Elementor des widgets.
 */

/* ---------- Grille de véhicules ---------- */

.optr-vg {
	display: grid;
}

.optr-vg__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: translate 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease, box-shadow 0.35s ease, outline-color 0.2s ease;
}

/* Carte entierement cliquable : le lien du nom couvre la carte ; photos et boutons restent au-dessus */
.optr-vg__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
}

.optr-vg .optr-vg__title a:focus-visible {
	outline: none;
}
.optr-vg__media {
	position: relative;
	z-index: 2;
	overflow: hidden;
	isolation: isolate;
}

/* Pastille passagers posee sur la photo */
.optr-vg__badge {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	line-height: 1.2;
	pointer-events: none;
}

.optr-vg__badge-icon {
	display: inline-flex;
	width: 0.95em;
	height: 0.95em;
}

.optr-vg__badge-icon svg {
	width: 100%;
	height: 100%;
}

.optr-vg__track {
	display: flex;
	height: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.optr-vg__track::-webkit-scrollbar {
	display: none;
}

.optr-vg__slide {
	flex: 0 0 100%;
	height: 100%;
	overflow: hidden;
	scroll-snap-align: start;
}

.optr-vg__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Neutralise le fond et la bordure des boutons du thème Hello (#c36 au survol) */
.optr-vg .optr-vg__arrow,
.optr-vg .optr-vg__arrow:hover,
.optr-vg .optr-vg__arrow:focus {
	border: 0;
	background-color: transparent;
}

/* Les flèches restent visibles : seule la couleur change au survol de la flèche */
.optr-vg__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
	transition: color 0.2s ease, fill 0.2s ease;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.optr-vg__arrow svg {
	width: 1em;
	height: 1em;
}

.optr-vg__arrow--prev {
	left: 8px;
}

.optr-vg__arrow--next {
	right: 8px;
}

.optr-vg__arrow[disabled] {
	visibility: hidden;
}

.optr-vg__dots {
	position: absolute;
	left: 50%;
	bottom: 12px;
	z-index: 2;
	display: flex;
	gap: 6px;
	transform: translateX(-50%);
	pointer-events: none;
}

.optr-vg__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.optr-vg__dot.is-active {
	transform: scale(1.25);
}

.optr-vg__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
}

.optr-vg__title,
.optr-vg__meta,
.optr-vg__excerpt,
.optr-vg__equipment {
	margin-top: 0;
}

.optr-vg__title a {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
	text-decoration: none;
}

/* Le kit applique sa typo de lien au survol : le titre ne doit pas changer */
.optr-vg .optr-vg__title a:hover,
.optr-vg .optr-vg__title a:focus {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

.optr-vg__meta,
.optr-vs__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
}

.optr-vg__meta-item,
.optr-vs__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.optr-vg__meta-icon,
.optr-vg__equipment-icon,
.optr-vs__meta-icon,
.optr-vs__card-note-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.optr-vg__meta-icon svg,
.optr-vg__equipment-icon svg,
.optr-vs__meta-icon svg,
.optr-vs__card-note-icon svg {
	width: 100%;
	height: 100%;
}

.optr-vg__equipment {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	padding: 0;
	list-style: none;
}

.optr-vg__equipment-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Zone des boutons en bas de carte, au-dessus du lien qui couvre la carte */
.optr-vg__actions .optr-vg__button {
	margin-top: 0;
}

.optr-vg__actions {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: auto;
}

.optr-vg__book {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: color 0.3s ease, background-color 0.3s ease;
}

.optr-vg__button-icon {
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.optr-vg__card:hover .optr-vg__button-icon,
.optr-vg__card:focus-within .optr-vg__button-icon {
	transform: translateX(5px);
}

/* Texte du lien souligne progressivement au survol de la carte */
.optr-vg__button > span:first-child {
	padding-bottom: 2px;
	background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1px;
	transition: background-size 0.35s ease;
}

.optr-vg__card:hover .optr-vg__button > span:first-child,
.optr-vg__card:focus-within .optr-vg__button > span:first-child {
	background-size: 100% 1px;
}

.optr-vg__button,
.optr-vs__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: auto;
	text-decoration: none;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.optr-vg__button svg,
.optr-vs__button svg,
.optr-vs__back svg {
	width: 0.9em;
	height: 0.9em;
}

/* ---------- Fiche véhicule ---------- */

.optr-vs__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	transition: color 0.2s ease;
}

.optr-vs__gallery-wrap {
	position: relative;
}

.optr-vs__gallery {
	display: grid;
	overflow: hidden;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: repeat(2, minmax(0, 1fr));
}

.optr-vs__photo {
	position: relative;
	display: block;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.optr-vs__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.optr-vs__photo:hover img {
	filter: brightness(0.9);
}

.optr-vs__photo:first-child {
	grid-row: 1 / span 2;
}

.optr-vs__photo:nth-child(n + 6) {
	display: none;
}

.optr-vs__gallery--1 {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}

.optr-vs__gallery--2 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr;
}

.optr-vs__gallery--2 .optr-vs__photo:first-child,
.optr-vs__gallery--1 .optr-vs__photo:first-child {
	grid-row: auto;
}

.optr-vs__gallery--3 {
	grid-template-columns: 2fr 1fr;
}

.optr-vs__gallery--4 .optr-vs__photo:nth-child(4) {
	grid-column: 2 / span 2;
}

.optr-vs__all-photos {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.optr-vs__all-photos svg {
	width: 14px;
	height: 14px;
}

.optr-vs__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--optr-aside-width, 380px);
	align-items: start;
}

.optr-vs__title,
.optr-vs__meta,
.optr-vs__heading,
.optr-vs__card-title,
.optr-vs__card-text {
	margin-top: 0;
}

.optr-vs__section {
	border-top: 1px solid;
}

.optr-vs__description > :last-child {
	margin-bottom: 0;
}

.optr-vs__equipment {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.optr-vs__equipment-item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.optr-vs__equipment-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
}

.optr-vs__equipment-icon svg {
	width: 1em;
	height: 1em;
}

.optr-vs__aside {
	position: sticky;
}

/* Encadré de réservation : même carte que le bloc prix (dégradé, vagues, texte centré) */
.optr-vs__card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow: hidden;
	text-align: center;
}

.optr-vs__card > :not(.optr-vs__card-waves) {
	position: relative;
	z-index: 1;
}

.optr-vs__card-waves {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 100%;
	background-position: center bottom;
	background-repeat: no-repeat;
	background-size: 100% auto;
	pointer-events: none;
}

.optr-vs__card-text,
.optr-vs__card-note {
	opacity: 0.85;
}

.optr-vs__card-note {
	justify-content: center;
}

.optr-vs__card-note > span:last-child {
	text-align: center;
}

.optr-vs__button {
	width: 100%;
	border: 0;
}

.optr-vs__card-note {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 16px 0 0;
}

@media (max-width: 1024px) {
	.optr-vs__body {
		grid-template-columns: minmax(0, 1fr);
	}

	.optr-vs__aside {
		position: static;
	}
}

@media (max-width: 767px) {
	/* Galerie en bandeau défilant sur mobile */
	.optr-vs__gallery {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.optr-vs__gallery::-webkit-scrollbar {
		display: none;
	}

	.optr-vs__photo,
	.optr-vs__photo:nth-child(n + 6) {
		display: block;
		flex: 0 0 100%;
		scroll-snap-align: start;
	}

	.optr-vs__all-photos {
		right: 12px;
		bottom: 12px;
		padding: 8px 12px;
	}

	.optr-vg__arrow {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.optr-vg__track {
		scroll-behavior: auto;
	}

	.optr-vg__slide img,
	.optr-vs__photo img,
	.optr-vg__card,
	.optr-vg__button-icon,
	.optr-vg__button > span:first-child {
		transition: none;
	}

	.optr-vg .optr-vg__card:hover,
	.optr-vg .optr-vg__card:focus-within {
		translate: none;
	}
}

/* ---------- Bouton « Réserver » fixé en bas de l'écran (mobile) ---------- */

.optr-vs__sticky {
	display: none;
}

@media (max-width: 767px) {
	.optr-vs__sticky {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 9980;
		display: block;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		pointer-events: none;
		opacity: 0;
		transform: translateY(100%);
		transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	/* Affichée après 10 % de défilement (optr-vehicles.js) */
	.optr-vs__sticky.is-visible {
		pointer-events: auto;
		opacity: 1;
		transform: none;
	}

	.optr-vs__sticky-button {
		box-shadow: 0 10px 30px -10px rgba(0, 32, 72, 0.55);
	}

	/* Le bas de page reste lisible au-dessus de la barre */
	body:has(.optr-vs__sticky) {
		padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
	}

	/* Bulle WhatsApp et bandeau de cookies au-dessus de la barre */
	body:has(.optr-vs__sticky.is-visible) .optr-wa {
		bottom: calc(var(--optr-wa-y, 24px) + 78px + env(safe-area-inset-bottom, 0px));
	}

	body:has(.optr-vs__sticky.is-visible) .optr-consent {
		bottom: calc(90px + env(safe-area-inset-bottom, 0px));
	}

	.optr-wa {
		transition: bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.optr-vs__sticky,
	.optr-wa {
		transition: none;
	}
}

/* ---------- Bouton « Demander un devis » : verre et bordure lumineuse (comme le WhatsApp du hero) ---------- */

@property --optr-vs-angle {
	syntax: "<angle>";
	inherits: false;
	initial-value: 135deg;
}

.optr-vs__quote {
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-top: 12px;
	border: 0;
	background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	text-decoration: none;
	transition: color 0.3s ease, background-color 0.3s ease;
}

.optr-vs__quote::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	padding: 1.5px;
	border-radius: inherit;
	background: conic-gradient(from var(--optr-vs-angle), rgba(255, 255, 255, 0.15) 0deg, rgba(255, 255, 255, 0.95) 50deg, rgba(255, 255, 255, 0.15) 110deg, rgba(255, 255, 255, 0.15) 180deg, rgba(255, 255, 255, 0.95) 230deg, rgba(255, 255, 255, 0.15) 290deg);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	animation: optr-vs-spin 4s linear infinite;
	pointer-events: none;
}

.optr-vs__quote svg {
	width: 0.95em;
	height: 0.95em;
}

@keyframes optr-vs-spin {
	to {
		--optr-vs-angle: 495deg;
	}
}

@media (prefers-reduced-motion: reduce) {
	.optr-vs__quote::before {
		animation: none;
	}
}
