.product-card {
    display: flex;
    flex-direction: column;
    position: relative;
    height: calc(20vw + 250px);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card .top-card {
    height: calc(100% + 300px);
    background: white;
    position: relative;
    z-index: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    transition: .5s;
    box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.05);
    padding: 2vw;
    border-radius: 24px;
    overflow: hidden;
}

.product-card .top-card.bandeau::after {
    content: "";
    color: var(--color-white);
    position: absolute;
    left: 0;
    top: 0;
    width: fit-content;
    padding: 4px 64px;
    height: fit-content;
    transform: translate(-50px, 15px) rotate(-45deg);
}

.product-card .top-card.bandeau.lsp::after {
    content: "LSP";
    background: var(--color-lsp);
}

.product-card .top-card.bandeau.news::after {
    content: "Nouveauté";
    background: var(--gradient-primary);
    left: -10px;
    top: 15px;
}

.product-card .top-card.bandeau.best::after {
    content: "Best-Seller";
    background: var(--color-tertiary);
    left: -6px;
    top: 15px;
}

.product-card .top-card img {
    mix-blend-mode: multiply;
    margin-inline: auto;
    object-fit: contain;
    width: 100%;
    object-position: top center;
    border-radius: 500px;
    height: fit-content;
}

/* Coin flip */
.product-card .coin-wrapper {
    perspective: 800px;
    position: relative;
    width: 100%;
    height: auto;
}

.product-card:not(.card-recommandation) .coin-wrapper {
    width: 90%;
    margin-top: 0%;
}

.product-card .coin-wrapper picture,
.product-card .coin-wrapper > img {
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 0.6s ease;
}

.product-card .coin-wrapper picture:has(.img-revers),
.product-card .coin-wrapper > .img-revers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    transform: rotateY(-180deg);
}

.product-card .coin-wrapper picture:has(.img-revers) img {
    height: 100%;
    object-fit: contain;
}

.product-card:hover .coin-wrapper:has(.img-revers) picture:has(.img-avers),
.product-card:hover .coin-wrapper:has(.img-revers) > .img-avers {
    transform: rotateY(180deg);
}

.product-card:hover .coin-wrapper picture:has(.img-revers),
.product-card:hover .coin-wrapper > .img-revers {
    transform: rotateY(0deg);
}

.product-card.is-fraction .coin-wrapper {
    container-type: inline-size;
}

.product-card .poids-fraction {
    --poids-trait: 10cqi;
    position: absolute;
    top: 10cqi;
    left: 84cqi;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 3px;
    box-sizing: border-box;
    width: 16cqi;
    padding: 0 2px 4px 0;
    border-bottom: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-body, 'Satoshi');
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-100%);
    filter: drop-shadow(0 0 2px var(--color-white));
}

.product-card .poids-fraction strong {
    font-family: var(--font-titres, 'Cabinet');
    font-size: clamp(22px, 10cqi, 30px);
    font-weight: 750;
    letter-spacing: -0.01em;
}

.product-card .poids-fraction::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: calc(var(--poids-trait) * 1.4142);
    height: 1.5px;
    background: var(--color-primary);
    transform: rotate(135deg);
    transform-origin: 0 50%;
}

.product-card .poids-fraction::after {
    content: "";
    position: absolute;
    top: calc(100% + 0.75px + var(--poids-trait));
    left: calc(-1 * var(--poids-trait));
    width: 9px;
    height: 9px;
    border: 2px solid var(--color-white);
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent);
    transform: translate(-50%, -50%);
}

.product-card[data-produit-metal="argent"] {
    --bottom-card-color: var(--fond-silver, #EEF1F6);
}

.product-card[data-produit-metal="platine"],
.product-card[data-produit-metal="palladium"] {
    --bottom-card-color: var(--fond-bleu, #E2F0FF);
}

.product-card .bottom-card {
    position: absolute;
    background-image: radial-gradient(circle at center -90px, transparent 150px, var(--bottom-card-color, #f9f0d5) -51px);
    z-index: 1;
    padding: 24px;
    border-radius: 0 0 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    bottom: 0;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.product-card .bottom-card .button {
    margin-top: 16px;
}

.product-card.is-shaped .bottom-card {
    justify-content: flex-start;
}

.product-card.is-shaped .bottom-card h3 {
    margin-bottom: auto;
}

.product-card [data-prix-famille]:not(.is-loaded),
.product-card [data-precommande-prix]:not(.is-loaded),
.product-card.is-precommande:not(.is-loaded) [data-precommande-offres] {
    visibility: hidden;
}

.product-card h3 a {
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.product-card .product-card__acheter {
    margin-top: 16px;
    font-weight: 700;
    text-align: center;
}

.product-card .product-card__coffres {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.product-card .product-card__coffres .button {
    margin-top: 0;
}

.product-card.is-unavailable {
    filter: grayscale(1);
}

.product-card .visuel-generique {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    color: var(--color-primary);
    font-family: var(--font-body, 'Satoshi');
    font-size: 16px;
    line-height: 1.2;
    pointer-events: none;
}

.product-card .visuel-generique svg {
    box-sizing: content-box;
    width: 20px;
    height: 20px;
    padding: 4px;
    border-radius: 50%;
    background: var(--color-white);
    opacity: .6;
    transition: opacity .2s;
    /* Cliquable (product-card.js) ; zone de toucher de 44 px par une bordure
       transparente, sans changer le dessin ni la place */
    pointer-events: auto;
    cursor: pointer;
    border: 8px solid transparent;
    background-clip: padding-box;
    margin: -8px;
}

.product-card .visuel-generique__texte {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--color-white);
    box-shadow: 0 4px 12px rgba(28, 65, 109, 0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s, transform .2s;
}

.product-card:hover .visuel-generique svg,
.product-card:focus-visible .visuel-generique svg {
    opacity: 1;
}

.product-card:hover .visuel-generique__texte,
.product-card:focus-visible .visuel-generique__texte {
    opacity: 1;
    transform: none;
}

/* Ouverte au clic sur l'icône (product-card.js) : un clic sur le texte la referme */
.product-card .visuel-generique.is-open svg {
    opacity: 1;
}

.product-card .visuel-generique.is-open .visuel-generique__texte {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    cursor: pointer;
}

.product-card .visuel-manquant {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-weight: 500;
    text-align: center;
}

.product-card.is-unavailable .coin-wrapper {
    opacity: .5;
}

.product-card:hover .top-card {
    transform: translateY(-24px);
}

@media screen and (min-width:1650px) {
    .product-card {
        height: 580px;
    }

    .product-card .top-card {
        padding: 32px;
    }
}

@media screen and (min-width:768px) and (max-width:1250px) {
    .product-card.grid-md-4 {
        width: calc(33.333333% - 24px);
    }

    .product-card {
        height: calc(22vw + 300px);
    }
}

@media screen and (max-width:768px) {

    .product-card,
    .product-card .top-card {
        height: calc(250px + 250px);
    }

    .product-card .top-card {
        padding: 32px;
    }

    .product-card .bottom-card {
        height: 250px;
        padding: 16px;
        background-image: radial-gradient(circle at center -130px, transparent 190px, var(--bottom-card-color, #f9f0d5) -51px);
    }

    .product-card .top-card img,
    .product-card .visuel-manquant {
        max-width: 300px;
    }

    .product-card .visuel-manquant {
        margin-inline: auto;
    }

    .product-card:not(.card-recommandation) .coin-wrapper {
        width: 100%;
        margin-top: 0;
    }

    .product-card.is-fraction .coin-wrapper {
        max-width: 300px;
        margin-inline: auto;
    }
}

@media screen and (max-width:400px) {
    .product-card .bottom-card {
        background-image: radial-gradient(circle at center -110px, transparent 170px, var(--bottom-card-color, #f9f0d5) -51px);
    }
}

/* Tactile, sans survol : icône seule, pleinement visible. Le texte, ouvert en
   permanence, masquait la pièce sur chaque card ; il reste lu par les lecteurs
   d'écran (opacity, pas display) */
@media (hover: none) {
    .product-card .visuel-generique svg {
        opacity: 1;
    }
}