/* Product Grid - Uniformisation des cartes produits */

/* Conteneur de la carte produit */
.product {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
}

/* Zone image avec hauteur fixe */
.product .thumb {
    position: relative;
    overflow: hidden;
    height: 280px;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product .thumb .image {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Images contraintes au conteneur */
.product .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Galerie d'images */
.product-image-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-image {
    display: none;
    width: 100%;
    height: 100%;
}

.gallery-image.active {
    display: block;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Boutons de navigation galerie */
.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 16px;
    color: #333;
}

.product:hover .gallery-prev,
.product:hover .gallery-next {
    opacity: 1;
}

.gallery-prev:hover, .gallery-next:hover {
    background: #fff;
    color: #3b5d50;
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 10px;
}

.gallery-next {
    right: 10px;
}

/* Dots de navigation */
.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.gallery-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.gallery-dots .dot.active {
    background: #fff;
    width: 10px;
    height: 10px;
}

.gallery-dots .dot:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Zone contenu avec hauteur flexible */
.product .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 15px 10px;
    min-height: 100px;
}

/* Titre du produit avec hauteur fixe et ellipsis */
.product .content .title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 1px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product .content .title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product .content .title a:hover {
    color: #3b5d50;
}

/* Prix */
.product .content .price {
    font-size: 16px;
    font-weight: 600;
    color: #3b5d50;
    margin-top: 0;
}

.product .content .price .new {
    color: #3b5d50;
}

/* Badges */
.product .badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.product .badges .new {
    background-color: #3b5d50;
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    display: inline-block;
}

/* Actions */
.product .actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 2;
}

.product:hover .actions {
    opacity: 1;
    transform: translateX(0);
}

.product .actions .action {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    font-size: 16px;
    color: #333;
}

.product .actions .action:hover {
    background-color: #3b5d50;
    color: #fff;
    transform: scale(1.1);
}

/* Bouton "Ajouter au panier" */
.product .add-to-cart {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #3b5d50;
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(100%);
}

.product:hover .add-to-cart {
    opacity: 1;
    transform: translateY(0);
}

.product .add-to-cart:hover {
    background-color: #2d4840;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .product {
        min-height: 380px;
    }
    
    .product .thumb {
        height: 250px;
    }
}

@media (max-width: 767px) {
    .product {
        min-height: 350px;
    }
    
    .product .thumb {
        height: 220px;
    }
    
    .product .content .title {
        font-size: 13px;
        height: 36px;
    }
    
    .product .content .price {
        font-size: 14px;
    }
    
    /* Galerie toujours visible sur mobile */
    .gallery-prev, .gallery-next {
        opacity: 1;
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .gallery-dots .dot {
        width: 7px;
        height: 7px;
    }
    
    .gallery-dots .dot.active {
        width: 9px;
        height: 9px;
    }
}

@media (max-width: 575px) {
    .product {
        min-height: 320px;
    }
    
    .product .thumb {
        height: 200px;
    }
    
    .product .actions {
        opacity: 1;
        transform: translateX(0);
    }
    
    .product .add-to-cart {
        opacity: 1;
        transform: translateY(0);
        font-size: 12px;
        padding: 10px 15px;
    }
    
    /* Boutons galerie plus petits sur très petit écran */
    .gallery-prev, .gallery-next {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .gallery-prev {
        left: 5px;
    }
    
    .gallery-next {
        right: 5px;
    }
    
    .gallery-dots {
        bottom: 5px;
    }
    
    .gallery-dots .dot {
        width: 6px;
        height: 6px;
    }
    
    .gallery-dots .dot.active {
        width: 8px;
        height: 8px;
    }
}
