/* Conteneur principal */
.related-products {
    margin-top: 70px;
    text-align: center;
    padding: 0;
    box-sizing: border-box;
}

/* Grid layout : 1 ligne sur desktop, 2 lignes sur mobile */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Colonnes flexibles */
    gap: 20px;
    padding: 0;
    list-style: none;
    margin: 0 auto;
    max-width: 1200px;
    justify-items: center; /* Centrage horizontal des items */
}

/* Style de chaque produit */
.related-product-item {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligner le texte en bas */
    padding: 15px;
    background-color: #FFFFFF;
    border: 1px dotted black;
    box-sizing: border-box;
    height: 100%; 
    position: relative; 
    transition: transform 0.2s ease;
    max-width: 300px;
    max-height: 600px;
}
/* Image ajustée */
.related-product-item img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Informations textuelles alignées EN BAS */
.related-product-info {
    display: flex; /* Ajout de flex pour activer le gap */
    flex-direction: column; /* Aligner les éléments verticalement */
    justify-content: flex-end; /* Texte aligné en bas */
    gap: 8px; /* Espacement entre les éléments */
    padding-top: 10px;
    box-sizing: border-box;
}


/* Stylisation des textes */
.product-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    text-align: left;
    text-transform: uppercase;
}

.product-date {
    font-family: 'Rhymes';
    font-style: normal;
    font-size: 1.2rem;
    color: #555;
    margin: 0;
    text-align: right;
    text-transform: uppercase;
}

.product-price {
    margin: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #000;
    text-align: right;
    border-radius: 0px; /* Bord arrondi */
    padding: 10px 10px; /* Espacement interne */
    background-color: rgba(0, 0, 0, 0.12);
    display: inline-block; /* Pour respecter la taille du contenu */
    position: relative;
    width: fit-content; /* Ajuste la taille au contenu */
    box-shadow: 0 0 30px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease, background-color 0.3s ease; /* Animation fluide */
    overflow: hidden; /* Évite le dépassement */
}

/* Lorsque .related-product-item est survolé */
@media (hover: hover) { .related-product-item:hover .product-price {
    box-shadow: 0 0 50px 30px rgba(0, 0, 0, 0.16);
    transform: scale(1.02); /* Légère augmentation de la taille */
    background-color: rgba(0, 0, 0, 0.18);
} }



/* Ajout d'un espace avant pour pousser le texte vers la droite */
.product-price::before {
    content: ""; 
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}



/* Disposition mobile : 2 colonnes */
@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0px;
    }
    .related-product-info {
    gap: 12px; /* Espacement entre les éléments */
    padding-top: 10px;
}

}

/* Un seul produit centré */
.related-products-grid:has(.related-product-item:nth-child(1):nth-last-child(1)) {
    grid-template-columns: 1fr;
    justify-content: center;
}
