/* Styles pour le zoom et la lightbox des images produit */

/* Amélioration de la qualité d'affichage des images */
.product-image img,
.product-main-photo,
.product-thumb img,
.product-card-image {
    /* Qualité d'affichage optimale sans dégrader */
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: bicubic;
}

/* Zoom au survol pour les images produit */
.product-image {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.product-image img {
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image:hover img {
    transform: scale(1.1);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    /* Qualité maximale - EXACTEMENT les mêmes propriétés que l'image principale */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;
    image-rendering: -moz-crisp-edges;
    image-rendering: auto;
    /* Forcer le même contexte de rendu que l'image principale */
    filter: none !important;
    transform: none !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    /* Forcer le navigateur à utiliser le même algorithme de rendu */
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
}

/* Zoom sur la page produit */
.product-main-media {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
}

.product-main-photo {
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    -ms-interpolation-mode: bicubic;
}

.product-main-media:hover .product-main-photo {
    transform: scale(1.05);
}

/* Amélioration des miniatures */
.product-thumb {
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-thumb:hover {
    transform: scale(1.1);
    border-color: var(--primary, #1A1A2E);
}

.product-thumb.active {
    border-color: var(--primary, #1A1A2E);
    opacity: 1;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

/* Responsive */
@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
}

