/* =============================================================================
   Fiche produit (detail.php) — préfixes .vt-fiche, .vt-galerie, .vt-achat,
   .vt-variante, .vt-carac, .vt-similaires, .vt-lightbox
   Chargée par templates/header.php après style.css et le thème du vendeur.
   Réutilise le socle : .vt-fil, .vt-h2, .vt-badges, .vt-etiq, .vt-btn, .vt-qte,
   .vt-lien, .vt-grille + .vt-carte (partials/produit-card.php), .vt-vide, .vt-tete.
   ============================================================================= */

.vt-fiche { padding: 24px 0 64px; }
.vt-fiche__grille { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 32px 48px; align-items: start; margin-top: 22px; }

/* ---- Galerie : grande image 4:3, bouton « Agrandir », compteur, miniatures - */
.vt-galerie { min-width: 0; }
.vt-galerie__grande { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--filet); border-radius: var(--rayon-carte); background: var(--gris); cursor: zoom-in; }
.vt-galerie__grande img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.vt-galerie__grande:hover img { transform: scale(1.02); }
.vt-galerie__zoom { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--rayon); background: rgba(255, 255, 255, .92); border: 1px solid var(--filet); font-weight: 600; font-size: .82rem; color: var(--texte); }
.vt-galerie__zoom svg { width: 16px; height: 16px; }
.vt-galerie__compte { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--rayon); background: rgba(31, 29, 26, .78); color: #ffffff; font-weight: 600; font-size: .8rem; }
.vt-galerie__compte b { font-weight: 800; color: #ffffff; }
.vt-galerie__vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--primaire-filet); cursor: default; }
.vt-galerie__vide svg { width: 64px; height: 64px; }
.vt-galerie__vide p { font-weight: 600; font-size: .85rem; color: var(--texte-3); }
.vt-galerie__minis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.vt-galerie__mini { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid transparent; border-radius: var(--rayon); background: var(--gris); opacity: .6; transition: opacity .2s, border-color .2s; }
.vt-galerie__mini img { width: 100%; height: 100%; object-fit: cover; }
.vt-galerie__mini:hover, .vt-galerie__mini.vt-est-actif { opacity: 1; border-color: var(--primary); }

/* ---- Colonne achat : famille, titre, badges, résumé, variantes, prix, quantité, bouton */
.vt-achat { min-width: 0; }
.vt-achat__famille { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); transition: color .2s; }
.vt-achat__famille svg { width: 18px; height: 18px; }
.vt-achat__famille:hover { color: var(--primaire-fonce); text-decoration: underline; text-underline-offset: 3px; }
.vt-achat__titre { margin-top: 10px; font-weight: 800; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -.015em; color: var(--texte); text-wrap: balance; }
.vt-achat__badges { margin-top: 14px; }
.vt-achat__resume { margin-top: 14px; font-size: 1.02rem; }

/* Conditionnement en boutons-radio visibles : libellé à gauche, prix à droite */
.vt-variantes { margin-top: 24px; padding: 0; border: 0; min-width: 0; }
.vt-variantes legend { padding: 0; margin-bottom: 8px; }
.vt-variante { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--filet); border-radius: var(--rayon); background: var(--blanc); cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.vt-variante + .vt-variante { margin-top: 8px; }
.vt-variante:hover { border-color: var(--texte-3); }
.vt-variante input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.vt-variante__puce { flex: none; width: 20px; height: 20px; border: 2px solid var(--filet); border-radius: 50%; background: var(--blanc); transition: border-color .2s, box-shadow .2s; }
.vt-variante__lib { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: .95rem; color: var(--texte); }
.vt-variante__prix { flex: none; font-weight: 800; font-size: 1rem; color: var(--texte); white-space: nowrap; }
.vt-variante__prix .vt-prix-avant { font-size: .88rem; margin-right: 2px; }
.vt-prix-avant--fiche { font-size: 1.15rem; }
.vt-achat__prix .vt-remise { align-self: center; font-size: .86rem; }
.vt-variante.vt-est-choisi, .vt-variante:has(input:checked) { border-color: var(--primary); background: var(--primaire-pale); box-shadow: inset 0 0 0 1px var(--primary); }
.vt-variante.vt-est-choisi .vt-variante__puce, .vt-variante:has(input:checked) .vt-variante__puce { border-color: var(--primary); box-shadow: inset 0 0 0 4px var(--blanc); background: var(--primary); }
.vt-variante.vt-est-choisi .vt-variante__prix, .vt-variante:has(input:checked) .vt-variante__prix { color: var(--primary); }
.vt-variante:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Prix grand « TTC », libellé de la variante, mention livraison */
.vt-achat__prix { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--filet); }
.vt-achat__prix strong { font-weight: 800; font-size: clamp(2rem, 3.2vw, 2.6rem); line-height: 1; letter-spacing: -.02em; color: var(--primary); white-space: nowrap; }
.vt-achat__ttc { display: inline-flex; flex-direction: column; font-weight: 800; font-size: .9rem; color: var(--texte); }
.vt-achat__ttc small { font-weight: 600; font-size: .82rem; color: var(--texte-2); }
.vt-achat__note { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .88rem; color: var(--texte-2); }
.vt-achat__note svg { flex: none; width: 16px; height: 16px; color: var(--primary); }
.vt-achat__note a { color: var(--primary); font-weight: 600; }
.vt-achat__note a:hover { color: var(--primaire-fonce); text-decoration: underline; }

/* Quantité + bouton sur une ligne */
.vt-achat__ligne { display: flex; align-items: flex-end; gap: 12px; margin-top: 20px; }
.vt-achat__qte { flex: none; }
.vt-achat__qte .vt-qte { height: 50px; }
.vt-achat__qte .vt-qte button { width: 44px; height: 47px; }
.vt-achat__qte .vt-qte output { min-width: 40px; font-size: 1rem; }
.vt-achat__ajouter { flex: 1 1 auto; width: auto; }
.vt-achat__ajouter svg { width: 20px; height: 20px; }
.vt-achat__ok { min-height: 1.5em; margin-top: 10px; font-weight: 600; font-size: .9rem; color: var(--ok); }

/* « Une question ? » : téléphone et WhatsApp en liens */
.vt-achat__contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--filet); font-size: .92rem; color: var(--texte-2); }
.vt-achat__contact a { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--texte); transition: color .2s; }
.vt-achat__contact a svg { width: 17px; height: 17px; color: var(--primary); }
.vt-achat__contact a:hover { color: var(--primary); }
.vt-achat__contact .vt-achat__wa svg { color: var(--whatsapp-2); }

/* ---- Blocs sous les colonnes : description à gauche, caractéristiques + livraison à droite */
.vt-fiche__blocs { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 36px 48px; align-items: start; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--filet); }
.vt-fiche__bloc { min-width: 0; }
.vt-fiche__bloc .vt-h2 { font-size: 1.25rem; }
.vt-fiche__bloc .vt-h2::before { width: 12px; height: 12px; }
.vt-fiche__bloc > p { margin-top: 14px; max-width: 64ch; line-height: 1.7; }
.vt-fiche__cote { display: grid; gap: 32px; }
.vt-carac { width: 100%; margin-top: 14px; border: 1px solid var(--filet); border-radius: var(--rayon); overflow: hidden; }
.vt-carac th, .vt-carac td { padding: 11px 14px; text-align: left; vertical-align: top; font-size: .92rem; line-height: 1.45; border-bottom: 1px solid var(--filet); }
.vt-carac tr:last-child th, .vt-carac tr:last-child td { border-bottom: 0; }
.vt-carac th { width: 42%; font-weight: 600; color: var(--texte-2); background: var(--gris); }
.vt-carac td { font-weight: 800; color: var(--texte); }
.vt-fiche__livraison > p { margin-top: 12px; font-size: .95rem; }
.vt-fiche__zones { display: grid; gap: 6px; margin-top: 14px; }
.vt-fiche__zones li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; border: 1px solid var(--filet); border-radius: var(--rayon); font-size: .92rem; color: var(--texte-2); }
.vt-fiche__zones li span:first-child { flex: 1 1 auto; font-weight: 600; color: var(--texte); }
.vt-fiche__zones b { font-weight: 800; color: var(--texte); white-space: nowrap; }
.vt-fiche__zones small { flex: none; width: 100%; font-size: .8rem; color: var(--texte-3); }
.vt-fiche__zones .vt-est-ok { color: var(--ok); }
.vt-fiche__hors-zone { margin-top: 10px; font-size: .86rem; color: var(--texte-3); }
.vt-fiche__livraison .vt-lien { margin-top: 14px; }

/* ---- Même famille : trois cartes du socle sur fond gris ------------------- */
.vt-similaires { background: var(--gris); border-top: 1px solid var(--filet); }
.vt-similaires .vt-tete .vt-lien { flex: none; margin-bottom: 4px; }

/* ---- 404 ------------------------------------------------------------------- */
.vt-fiche__404 h2 { font-weight: 800; font-size: 1.1rem; color: var(--texte); }
.vt-fiche__404-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---- Lightbox : fond anthracite, image centrée, navigation ---------------- */
.vt-lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 56px 72px; background: rgba(31, 29, 26, .94); }
.vt-lightbox[hidden] { display: none; }
body.vt-lightbox-ouverte { overflow: hidden; }
.vt-lightbox__fig { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.vt-lightbox__fig img { max-width: min(1200px, 100%); max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: var(--rayon); object-fit: contain; }
.vt-lightbox__fig figcaption { font-size: .9rem; color: var(--sur-sombre-2); text-align: center; }
.vt-lightbox__fermer, .vt-lightbox__nav { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid var(--filet-sombre-2); border-radius: var(--rayon); background: rgba(255, 255, 255, .08); color: #ffffff; transition: background .2s, border-color .2s; }
.vt-lightbox__fermer:hover, .vt-lightbox__nav:hover { background: rgba(255, 255, 255, .18); border-color: #ffffff; }
.vt-lightbox__fermer svg, .vt-lightbox__nav svg { width: 22px; height: 22px; }
.vt-lightbox__fermer { top: 16px; right: 16px; }
.vt-lightbox__nav { top: 50%; transform: translateY(-50%); }
.vt-lightbox__prev { left: 16px; }
.vt-lightbox__next { right: 16px; }

/* ---- Adaptatif ------------------------------------------------------------ */
@media (max-width: 1100px) {
	.vt-fiche__grille, .vt-fiche__blocs { grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); gap: 28px 32px; }
	.vt-galerie__minis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
	.vt-fiche__grille, .vt-fiche__blocs { grid-template-columns: 1fr; gap: 28px; }
	.vt-fiche__blocs { margin-top: 40px; padding-top: 32px; }
	.vt-similaires .vt-tete .vt-lien { margin-bottom: 0; }
}
@media (max-width: 640px) {
	.vt-fiche { padding: 18px 0 48px; }
	.vt-fiche__grille { margin-top: 16px; gap: 22px; }
	.vt-galerie__minis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
	.vt-galerie__zoom span { display: none; }
	.vt-achat__titre { font-size: 1.45rem; }
	.vt-variante { padding: 11px 12px; }
	.vt-variante__lib { font-size: .9rem; }
	.vt-achat__prix strong { font-size: 2rem; }
	.vt-achat__ligne { flex-wrap: wrap; }
	.vt-achat__qte { flex: 1 1 auto; }
	.vt-achat__qte .vt-qte { display: flex; width: 100%; }
	.vt-achat__qte .vt-qte button { flex: 1 1 auto; }
	.vt-achat__qte .vt-qte output { flex: 1 1 auto; }
	.vt-achat__ajouter { flex: 1 1 100%; }
	.vt-fiche__blocs { margin-top: 32px; padding-top: 28px; gap: 28px; }
	.vt-carac th { width: 46%; }
	.vt-carac th, .vt-carac td { padding: 10px 12px; font-size: .88rem; }
	.vt-lightbox { padding: 72px 12px 24px; }
	.vt-lightbox__fig img { max-height: calc(100vh - 120px); }
	.vt-lightbox__fermer, .vt-lightbox__nav { width: 42px; height: 42px; }
	.vt-lightbox__nav { top: auto; bottom: 16px; transform: none; }
	.vt-lightbox__prev { left: 12px; }
	.vt-lightbox__next { right: 12px; }
}
