/* ==========================================================================
   Fiche produit — version « choc »
   --------------------------------------------------------------------------
   1. En-tête : nom en très gras, marque et référence en pastilles
   2. Planche : la photo sur une grande tuile arrondie, vignettes rondes
   3. Fiche d'identité : une tuile teintée
   4. Description, constructeur en tuile
   5. Vidéo, même gamme, impression
   ========================================================================== */

/* 1. En-tête --------------------------------------------------------------- */
.product-head {
    padding-bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.product-head .page-head__top {
    margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

/* Folio : la référence interne, en pastille */
.product-head__folio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.3rem 0.3rem 0.95rem;
    border-radius: var(--pill);
    background: var(--paper-2);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.product-head__folio strong {
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--ink);
}

/* Ordre de lecture : titre, planche, corps. À partir de 760 px, la planche
   occupe la colonne de gauche sur toute la hauteur. */
.product-head__grid {
    display: grid;
    gap: 1.75rem;
}

@media (min-width: 760px) {
    .product-head__grid {
        grid-template-columns: minmax(0, 5.5fr) minmax(0, 6.5fr);
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "planche titre"
            "planche corps";
        column-gap: clamp(2rem, 4.5vw, 5rem);
        row-gap: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
        align-items: start;
    }

    .product-head__title {
        grid-area: titre;
    }

    .product-gallery {
        grid-area: planche;
        position: sticky;
        top: calc(var(--header-h) + 1.5rem);
    }

    .product-head__body {
        grid-area: corps;
    }
}

/* Marque : capsule bleue, la vague jaune au survol */
.product-head__brand {
    margin: 0;
}

.product-head__brand a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0 1rem;
    border-radius: var(--pill);
    background: var(--brand);
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.product-head__brand a:hover,
.product-head__brand a:focus-visible {
    background: var(--yellow);
    color: var(--ink);
}

.product-head__name {
    margin-top: 1rem;
    font-size: clamp(2.25rem, 1.3rem + 3.6vw, 4.75rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
    overflow-wrap: anywhere;
    padding-bottom: 0.05em;
}

.product-head__name--long {
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3.25rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.product-head__name--xlong {
    font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

/* Un mot très long doit pouvoir se couper, même une fois découpé par data-split */
.product-head__name .split-word {
    max-width: 100%;
}

.product-head__body {
    display: grid;
    gap: clamp(1.25rem, 1rem + 1vw, 2rem);
    justify-items: start;
    align-content: start;
    min-width: 0;
}

.product-head__lede {
    max-width: 34em;
}

/* Classement : pastilles pleines */
.product-head__tags .tag {
    min-height: 2.25rem;
    border: 0;
    background: var(--paper-2);
    font-family: var(--font-text);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink);
}

.product-head__tags a.tag:hover,
.product-head__tags a.tag:focus-visible {
    background: var(--ink);
    color: var(--white);
}

.product-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Documents : deux pastilles, l'hôte en petit dessous */
.product-head__docs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
}

.product-head__docs li {
    display: grid;
    gap: 0.1rem;
    padding: 0.45rem 1.1rem 0.5rem 0.45rem;
    border-radius: 1.4rem;
    background: var(--paper-2);
}

.product-head__docs .link-arrow {
    min-height: 2.25rem;
}

.product-head__host {
    padding-left: calc(2.25rem + 0.75rem);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    overflow-wrap: anywhere;
}

@media (pointer: coarse) {
    .product-head__brand a,
    .product-head__tags .tag,
    .product-head__docs .link-arrow {
        min-height: 2.75rem;
    }
}

/* 2. Planche --------------------------------------------------------------- */
.product-gallery {
    min-width: 0;
    margin: 0;
}

.product-gallery__plate {
    position: relative;
    overflow: hidden;
    border-radius: var(--tile-radius);
    background: var(--paper-2);
}

/* Les repères d'angle de l'ancienne planche n'ont plus lieu d'être */
.product-gallery__plate.crop-marks::before,
.product-gallery__plate.crop-marks::after {
    display: none;
}

.product-gallery__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 32rem;
}

/* Jamais d'agrandissement : largeur et hauteur automatiques, seulement bornées.
   L'image se pose sur une plaque blanche arrondie, au centre de la tuile. */
.product-gallery__slide {
    position: absolute;
    inset: clamp(0.75rem, 4%, 1.5rem);
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    padding: clamp(1rem, 6%, 2.25rem);
    border-radius: calc(var(--tile-radius) - 0.5rem);
    background: var(--white);
}

.product-gallery__slide:not([hidden]) {
    animation: fade-in var(--base) ease;
}

.product-gallery__slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.8s var(--ease);
}

.product-gallery__plate:hover .product-gallery__slide img {
    transform: scale(1.03);
}

.product-gallery__stage .no-image {
    position: absolute;
    inset: clamp(0.75rem, 4%, 1.5rem);
    border-radius: calc(var(--tile-radius) - 0.5rem);
}

.product-gallery__zoom {
    position: absolute;
    right: clamp(1.25rem, 6%, 2rem);
    bottom: clamp(1.25rem, 6%, 2rem);
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    pointer-events: none;
    transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.45s var(--ease);
}

.product-gallery__plate:hover .product-gallery__zoom,
.product-gallery__plate:focus-within .product-gallery__zoom {
    background: var(--yellow);
    color: var(--ink);
    transform: rotate(90deg);
}

.product-gallery .figure__cap {
    margin-top: 0.75rem;
    font-family: var(--font-text);
    font-size: 0.8125rem;
    font-weight: 600;
}

.product-gallery .figure__cap b {
    padding: 0.15rem 0.55rem;
    border-radius: var(--pill);
    background: var(--paper-2);
    font-size: 0.6875rem;
    font-weight: 800;
}

.product-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.9rem 0 0;
    padding: 0;
    list-style: none;
}

.product-gallery__thumb {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    width: 4.75rem;
    height: 4.75rem;
    padding: 0.45rem;
    border-radius: 1.1rem;
    background: var(--white);
    box-shadow: inset 0 0 0 1.5px var(--line);
    transition: box-shadow 0.3s var(--ease);
}

.product-gallery__thumb img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-gallery__thumb:hover {
    box-shadow: inset 0 0 0 2px var(--ink);
}

.product-gallery__thumb[aria-current] {
    box-shadow: inset 0 0 0 3px var(--brand), 0 0 0 3px var(--yellow);
}

/* 3. Fiche d'identité ------------------------------------------------------ */
.product-sheet {
    width: 100%;
    max-width: 42rem;
    margin-top: 0.25rem;
    padding: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem);
    border-radius: var(--tile-radius);
    background: var(--paper-2);
}

.product-sheet__title {
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--muted);
}

.product-sheet__list {
    display: grid;
    gap: 0.3rem;
    margin: 0;
}

.product-sheet__row {
    display: grid;
    grid-template-columns: clamp(6.75rem, 34%, 11rem) minmax(0, 1fr);
    gap: 0.25rem 1.25rem;
    align-items: baseline;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    background: var(--white);
}

.product-sheet__row dt {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--muted);
}

.product-sheet__row dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.product-sheet__ref {
    font-weight: 800;
    letter-spacing: 0.04em;
}

@media (max-width: 479px) {
    .product-sheet__row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 4. Description ----------------------------------------------------------- */
.product-desc__grid {
    display: grid;
    gap: 2.5rem;
}

.product-desc__side {
    display: grid;
    gap: 1.25rem;
    align-content: start;
}

@media (min-width: 900px) {
    .product-desc__grid {
        grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
        gap: clamp(2.5rem, 5vw, 5.5rem);
        align-items: start;
    }

    .product-desc__side {
        position: sticky;
        top: calc(var(--header-h) + 1.5rem);
    }
}

.product-desc__title {
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.75rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.product-desc__title em {
    color: var(--blue);
}

/* Constructeur : une tuile teintée, logo sur plaque blanche */
.product-desc__maker {
    display: grid;
    gap: 0.35rem;
    justify-items: start;
    max-width: 22rem;
    margin-top: 0.75rem;
    padding: clamp(1.1rem, 0.9rem + 0.8vw, 1.5rem);
    border-radius: var(--tile-radius);
    background: var(--paper-2);
}

.product-desc__logo {
    width: auto;
    max-width: 10rem;
    max-height: 3.25rem;
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.9rem;
    background: var(--white);
    object-fit: contain;
    box-sizing: content-box;
}

.product-desc__maker-name {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.product-desc__maker-type {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.product-desc__maker .link-arrow {
    margin-top: 0.75rem;
}

/* Premier paragraphe en chapeau lorsque le texte en compte plusieurs */
.product-desc__body > p:first-child:not(:only-child) {
    font-size: var(--step-1);
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink);
}

.product-desc__body {
    overflow-wrap: break-word;
}

/* 5. Vidéo ----------------------------------------------------------------- */
.product-videos__list {
    display: grid;
    gap: 2rem var(--gutter);
}

.product-videos__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--tile-radius);
    background: var(--ink-2);
    box-shadow: 0 40px 80px -40px rgba(6, 24, 42, 0.75);
}

.product-videos__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.product-videos .figure__cap {
    font-family: var(--font-text);
    font-size: 0.8125rem;
    font-weight: 600;
}

@media (min-width: 900px) {
    .product-videos__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Une seule vidéo : grand format, légende en marge */
    .product-videos__list--single {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-videos__list--single .product-videos__item {
        display: grid;
        grid-template-columns: minmax(0, 9fr) minmax(0, 3fr);
        gap: var(--gutter);
        align-items: end;
    }

    .product-videos__list--single .figure__cap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        margin-top: 0;
    }
}

/* Dans la même gamme : les cartes du catalogue */
.product-related__cell {
    display: flex;
    min-width: 0;
}

.product-related__cell > .product-card,
.product-related__cell > .pc {
    flex: 1 1 auto;
    min-width: 0;
}

@media (min-width: 560px) {
    .product-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .product-related__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Impression : la fiche tient sur une page, sans éléments interactifs */
@media print {
    .product-gallery {
        position: static;
    }

    .product-gallery__thumbs,
    .product-gallery__zoom,
    .product-videos,
    .product-related {
        display: none;
    }
}
