/* ========================================
   CARRUSEL DE IMÁGENES DE PRODUCTOS
   ======================================== */

.producto-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navegación del Carrusel */
.carousel-nav {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.producto-card:hover .carousel-nav {
    opacity: 1;
}

.carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-nav.prev {
    left: 8px;
}

.carousel-nav.next {
    right: 8px;
}

/* Indicadores (Dots) */
.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* ========================================
   ZOOM DE IMAGEN
   ======================================== */

.image-zoom-container {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.image-zoom-container img {
    transition: transform 0.3s ease;
}

.image-zoom-container:hover img {
    transform: scale(1.1);
}

/* Zoom Avanzado con Lupa */
.zoom-lens {
    position: absolute;
    border: 2px solid #667eea;
    width: 150px;
    height: 150px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
}

.image-zoom-container:hover .zoom-lens {
    opacity: 1;
}

.zoom-result {
    position: absolute;
    top: 0;
    right: -320px;
    width: 300px;
    height: 300px;
    border: 1px solid #ddd;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.image-zoom-container:hover .zoom-result {
    opacity: 1;
}

.zoom-result img {
    position: absolute;
    transform-origin: top left;
}

/* ========================================
   GALERÍA EN MODAL DE DETALLES
   ======================================== */

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-main {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #E8F5E9 0%, #FFF5E6 100%);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.gallery-thumbnail {
    min-width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.gallery-thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background: #f0f0f0;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-main {
        height: 300px;
    }

    .gallery-thumbnail {
        min-width: 60px;
        height: 60px;
    }

    .zoom-result {
        display: none;
    }
}