/*
 * Fiche produit.
 * Reprend la maquette images/maquette_produit.png.
 * Les jetons viennent de fondations.css : aucune couleur en dur ici.
 */

.fiche { padding-bottom: var(--espace-8); }

/* — États de chargement — */
.fiche__attente,
.fiche__erreur {
    padding-block: var(--espace-8);
    text-align: center;
    color: var(--texte-doux);
}
.fiche__erreur { color: var(--bordeaux-vif); }

/* — Corps de la fiche — */
.fiche__corps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--espace-6);
    align-items: start;
    padding-block: var(--espace-5);
}

.fiche__photo {
    position: relative;
    isolation: isolate;
    border-radius: var(--rayon-l);
    overflow: hidden;
    background: var(--creme-sombre);
    aspect-ratio: 1;
}
.fiche__photo img { width: 100%; height: 100%; object-fit: cover; }

/*
 * Photo détourée : chaque diapositive porte son propre fond. Pour une photo
 * détourée, ce fond devient un panneau qui part du haut du cadre et s'arrête
 * avant le bas ; le produit en sort par le bas. Le ruban « Nouveau » reste
 * devant le produit, dans le coin. Rien n'est coupé à la galerie qui défile.
 */
.fiche__photo { background: transparent; }
.galerie__diapo { position: relative; background: var(--creme-sombre); }
.galerie__diapo--detouree { background: transparent; }
/* Le panneau est porté par le cadre, sous la piste. Il suit la photo
   affichée : la suivante peut remplir tout le cadre. */
.fiche__photo--detouree::before {
    content: "";
    position: absolute;
    inset: 0 0 20%;
    z-index: 0;
    border-radius: var(--rayon-l);
    background: var(--creme-sombre);
}
/* Le produit s'arrête avant le bas du cadre : son ombre a la place de se
   fondre, au lieu d'être coupée net par le bord. */
.fiche__photo .galerie__diapo--detouree img {
    position: relative;
    object-fit: contain;
    padding: 2% 12% 9%;
    filter: drop-shadow(0 18px 18px rgb(100 18 28 / 18%));
}
/* La piste passe devant le panneau, le ruban devant la piste. */
.fiche__photo--detouree .galerie__piste { position: relative; z-index: 2; }
.fiche__photo--detouree .ruban-produit--nouveau { z-index: 3; }
.fiche__photo--detouree .rubans-produit { bottom: 20%; border-radius: var(--rayon-l); }

/* Sur ordinateur, une photo un peu moins grande : l'effet se lit mieux et le
   texte gagne de la place. Le mobile garde la photo pleine largeur. */
@media (min-width: 901px) {
    .fiche__corps { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
    .fiche__media { width: 100%; max-width: 520px; justify-self: center; }
}

/* — Galerie — */
.galerie__piste {
    display: flex;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.galerie__piste::-webkit-scrollbar { display: none; }
.galerie__piste:focus-visible { outline: 3px solid var(--rose-vif); outline-offset: -3px; }
.galerie__diapo {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.galerie__fleche {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border: 0;
    border-radius: var(--rayon-rond);
    background: rgb(255 254 251 / 88%);
    color: var(--bordeaux);
    font-size: 1.8rem;
    line-height: 1;
    box-shadow: var(--ombre-flottante);
    cursor: pointer;
    transition: opacity var(--transition), background var(--transition);
}
.galerie__fleche:hover { background: var(--blanc-chaud); }
.galerie__fleche:focus-visible { outline: 3px solid var(--rose-vif); outline-offset: 2px; }
.galerie__fleche:disabled { opacity: 0; pointer-events: none; }
.galerie__fleche--precedente { left: var(--espace-2); }
.galerie__fleche--suivante { right: var(--espace-2); }
.galerie__compteur {
    position: absolute;
    right: var(--espace-2);
    bottom: var(--espace-2);
    z-index: 3;
    margin: 0;
    padding: 3px 10px;
    border-radius: var(--rayon-rond);
    background: rgb(51 48 44 / 70%);
    color: var(--texte-inverse);
    font-size: var(--taille-xs);
    font-weight: 600;
}
.galerie__vignettes {
    display: flex;
    gap: var(--espace-1);
    margin-top: var(--espace-2);
    overflow-x: auto;
}
.galerie__vignette {
    flex: 0 0 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--rayon-m);
    overflow: hidden;
    background: var(--creme-sombre);
    cursor: pointer;
    opacity: 0.65;
    transition: opacity var(--transition), border-color var(--transition);
}
.galerie__vignette img { width: 100%; height: 100%; object-fit: cover; }
.galerie__vignette:hover { opacity: 1; }
.galerie__vignette[aria-current="true"] { opacity: 1; border-color: var(--bordeaux-vif); }
.galerie__vignette:focus-visible { outline: 3px solid var(--rose-vif); outline-offset: 2px; }
/* Sur écran tactile, le doigt suffit : les flèches encombreraient la photo. */
@media (hover: none) {
    .galerie__fleche { display: none; }
}

.fiche__collection {
    font-size: var(--taille-xs);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--texte-doux);
    margin: 0 0 var(--espace-1);
}
.fiche__titre {
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    color: var(--bordeaux);
    margin-bottom: var(--espace-2);
}
.fiche__prix {
    font-family: var(--police-titre);
    font-size: var(--taille-xl);
    font-weight: 700;
    color: var(--bordeaux-profond);
    margin: 0 0 var(--espace-3);
}
.fiche__resume {
    color: var(--texte-doux);
    line-height: 1.55;
    margin-bottom: var(--espace-3);
}
.fiche__resume p { margin: 0 0 var(--espace-2); }
.fiche__resume p:last-child { margin-bottom: 0; }

/* — Choix du format — */
/*
 * Absent de la maquette, mais 52 produits du catalogue sont variables : sans
 * ce sélecteur, ils ne peuvent pas être achetés. EF-12 et EF-13.
 */
/* — Parfum d'une gamme — */
.parfums { margin: 0 0 var(--espace-3); }
.parfums .formats__titre { display: block; }
.parfums__choix {
    width: 100%;
    max-width: 22rem;
    padding: 0.6rem var(--espace-2);
    border: 2px solid var(--creme-sombre);
    border-radius: var(--rayon-m);
    background: var(--blanc-chaud);
    color: var(--texte);
    font: inherit;
    font-size: var(--taille-s);
    cursor: pointer;
    transition: border-color var(--transition);
}
.parfums__choix:hover { border-color: var(--rose); }
.parfums__choix:focus-visible {
    outline: 3px solid var(--rose-vif);
    outline-offset: 2px;
}

.formats {
    border: 0;
    margin: 0 0 var(--espace-3);
    padding: 0;
}
.formats__titre {
    padding: 0;
    font-size: var(--taille-s);
    font-weight: 600;
    color: var(--texte);
    margin-bottom: var(--espace-2);
}
.formats__choix { display: flex; flex-wrap: wrap; gap: var(--espace-1); }

.format {
    display: inline-flex;
    align-items: baseline;
    gap: var(--espace-1);
    padding: 0.6rem var(--espace-2);
    border: 2px solid var(--creme-sombre);
    border-radius: var(--rayon-m);
    background: var(--blanc-chaud);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.format:hover { border-color: var(--rose); }
/* Le bouton radio reste dans le document : il porte l'état et le focus. */
.format__champ {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.format:has(.format__champ:checked) {
    border-color: var(--bordeaux-vif);
    background: var(--rose-pale);
}
.format:has(.format__champ:focus-visible) {
    outline: 3px solid var(--rose-vif);
    outline-offset: 2px;
}
.format__libelle { font-weight: 600; font-size: var(--taille-s); }
.format__prix { font-size: var(--taille-xs); color: var(--texte-doux); }
.format--indisponible {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}
.formats__etat {
    font-size: var(--taille-xs);
    color: var(--texte-doux);
    margin: var(--espace-1) 0 0;
    min-height: 1.2em;
}

/* — Achat — */
.achat { display: flex; gap: var(--espace-2); flex-wrap: wrap; }
.quantite {
    display: flex;
    align-items: center;
    border: 2px solid var(--creme-sombre);
    border-radius: var(--rayon-rond);
    background: var(--blanc-chaud);
    overflow: hidden;
}
.quantite__bouton {
    width: 44px;
    height: 46px;
    border: 0;
    background: none;
    color: var(--bordeaux-profond);
    font-size: var(--taille-m);
    cursor: pointer;
}
.quantite__bouton:hover { background: var(--creme); }
.quantite__champ {
    width: 46px;
    height: 46px;
    border: 0;
    text-align: center;
    font: inherit;
    font-weight: 600;
    background: none;
    -moz-appearance: textfield;
}
.quantite__champ::-webkit-outer-spin-button,
.quantite__champ::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.achat__bouton { flex: 1; min-width: 220px; justify-content: center; padding-block: 0.9rem; }
.achat__bouton[disabled] { opacity: 0.45; cursor: not-allowed; }

.achat__message {
    font-size: var(--taille-s);
    margin: var(--espace-2) 0 0;
    min-height: 1.4em;
}
.achat__message--succes { color: #2f6b3a; font-weight: 600; }
.achat__message--erreur { color: var(--bordeaux-vif); font-weight: 600; }

/* — Garanties — */
.garanties {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--espace-2);
    list-style: none;
    margin: var(--espace-4) 0 0;
    padding: var(--espace-3) 0 0;
    border-top: 1px solid var(--creme-sombre);
    font-size: var(--taille-s);
    color: var(--texte-doux);
}
.garanties li { display: flex; align-items: center; gap: var(--espace-1); }

/* — Description — */
.description {
    padding-block: var(--espace-5);
    border-top: 1px solid var(--creme-sombre);
}
.description__titre {
    font-size: var(--taille-l);
    color: var(--bordeaux-profond);
    margin-bottom: var(--espace-3);
}
.description__texte {
    max-width: 70ch;
    color: var(--texte-doux);
    line-height: 1.65;
}
.description__texte p { margin: 0 0 var(--espace-2); }
.description__texte h2,
.description__texte h3 {
    font-size: var(--taille-m);
    color: var(--texte);
    margin: var(--espace-3) 0 var(--espace-1);
}
.description__texte ul { padding-left: var(--espace-3); }

/* — Adaptation aux petits écrans — */
@media (max-width: 900px) {
    .fiche__corps {
        grid-template-columns: 1fr;
        gap: var(--espace-4);
    }
    .garanties { grid-template-columns: 1fr; }
    .achat__bouton { min-width: 0; }
}

/* — Notre histoire — */
/*
 * Trois colonnes : la photo, le texte, puis les engagements. Sur la maquette,
 * le bloc respire au milieu de la fiche et rompt la succession de listes.
 */
.histoire {
    background: var(--creme);
    border-block: 1px solid var(--creme-sombre);
}
.histoire__contenu {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: var(--espace-4);
    align-items: center;
    padding-block: var(--espace-5);
}
.histoire__image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 0.86;
    object-fit: cover;
    border-radius: var(--rayon-m);
}
.histoire__titre {
    font-size: var(--taille-l);
    color: var(--bordeaux-profond);
    margin-bottom: var(--espace-2);
}
.histoire__texte p {
    color: var(--texte-doux);
    line-height: 1.55;
    margin: 0 0 var(--espace-3);
}
.histoire__points {
    display: grid;
    gap: var(--espace-2);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--taille-s);
    color: var(--texte-doux);
}
.histoire__points li { display: flex; align-items: center; gap: var(--espace-2); }
.histoire__puce {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: var(--rayon-rond);
    background: var(--rose-pale);
    color: var(--bordeaux-vif);
}

@media (max-width: 900px) {
    .histoire__contenu { grid-template-columns: 1fr; }
}
