/**
 * Product Image Slider Styles
 * 
 * Modern and responsive slider styles for product images
 * 
 * @author Álvaro Puche Ortiz
 * @since 1.0.0
 */

/* Container */
.zhenvo-product-slider-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* Slider */
.zhenvo-product-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 20px;
    background: transparent;
}

/* Single Image Mode */
.zhenvo-product-slider.single-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 20px;
    background: transparent;
}

.zhenvo-product-slider .single-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.zhenvo-product-slider .single-image-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zhenvo-product-slider .single-image-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.3s ease;
    border-radius: inherit;
}

.zhenvo-product-slider .single-image-slide img {
    cursor: pointer;
    animation: breathe 3s ease-in-out infinite;
}

.zhenvo-product-slider .single-image-slide:hover img {
    animation: none;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.zhenvo-product-slider .single-image-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

.zhenvo-product-slider .single-image-slide:hover::after {
    left: 100%;
}

/* Swiper Container */
.zhenvo-product-slider .swiper-container {
    width: 100%;
    height: 100%;
}

/* Swiper Wrapper */
.zhenvo-product-slider .swiper-wrapper {
    width: 100%;
    height: 100%;
}

/* Slide */
.zhenvo-product-slider .swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Slide Image */
.zhenvo-product-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
    cursor: pointer;
    animation: breathe 3s ease-in-out infinite;
}

/* Zoom Effect Container */
.zhenvo-product-slider .swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Breathe Animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Hover Effect - Stop breathing and add shine */
.zhenvo-product-slider .swiper-slide:hover img {
    animation: none;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.zhenvo-product-slider .swiper-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

.zhenvo-product-slider .swiper-slide:hover::after {
    left: 100%;
}

/* Navigation */
.zhenvo-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.zhenvo-product-slider:hover .zhenvo-slider-nav {
    opacity: 1;
    visibility: visible;
}

.zhenvo-slider-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

/* Navigation Positioning */
.zhenvo-slider-prev {
    left: 20px;
}

.zhenvo-slider-next {
    right: 20px;
}

/* Pagination */
.zhenvo-slider-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.zhenvo-slider-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
}

.zhenvo-slider-pagination .swiper-pagination-bullet:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.2);
}

.zhenvo-slider-pagination .swiper-pagination-bullet-active {
    background: #000000;
    transform: scale(1.3);
}

/* No Images State */
.zhenvo-no-images {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: transparent;
    color: #666;
    font-size: 18px;
    border-radius: 20px;
    border: 2px dashed #ddd;
}

/* Loading State */
.zhenvo-product-slider.loading {
    opacity: 0.7;
    pointer-events: none;
}

.zhenvo-product-slider.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 20;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Optimization - Keep breathe animation on touch devices */
@media (hover: none) and (pointer: coarse) {
    .zhenvo-product-slider .swiper-slide img,
    .zhenvo-product-slider .single-image-slide img {
        cursor: default;
        animation: breathe 4s ease-in-out infinite;
    }
    
    .zhenvo-product-slider .swiper-slide:hover img,
    .zhenvo-product-slider .single-image-slide:hover img {
        animation: breathe 4s ease-in-out infinite;
        transform: none;
    }
    
    /* Disable shine effect on mobile */
    .zhenvo-product-slider .swiper-slide::after,
    .zhenvo-product-slider .single-image-slide::after {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .zhenvo-product-slider {
        height: 300px;
        border-radius: 15px;
    }
    
    .zhenvo-product-slider.single-image {
        height: 300px;
        border-radius: 15px;
    }
    
    .zhenvo-slider-nav {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .zhenvo-slider-prev {
        left: 10px;
    }
    
    .zhenvo-slider-next {
        right: 10px;
    }
    
    .zhenvo-slider-pagination {
        bottom: 15px;
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .zhenvo-product-slider {
        height: 250px;
        border-radius: 10px;
    }
    
    .zhenvo-product-slider.single-image {
        height: 250px;
        border-radius: 10px;
    }
    
    .zhenvo-slider-nav {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .zhenvo-slider-prev {
        left: 8px;
    }
    
    .zhenvo-slider-next {
        right: 8px;
    }
    
    .zhenvo-slider-pagination {
        bottom: 10px;
        gap: 6px;
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
}

/* Accessibility */
.zhenvo-slider-nav:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.zhenvo-slider-pagination .swiper-pagination-bullet:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* RTL Support */
.rtl .zhenvo-slider-prev {
    right: 20px;
    left: auto;
}

.rtl .zhenvo-slider-next {
    left: 20px;
    right: auto;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .zhenvo-no-images {
        background: transparent;
        color: #ccc;
        border-color: #333;
    }
    
    .zhenvo-slider-nav {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .zhenvo-slider-nav:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet {
        background: rgba(255, 255, 255, 0.3);
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet:hover {
        background: rgba(255, 255, 255, 0.6);
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet-active {
        background: #ffffff;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .zhenvo-slider-nav {
        background: #000000;
        color: #ffffff;
        border: 2px solid #ffffff;
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet-active {
        background: #ffffff;
        border: 2px solid #000000;
    }
}

/* Lightbox Styles */
.zhenvo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.zhenvo-lightbox.active {
    opacity: 1;
    visibility: visible;
}

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

.zhenvo-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    padding: 20px;
}

.zhenvo-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 100000;
}

.zhenvo-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.zhenvo-lightbox-close svg {
    width: 20px;
    height: 20px;
}

/* Lightbox Navigation */
.zhenvo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 100000;
}

.zhenvo-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.zhenvo-lightbox-nav.prev {
    left: 20px;
}

.zhenvo-lightbox-nav.next {
    right: 20px;
}

.zhenvo-lightbox-nav svg {
    width: 24px;
    height: 24px;
}

/* Lightbox Counter */
.zhenvo-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 100000;
}

/* Mobile Lightbox Optimizations */
@media (max-width: 768px) {
    .zhenvo-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .zhenvo-lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .zhenvo-lightbox-nav.prev {
        left: 10px;
    }
    
    .zhenvo-lightbox-nav.next {
        right: 10px;
    }
    
    .zhenvo-lightbox-counter {
        bottom: 10px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .zhenvo-product-slider .swiper-slide img,
    .zhenvo-product-slider .single-image-slide img {
        animation: none;
        transition: none;
    }
    
    .zhenvo-slider-nav {
        transition: none;
    }
    
    .zhenvo-slider-pagination .swiper-pagination-bullet {
        transition: none;
    }
    
    .zhenvo-product-slider.loading::after {
        animation: none;
    }
    
    .zhenvo-lightbox {
        transition: none;
    }
}