/* Une zone photo identique sur toutes les cartes, y compris sur mobile. */
.products > .product-card > img,
.products > .product-card > .product-slider {
    align-self: start;
    width: 100% !important;
    height: 320px !important;
    min-height: 320px !important;
    max-height: 320px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.products > .product-card > img,
.products > .product-card > .product-slider:not(.ref08-photo):not(.ref228-photo) img {
    display: block;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    height: 320px !important;
    min-height: 320px !important;
    max-height: 320px !important;
    /* Remplir le cadre en conservant les cadrages propres à chaque référence. */
    object-fit: cover !important;
}

/* Remplir le cadre de la référence 228 comme celui de la référence 225. */
.ref228-photo {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.product-card .ref228-photo img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-position: center;
    transform: translate(-50%, -48%);
}

/* Photo à l'endroit dans la carte de la référence 08. */
.ref08-photo {
    position: relative;
    container-type: inline-size;
    height: 320px;
    overflow: hidden;
}

.product-card .ref08-photo img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100% !important;
    height: 320px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center;
    transform: translate(-50%, -50%);
}

/* Les cartes d'une même rangée partagent la hauteur de chaque ligne. */
.products > .product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: subgrid;
    grid-row: span 6;
    row-gap: 0;
    padding-bottom: 30px;
}

/* Conserver des cartes lisibles sur les navigateurs sans subgrid. */
@supports not (grid-template-rows: subgrid) {
    .products > .product-card {
        grid-row: auto;
        grid-template-rows: 320px auto auto auto auto auto;
        align-content: start;
    }
}

.products > .product-card:hover {
    transform: none;
}

.product-card > img,
.product-card > .product-slider {
    grid-area: 1 / 1 / 2 / -1;
}

.product-card > .selected-color {
    grid-area: 2 / 1 / 3 / -1;
}

.product-card > .color-buttons {
    grid-area: 3 / 1 / 4 / -1;
    align-self: start;
}

.products > .product-card > h3 {
    grid-area: 4 / 1 / 5 / -1;
    position: static !important;
    transform: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 20px 20px 4px !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

.products > .product-card > h3[class*="subtitle"] {
    grid-row: 5;
    padding: 0 20px 16px !important;
}

.products > .product-card > p:not([class]) {
    grid-area: 6 / 1 / 7 / 2;
    align-self: baseline;
    margin: 0 !important;
    padding: 0 12px 0 20px !important;
}

.products > .product-card > p[class$="-line"] {
    grid-area: 6 / 2 / 7 / 3;
    align-self: baseline;
    position: static !important;
    transform: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 20px 0 0 !important;
    text-align: right !important;
}

.products > .product-card > p[class$="-line"] span {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* Descendre les photos de 80 px par rapport au cadrage ordinateur. */
    .ref230-card img {
        object-position: center -120px;
    }

    .ref378-card img {
        object-position: center -130px;
    }

    .products > .product-card {
        grid-row: span 7;
    }

    .products > .product-card > p:not([class]) {
        grid-column: 1 / -1;
    }

    .products > .product-card > p[class$="-line"] {
        grid-area: 7 / 1 / 8 / -1;
        padding: 8px 20px 0 !important;
    }
}

/* Remplir la zone photo pour agrandir le message d'attente. */
.products > .product-card > img[src*="ce%20produit"],
.products > .product-card > .product-slider.product-slider img[src*="ce%20produit"] {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    height: 320px !important;
    min-height: 320px !important;
    max-height: 320px !important;
    object-fit: cover !important;
    object-position: center !important;
}
