/* Product Hover Animation Fix */

/* Désactivation de l'effet hover pour la deuxième image */
/* Ensure hover image is hidden by default */
.product .thumb .image img.hover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    display: none; /* Désactivé car nous n'utilisons plus de deuxième image */
}

/* Show hover image on product hover */
.product:hover .thumb .image img.hover-image {
    opacity: 0; /* Désactivé */
    display: none; /* Désactivé */
}

/* Ensure base image stays visible */
.product .thumb .image img:not(.hover-image) {
    opacity: 1;
    transition: none; /* Pas de transition pour garder l'image visible */
}

/* Garder l'image principale visible au hover */
.product:hover .thumb .image img:not(.hover-image) {
    opacity: 1; /* Toujours visible */
}

/* Garder l'image principale visible dans tous les cas */
.product .thumb img,
.product .thumb a img {
    opacity: 1 !important;
    transition: transform 0.3s ease; /* Juste un léger effet de zoom */
}

.product:hover .thumb img,
.product:hover .thumb a img {
    opacity: 1 !important;
    transform: scale(1.05); /* Léger zoom au hover */
}

/* Product actions animation */
.product .thumb .actions {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.product:hover .thumb .actions {
    opacity: 1;
    visibility: visible;
}

/* Add to cart button animation */
.product .thumb .add-to-cart {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

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

/* Product scale effect on hover */
.product {
    transition: transform 0.3s ease-in-out;
}

.product:hover {
    transform: translateY(-5px);
}

/* Box shadow on hover */
.product .thumb {
    transition: box-shadow 0.3s ease-in-out;
}

.product:hover .thumb {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Product Detail Page - Image Centering */

/* Center images in swiper slides */
.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Center main product images */
.zoom-top .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.zoom-top .swiper-slide img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* Center thumbnail images */
.zoom-thumbs .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.zoom-thumbs .swiper-slide:hover {
    border-color: #ddd;
}

.zoom-thumbs .swiper-slide-thumb-active {
    border-color: #333;
}

.zoom-thumbs .swiper-slide img {
    max-width: 100%;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* Ensure img-responsive class centers properly */
.img-responsive.m-auto {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Zoom container positioning */
.zoom-image-hover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.zoom-image-hover img {
    position: relative;
    z-index: 1;
}

/* Image clickable with modal */
.image-clickable {
    position: relative;
    cursor: pointer !important;
    transition: transform 0.3s ease;
}

.image-clickable:hover {
    transform: scale(1.02);
}

.zoom-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.image-clickable:hover .zoom-icon-overlay {
    opacity: 1;
}

.zoom-icon-overlay i {
    color: white;
    font-size: 24px;
}

/* Fix for zoomImg overlay */
.zoomImg {
    position: absolute !important;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .zoom-top .swiper-slide {
        min-height: 300px;
    }
    
    .zoom-top .swiper-slide img {
        max-height: 400px;
    }
}

@media (max-width: 575px) {
    .zoom-top .swiper-slide {
        min-height: 250px;
    }
    
    .zoom-top .swiper-slide img {
        max-height: 300px;
    }
    
    .zoom-thumbs .swiper-slide {
        height: 80px;
    }
    
    .zoom-thumbs .swiper-slide img {
        max-height: 70px;
    }
}


/* Modal Full Screen Gallery Styles */
.modal-fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    margin: 0;
}

.modal-fullscreen .modal-content {
    height: 100vh;
    border-radius: 0;
}

.modal-fullscreen .modal-body {
    overflow: hidden;
}

/* Navigation buttons hover effects */
.modal-nav-btn {
    transition: all 0.3s ease;
}

.modal-nav-btn:hover {
    background: rgba(0,0,0,0.8) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.modal-nav-btn:active {
    transform: translateY(-50%) scale(0.95) !important;
}

/* Image transition */
#modalImage {
    transition: opacity 0.2s ease;
}

/* Counter styling */
.modal-image-counter {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .modal-nav-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .modal-prev-btn {
        left: 10px !important;
    }
    
    .modal-next-btn {
        right: 10px !important;
    }
    
    .modal-image-counter {
        bottom: 20px !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .btn-close-white {
        font-size: 1.2rem !important;
        padding: 1rem !important;
    }
}

/* Animation d'entrée du modal */
.modal.fade .modal-dialog {
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: none;
}

/* Curseur pour indiquer que c'est interactif */
#modalImage {
    cursor: default;
}

/* Loading state pour l'image */
#modalImage[src=""] {
    display: none;
}
