/* ============================
   Style dédié aux produits Dopamined
   (Grille, Fiche Produit, Lightbox améliorée)
============================ */

/* Grille des Produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.product-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 20px;
}
.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #6EE7B7;
}

/* Fiche Produit */
.product-page {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 40px;
    text-align: left;
}
.product-page img {
    width: 100%;
    max-width: 400px;
    height: auto;
    object-fit: contain;
    background: white;
    border-radius: 20px;
    cursor: pointer;
}
.product-details {
    max-width: 400px;
}
.product-details h3 {
    margin-bottom: 15px;
    font-size: 28px;
}
.product-details p {
    margin-bottom: 20px;
}
.product-price {
    font-size: 22px;
    font-weight: 600;
    color: #456BE0;
    margin-bottom: 20px;
}

/* Navigation au-dessus de la fiche produit */
.product-header {
    margin-top: 20px;
    margin-bottom: 30px;
}
.product-header a {
    color: #456BE0;
    font-weight: 600;
    margin-right: 10px;
    text-decoration: none;
}
.product-header a:hover {
    text-decoration: underline;
}

/* Lightbox Tuile */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}
#lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
}
.lightbox-tile {
    background: #F4F0EB;
    padding: 30px;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.lightbox-tile img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
}
.image-error {
    font-size: 20px;
    color: #456BE0;
    text-align: center;
}

/* Bouton Fermer */
#lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* Navigation Lightbox */
.lightbox-navigation {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
}
.lightbox-navigation button {
    background: #F6D04D;
    color: #2F2F6F;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 20px;
    cursor: pointer;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
    .product-page {
        flex-direction: column;
    }
    .product-page img {
        max-width: 300px;
    }
}
