/* ============================================
   GALERIA DE PRODUTO MODERNA
   Zoom, Lightbox e Thumbnails Profissionais
   ============================================ */

/* Container principal da galeria */
.product-gallery-modern {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Imagem principal */
.product-gallery-modern__main {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    aspect-ratio: 1 / 1;
}

.product-gallery-modern__main-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-in;
    position: relative;
    overflow: hidden;
}

.product-gallery-modern__main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center;
    will-change: transform;
}

/* Badge de zoom */
.product-gallery-modern__zoom-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-gallery-modern__main-image:hover .product-gallery-modern__zoom-badge {
    opacity: 1;
}

.product-gallery-modern__zoom-badge i {
    font-size: 1rem;
}

/* Thumbnails */
.product-gallery-modern__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.product-gallery-modern__thumb {
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-gallery-modern__thumb:hover {
    border-color: #0066FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.product-gallery-modern__thumb.active {
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.product-gallery-modern__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* Lightbox */
.product-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.product-lightbox.active {
    display: flex;
}

.product-lightbox__content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-lightbox__image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Botões do lightbox */
.product-lightbox__close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.product-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.product-lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.product-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.product-lightbox__nav--prev {
    left: 20px;
}

.product-lightbox__nav--next {
    right: 20px;
}

/* Contador de imagens */
.product-lightbox__counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    z-index: 10000;
}

/* Badges de produto */
.product-gallery-modern__badges {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.product-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-badge--discount {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.product-badge--new {
    background: linear-gradient(135deg, #CDFF00 0%, #B8E600 100%);
    color: #000;
}

.product-badge--featured {
    background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
    color: #fff;
}

/* Responsivo */
@media (max-width: 768px) {
    .product-gallery-modern__main-image {
        padding: 20px;
    }
    
    .product-gallery-modern__thumbs {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .product-gallery-modern__thumb {
        border-width: 2px;
    }
    
    .product-lightbox {
        padding: 20px;
    }
    
    .product-lightbox__content {
        max-width: 100%;
        max-height: 100%;
    }
    
    .product-lightbox__nav {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .product-lightbox__nav--prev {
        left: 10px;
    }
    
    .product-lightbox__nav--next {
        right: 10px;
    }
    
    .product-lightbox__close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
    
    .product-lightbox__counter {
        bottom: 15px;
        font-size: 0.875rem;
        padding: 8px 16px;
    }
}

@media (max-width: 576px) {
    .product-gallery-modern__main-image {
        padding: 15px;
    }
    
    .product-gallery-modern__thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .product-lightbox__nav,
    .product-lightbox__close {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Animação de loading */
.product-gallery-modern__main-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Zoom avançado com lupa */
.product-gallery-modern__main-image.zooming {
    cursor: zoom-in;
}

.product-gallery-modern__main-image.zooming img {
    transition: none !important;
}

/* Indicador visual de zoom disponível */
.product-gallery-modern__main-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                transparent 0%, 
                transparent 40%, 
                rgba(0, 102, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-gallery-modern__main-image:hover::after {
    opacity: 1;
}
