/**
 * Virtual Eyewear Try-On - Frontend styles (white theme)
 * Tous les sélecteurs sont préfixés .vtry- pour éviter les collisions thème
 */

/* ===== Bouton déclencheur (sur la fiche produit) ===== */
.vtry-trigger-wrap {
	margin: 16px 0 0;
	clear: both;
	width: 100%;
	display: block;
	float: none !important;
	box-sizing: border-box;
	position: absolute;
    top: 109px;
    left: 230px;
}
.vtry-trigger {
display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 50%;
    padding: 4px 0px;
    background: white;
    color: #4e48bc;
    border: 1.5px solid #4e48bc;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
    font-family: inherit;
    box-sizing: border-box;
}
.vtry-trigger:hover {
	background: #E2E2E2;
	color: #4e48bc;
	border-color: #4e48bc;
}
.vtry-trigger__icon { flex-shrink: 0; }

/* ===== Modal ===== */
.vtry-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	opacity: 0;
	transition: opacity 0.25s ease;
	overscroll-behavior: none;
}
/* Hauteur dynamique : suit la zone réellement visible (barre d'adresse iOS rétractable),
   pour que la barre de contrôles du bas ne passe jamais sous l'UI du navigateur. */
@supports (height: 100dvh) {
	.vtry-modal { height: 100dvh; bottom: auto; }
}
.vtry-modal.is-open { display: flex; opacity: 1; }
/* Verrou de scroll : position fixe (le top est posé en JS = -scrollY) pour bloquer
   aussi le rubber-band de l'arrière-plan sur iOS. */
body.vtry-modal-open {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}

.vtry-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.vtry-modal__content {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	color: #1a1614;
	background-image:
		radial-gradient(circle at 20% 30%, rgba(78, 72, 188, 0.04), transparent 50%),
		radial-gradient(circle at 80% 70%, rgba(78, 72, 188, 0.025), transparent 50%);
	transform: translateY(20px);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.vtry-modal.is-open .vtry-modal__content { transform: translateY(0); }

/* ===== Header ===== */
.vtry-modal__header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 180px 18px 28px; /* padding-right pour laisser de la place au close flottant */
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
	background: #ffffff;
}
.vtry-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #1a1614;
}

/* Indicateur du modèle courant (nom de la lunette en cours d'essayage) */
.vtry-current-model {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	background: #f5f1ea;
	border: 1px solid rgba(78, 72, 188, 0.15);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	color: #4e48bc;
	letter-spacing: 0.04em;
	max-width: 240px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.vtry-current-model__label {
	overflow: hidden;
	text-overflow: ellipsis;
}
.vtry-modal__close {
	position: absolute;
	top: calc(16px + env(safe-area-inset-top, 0px));
	right: calc(16px + env(safe-area-inset-right, 0px));
	z-index: 10;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	color: #1a1614;
	width: auto;
	min-width: 48px;
	height: 48px;
	padding: 0 18px 0 14px;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: all 0.2s ease;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #1a1614;
}
.vtry-modal__close:hover,
.vtry-modal__close:focus-visible {
	background: #1a1614;
	border-color: #1a1614;
	color: #ffffff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
	outline: none;
}
.vtry-modal__close:active {
	transform: translateY(0);
}
.vtry-modal__close svg { flex-shrink: 0; }
.vtry-modal__close-label {
	white-space: nowrap;
}

.vtry-status {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	background: #fafafa;
	border-radius: 999px;
	font-size: 11px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #6b6863;
}
.vtry-status__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #b9b3aa;
	transition: background 0.3s, box-shadow 0.3s;
}
.vtry-status.is-ok .vtry-status__dot {
	background: #4caf50;
	box-shadow: 0 0 6px rgba(76, 175, 80, 0.5);
}
.vtry-status.is-err .vtry-status__dot { background: #d94545; }

/* ===== Body wrapper (stage + related sidebar) ===== */
.vtry-modal__body {
	flex: 1;
	display: flex;
	flex-direction: row;
	min-height: 0;
	overflow: hidden;
}

/* ===== Stage ===== */
.vtry-stage {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	padding: 24px;
}
.vtry-frame {
	position: relative;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
	background: #f5f5f5;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}
.vtry-frame video,
.vtry-frame canvas {
	display: block;
	transform: scaleX(-1);
}
.vtry-frame canvas {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
}
.vtry-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: #f5f5f5;
	color: #6b6863;
	font-style: italic;
	font-size: 15px;
	text-align: center;
	padding: 24px;
}
.vtry-placeholder.is-hidden { display: none; }

/* ===== Tuning panel ===== */
.vtry-tuning {
	background: transparent;
	border-top: none;
	flex-shrink: 0;
}
.vtry-tuning__summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: max-content;
	max-width: calc(100% - 32px);
	margin: 14px auto 12px;
	padding: 10px 22px;
	cursor: pointer;
	user-select: none;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffffff;
	background: #4e48bc;
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(78, 72, 188, 0.28);
	list-style: none;
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.vtry-tuning__summary::-webkit-details-marker { display: none; }
.vtry-tuning__summary::marker { display: none; }
.vtry-tuning__summary:hover {
	background: #3e3aa3;
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(78, 72, 188, 0.38);
	transform: translateY(-1px);
}
.vtry-tuning__summary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(78, 72, 188, 0.4);
}
.vtry-tuning__summary svg {
	transition: transform 0.25s ease;
}
.vtry-tuning[open] .vtry-tuning__summary svg {
	transform: rotate(180deg);
}
.vtry-tuning__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px 32px;
	padding: 4px 28px 22px;
}
.vtry-tuning__row {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.vtry-tuning__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.vtry-tuning__row label {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #6b6863;
}
.vtry-tuning__val {
	font-size: 13px;
	color: #1a1614;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

/* Slider styling cross-browser */
.vtry-tuning__row input[type="range"] {
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 999px;
	outline: none;
	cursor: pointer;
	margin: 0;
}
.vtry-tuning__row input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	background: #4e48bc;
	border-radius: 50%;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.vtry-tuning__row input[type="range"]::-webkit-slider-thumb:hover,
.vtry-tuning__row input[type="range"]:focus::-webkit-slider-thumb {
	transform: scale(1.15);
	box-shadow: 0 2px 6px rgba(78, 72, 188, 0.4);
}
.vtry-tuning__row input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #4e48bc;
	border-radius: 50%;
	cursor: pointer;
	border: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.vtry-tuning__row input[type="range"]::-moz-range-track {
	background: rgba(0, 0, 0, 0.08);
	height: 4px;
	border-radius: 999px;
}

/* ===== Controls ===== */
.vtry-controls {
	display: flex;
	gap: 10px;
	justify-content: center;
	padding: 18px 28px calc(24px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
	background: #fafafa;
}
.vtry-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #ffffff;
	color: #1a1614;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: all 0.2s ease;
	font-family: inherit;
}
.vtry-action:hover {
	border-color: #4e48bc;
	color: #4e48bc;
}
/* Variante discrète pour la capture photo (moins mise en avant) */
.vtry-action--ghost {
	background: transparent;
	color: #6b6b6b;
	border-color: rgba(0, 0, 0, 0.12);
}
.vtry-action--ghost:hover {
	background: #f0f0f0;
	border-color: rgba(0, 0, 0, 0.2);
	color: #1a1614;
}
.vtry-action--primary {
	background: #4e48bc;
	color: #ffffff;
	border-color: #4e48bc;
	text-decoration: none;
	margin-left: auto; /* pousse le bouton primaire à droite, capture reste à gauche */
}
.vtry-action--primary:hover {
	background: #3e3aa3;
	border-color: #3e3aa3;
	color: #ffffff;
}
.vtry-action--primary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(78, 72, 188, 0.3);
}
.vtry-action svg { flex-shrink: 0; }

/* ===== Toast de confirmation (enregistrement photo) ===== */
.vtry-toast {
	position: absolute;
	left: 50%;
	bottom: 92px;
	transform: translateX(-50%) translateY(8px);
	max-width: calc(100% - 48px);
	padding: 11px 18px;
	background: #1a1614;
	color: #ffffff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.01em;
	text-align: center;
	border-radius: 8px;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
	opacity: 0;
	pointer-events: none;
	z-index: 30;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.vtry-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ===== Indicateur de couleur (variation sélectionnée) ===== */
.vtry-color-indicator {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: #fafafa;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 999px;
	font-size: 12px;
	color: #1a1614;
	font-weight: 500;
	letter-spacing: 0.04em;
}
.vtry-color-indicator.is-hidden {
	display: none;
}
.vtry-color-indicator__swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
	flex-shrink: 0;
}
.vtry-color-indicator__label {
	white-space: nowrap;
}

/* ===== Sidebar "Autres modèles" (verticale, à GAUCHE en desktop) ===== */
.vtry-related {
	flex: 0 0 260px;
	order: -1; /* desktop row → passe AVANT le stage (à gauche). Reset en mobile. */
	border-right: 1px solid rgba(0, 0, 0, 0.08);
	background: #fdfcfa;
	padding: 16px 14px 14px;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.vtry-related[hidden] { display: none; }

/* ===== Sélecteur de couleurs (variations du produit courant) ===== */
.vtry-colors {
	flex-shrink: 0;
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.vtry-colors[hidden] { display: none; }
.vtry-colors__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}
.vtry-color-chip {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	border: 2px solid rgba(0, 0, 0, 0.12);
	background: #fff;
	cursor: pointer;
	padding: 2px;
	overflow: hidden;
	transition: all 0.16s ease;
	position: relative;
}

.vtry-color-chip img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 5px;
	display: block;
}
.vtry-color-chip:hover {
	border-color: rgba(78, 72, 188, 0.5);
	transform: scale(1.05);
	background: #b3b1d226!important;
}
.vtry-color-chip:focus-visible {
	outline: none;
	border-color: #4e48bc;
	box-shadow: 0 0 0 3px rgba(78, 72, 188, 0.2);
}
.vtry-color-chip.is-active {
	border-color: #4e48bc;
	box-shadow: 0 0 0 2px rgba(78, 72, 188, 0.25);
}
.vtry-color-chip.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	border-radius: 6px;
}
.vtry-related__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 12px;
	flex-shrink: 0;
}
.vtry-related__title {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #6b6863;
}
.vtry-related__view-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #4e48bc;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.15s ease;
}
.vtry-related__view-link:hover {
	color: #3e3aa3;
	text-decoration: underline;
}

/* Scroller vertical : liste qui scroll en colonne */
.vtry-related__scroller {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
	padding-right: 4px;
}
.vtry-related__scroller::-webkit-scrollbar { width: 6px; }
.vtry-related__scroller::-webkit-scrollbar-track { background: transparent; }
.vtry-related__scroller::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 999px;
}

/* Item en column : image pleine largeur au-dessus, nom dessous — adapté aux lunettes (objets larges) */
.vtry-related__item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	background: #ffffff;
	border: 1.5px solid rgba(0, 0, 0, 0.08);
	border-radius: 6px;
	padding: 10px;
	cursor: pointer;
	transition: all 0.18s ease;
	font-family: inherit;
	text-align: left;
	position: relative;
}
.vtry-related__item:hover {
	border-color: rgba(0, 0, 0, 0.22);
	background: #f5f5f5;
	transform: translateX(2px);
	box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.06);
}
.vtry-related__item:focus-visible {
	outline: none;
	border-color: #4e48bc;
	box-shadow: 0 0 0 3px rgba(78, 72, 188, 0.2);
}
.vtry-related__item.is-active {
	border-color: #4e48bc;
	background: #f5f3ff;
	box-shadow: 2px 2px 8px rgba(78, 72, 188, 0.15);
}
.vtry-related__item.is-loading {
	pointer-events: none;
}
.vtry-related__item.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	border-radius: 6px;
	background-image:
		radial-gradient(circle 8px at center, transparent 6px, rgba(78, 72, 188, 0.8) 6px, rgba(78, 72, 188, 0.8) 7px, transparent 7px);
	background-repeat: no-repeat;
	background-position: center;
	animation: vtry-spin 0.8s linear infinite;
}
@keyframes vtry-spin {
	to { transform: rotate(360deg); }
}

/* Indicateur "image préparée en arrière-plan, swap quasi-instantané" — très discret */
.vtry-related__item.is-ready::before {
	content: '';
	position: absolute;
	top: 6px;
	right: 6px;
	width: 6px;
	height: 6px;
	background: #4caf50;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #ffffff;
}

.vtry-related__item-img {
	width: 100%;
	height: 90px;
	object-fit: contain;
	background:
		linear-gradient(45deg, rgba(0,0,0,0.03) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.03) 75%),
		linear-gradient(45deg, rgba(0,0,0,0.03) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.03) 75%);
	background-size: 12px 12px;
	background-position: 0 0, 6px 6px;
	border-radius: 4px;
}
.vtry-related__item-text {
	width: 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.vtry-related__item-name {
	font-size: 12px;
	font-weight: 500;
	color: #1a1614;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	text-align: center;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
	/* Ordre mobile : le déclencheur "Ajuster manuellement" remonte juste sous l'en-tête,
	   au-dessus de la caméra, pour être vu tout de suite. Quand le panneau est ouvert il
	   passe en position:absolute (bottom sheet) et l'ordre n'a alors plus d'effet. */
	.vtry-modal__header { order: 0; }
	.vtry-tuning        { order: 1; }
	.vtry-modal__body   { order: 2; }
	.vtry-controls      { order: 3; }

	.vtry-modal__header {
		padding: 12px 76px 12px 16px; /* place réservée au close en haut à droite */
		flex-wrap: wrap;
	}
	.vtry-modal__title { font-size: 14px; }
	.vtry-modal__close {
		top: 10px;
		right: 10px;
		min-width: 44px;
		height: 44px;
		padding: 0 14px 0 12px;
		font-size: 11px;
	}
	
	.vtry-trigger-wrap {
	position: relative;
    top: 0;
        left: 0;
}
	.vtry-modal__close-label {
		display: none; /* mobile : juste la croix pour gagner de la place */
	}
	.vtry-modal__close {
		padding: 0;
		width: 44px;
	}
	.vtry-current-model {
		font-size: 11px;
		padding: 4px 10px;
		max-width: 100%;
		order: 5;
		width: 100%;
		justify-content: center;
	}
	.vtry-status { font-size: 10px; padding: 4px 10px; order: 3; width: 100%; justify-content: center; }
	.vtry-color-indicator { font-size: 11px; padding: 4px 10px; order: 4; }
	/* Caméra épinglée en haut, hauteur fixe : elle ne peut plus être écrasée à zéro
	   par la liste des modèles ou le panneau d'ajustement. dvh suit la zone visible iOS. */
	.vtry-stage {
		flex: 0 0 auto;
		height: 30vh;
		height: 30dvh;
		min-height: 160px;
		padding: 8px;
	}
	.vtry-tuning__summary { margin: 10px auto 8px; }
	.vtry-tuning__grid {
		grid-template-columns: 1fr;
		gap: 14px;
		padding: 4px 16px 16px;
	}
	/* Ouvert : panneau flottant ancré au-dessus des contrôles. Il sort du flux
	   (plus de flex-shrink:0 qui mangeait la hauteur) donc la caméra garde sa taille
	   et reste visible ; le panneau passe par-dessus le bas de l'image. */
	.vtry-tuning[open] {
		position: absolute;
		left: 0;
		right: 0;
		bottom: calc(120px + env(safe-area-inset-bottom, 0px));
		z-index: 5;
		max-height: 42vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		background: rgba(255, 255, 255, 0.97);
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
		border-top: 1px solid rgba(0, 0, 0, 0.1);
		border-radius: 14px 14px 0 0;
		box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.14);
	}
	/* Le résumé reste visible en haut du panneau pour pouvoir le refermer en scrollant. */
	.vtry-tuning[open] .vtry-tuning__summary {
		position: sticky;
		top: 0;
		width: 100%;
		max-width: none;
		margin: 0;
		border-radius: 14px 14px 0 0;
		background: rgba(255, 255, 255, 0.97);
		color: #4e48bc;
		box-shadow: none;
		-webkit-backdrop-filter: blur(8px);
		backdrop-filter: blur(8px);
	}
	.vtry-tuning[open] .vtry-tuning__summary:hover {
		background: rgba(255, 255, 255, 0.97);
		color: #3e3aa3;
		box-shadow: none;
		transform: none;
	}
	/* Contrôles toujours au-dessus du panneau flottant, et compacts pour gagner
	   de la hauteur (avant : "Capturer photo" passait sur 2 lignes). */
	.vtry-controls {
		position: relative;
		z-index: 6;
		flex-wrap: wrap;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
		gap: 8px;
		background: #fafafa;
	}
	.vtry-action {
		flex: 1 1 calc(50% - 4px);
		min-width: 0;
		justify-content: center;
		min-height: 44px;
		padding: 10px 8px;
		font-size: 11px;
		letter-spacing: 0.02em;
		white-space: nowrap;
	}
	/* CTA principal sur sa propre ligne pleine largeur : les deux actions secondaires
	   tiennent à 50/50 au-dessus, et "Retourner sur la monture" n'est plus tronqué. */
	.vtry-action--primary {
		flex: 1 1 100%;
		margin-left: 0;
	}
	.vtry-action svg { width: 15px; height: 15px; }
	/* Toast remonté au-dessus de la barre de contrôles (désormais sur 2 lignes). */
	.vtry-toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
	/* Sliders d'ajustement : pouce plus large pour une saisie au doigt confortable */
	.vtry-tuning__row input[type="range"] { height: 6px; }
	.vtry-tuning__row input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; }
	.vtry-tuning__row input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }

	.vtry-related { padding: 10px 14px 12px; }
	.vtry-related__title {
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.1em;
		color: #4e48bc;
	}
	.vtry-related__view-link { font-size: 10px; }
	.vtry-colors { margin-bottom: 8px; padding-bottom: 8px; }
	.vtry-colors__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-x;
		gap: 8px;
		margin-top: 6px;
		padding-bottom: 2px;
	}
	.vtry-color-chip { width: 36px; height: 36px; flex: 0 0 auto; }

	/* En mobile : body redevient column, sidebar repasse en horizontal et EN BAS */
	.vtry-modal__body { flex-direction: column; }
	/* La sidebar (couleurs + autres modèles) prend la place restante SOUS la caméra
	   et défile, au lieu d'imposer sa hauteur et d'écraser le stage.
	   min-height : garantit qu'au moins le titre + une rangée de vignettes reste
	   visible (avant : min-height 0 -> le bloc s'écrasait à un filet à peine lisible). */
	.vtry-related {
		flex: 1 1 auto;
		min-height: 180px;
		order: 0; /* après le stage */
		border-left: none;
		border-right: none;
		border-top: 1px solid rgba(0, 0, 0, 0.08);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-y; /* le glissement vertical fait défiler la liste */
	}
	.vtry-related__header {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	.vtry-related__scroller {
		flex-direction: row;
		gap: 8px;
		overflow-x: auto;
		overflow-y: hidden;
		padding-right: 0;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		touch-action: pan-x; /* horizontal au carrousel, vertical à la liste parente */
	}
	.vtry-related__scroller::-webkit-scrollbar { width: auto; height: 6px; }
	.vtry-related__item {
		flex-direction: column;
		flex: 0 0 92px;
		width: auto;
		padding: 6px;
		align-items: stretch;
		scroll-snap-align: start;
	}
	.vtry-related__item:hover {
		transform: translateY(-2px);
	}
	.vtry-related__item-img {
		flex: 0 0 auto;
		width: 100%;
		height: 60px;
	}
	.vtry-related__item-text { gap: 0; }
	.vtry-related__item-name { font-size: 10px; min-height: 26px; }

	/* --- Uniformisation hauteur des vignettes en rangée (fix tablette) ---
	   La vignette du produit courant utilise l'image pleine résolution comme
	   miniature : sans verrouillage de hauteur, un `img { height: auto }` du
	   thème lui rend son ratio natif et fait grandir la carte. On fige donc la
	   boîte image et la hauteur de carte pour que toutes soient identiques. */
	.vtry-related__scroller {
		align-items: stretch; /* explicite : toutes les cartes même hauteur */
	}
	.vtry-related__item {
		flex: 0 0 92px;
		width: 92px;
		height: 88px;           /* hauteur figée -> plus de carte qui dépasse */
		box-sizing: border-box;
		justify-content: flex-start;
		overflow: hidden;
	}
	.vtry-related__item-img {
		flex: 0 0 50px;
		width: 100%;
		height: 50px !important; /* gagne contre un img{height:auto} du thème */
		min-height: 50px;
		max-height: 50px;
		object-fit: contain;
	}
	.vtry-related__item-text {
		flex: 1 1 auto;
		justify-content: center;
	}
	.vtry-related__item-name {
		min-height: 0;
		font-size: 10px;
		line-height: 1.2;
		-webkit-line-clamp: 2;
	}
}

/* ===================================================
   Bouton "Essayer virtuellement" sur les cartes boutique (v2.4)
   =================================================== */
.vtry-trigger--loop {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	box-sizing: border-box;
	margin-top: 8px;
	padding: 9px 12px;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
}
.vtry-trigger--loop .vtry-trigger__icon { flex: 0 0 auto; }
