/* ============================================
   FILE: css/gallery.css
   GALERÍA DE RESEÑAS Y PRUEBAS DE PAGO
   VERSIÓN 2.0 - MODAL MEJORADO CON ZOOM
============================================ */

/* ===== GALERÍA PRINCIPAL ===== */
.gallery-section {
    padding: var(--section-padding);
    background: var(--bg-dark);
    border-top: 1px solid rgba(212, 175, 55, 0.04);
    border-bottom: 1px solid rgba(212, 175, 55, 0.04);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto 24px;
}

/* ===== ITEM DE GALERÍA ===== */
.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    aspect-ratio: 1/1.2;
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.06);
    transition: var(--transition-bounce);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 12px 40px var(--shadow-dark);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ===== BOTÓN VER MÁS ===== */
.gallery-toggle-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 40px;
    background: var(--gradient-gold);
    color: var(--bg-dark);
    border: none;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-family);
    box-shadow: 0 4px 25px var(--shadow-gold);
}

.gallery-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 40px var(--shadow-gold);
}

.gallery-toggle-btn:active {
    transform: scale(0.97);
}

.gallery-toggle-btn i {
    margin-right: 8px;
}

/* ===== TABS ===== */
.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.gallery-tab {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--border-gold);
    border-radius: var(--border-radius-full);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-family);
}

.gallery-tab:hover {
    color: var(--gold);
    border-color: rgba(212, 175, 55, 0.3);
}

.gallery-tab.active {
    background: var(--gradient-gold);
    color: var(--bg-dark);
    border-color: var(--gold);
    box-shadow: 0 4px 25px var(--shadow-gold);
}

.gallery-tab .tab-count {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.gallery-tab.active .tab-count {
    background: rgba(0, 0, 0, 0.2);
    color: var(--bg-dark);
}

/* ============================================
   MODAL DE GALERÍA - VERSIÓN MEJORADA CON ZOOM
============================================ */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    background: var(--bg-dark);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-gold);
    box-shadow: 0 30px 80px var(--shadow-heavy);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 98vw;
    max-height: 98vh;
    overflow: hidden;
    width: auto;
    height: auto;
}

/* ===== WRAPPER DE IMAGEN ===== */
.gallery-modal-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    padding: 8px;
    position: relative;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    min-height: 200px;
    max-height: 88vh;
}

/* Contenedor de zoom */
.gallery-modal-zoom-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

/* IMAGEN con zoom */
.gallery-modal-image-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: var(--bg-dark);
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* VIDEO en modal */
.gallery-modal-image-wrapper video {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    background: var(--bg-dark);
    border-radius: 8px;
    touch-action: none;
}

/* ===== CONTADOR DE MODAL - ESQUINA SUPERIOR IZQUIERDA ===== */
.gallery-modal-counter {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 15;
    pointer-events: none;
}

/* ===== BOTONES DE NAVEGACIÓN ===== */
.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--gold);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 15;
    font-size: 18px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery-modal-nav:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-nav.prev {
    left: 12px;
}

.gallery-modal-nav.next {
    right: 12px;
}

/* ===== BOTÓN CERRAR ===== */
.gallery-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    color: var(--gold);
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 15;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery-modal-close:hover {
    background: rgba(212, 175, 55, 0.15);
    transform: rotate(90deg);
}

/* ============================================
   INFO DEL MODAL (oculta, solo para mantener estructura)
============================================ */
.gallery-modal-info {
    display: none;
}

/* ============================================
   RESPONSIVE - MODAL MEJORADO
============================================ */

/* Móvil y tablet */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    
    .gallery-modal {
        padding: 8px;
    }
    
    .gallery-modal-content {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 8px;
        margin: 0;
        border: none;
    }
    
    .gallery-modal-image-wrapper {
        padding: 4px;
        min-height: 100px;
        max-height: 92vh;
    }
    
    .gallery-modal-image-wrapper img,
    .gallery-modal-image-wrapper video {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 4px;
    }
    
    .gallery-modal-nav {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
    
    .gallery-modal-nav.prev {
        left: 6px;
    }
    
    .gallery-modal-nav.next {
        right: 6px;
    }
    
    .gallery-modal-close {
        width: 38px;
        height: 38px;
        font-size: 22px;
        top: 8px;
        right: 10px;
    }
    
    .gallery-modal-counter {
        font-size: 11px;
        padding: 3px 12px;
        top: 10px;
        left: 10px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gallery-modal {
        padding: 4px;
    }
    
    .gallery-modal-content {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 4px;
        border: none;
        box-shadow: none;
    }
    
    .gallery-modal-image-wrapper {
        padding: 2px;
        min-height: 80px;
        max-height: 94vh;
    }
    
    .gallery-modal-image-wrapper img,
    .gallery-modal-image-wrapper video {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 2px;
    }
    
    .gallery-modal-nav {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .gallery-modal-nav.prev {
        left: 4px;
    }
    
    .gallery-modal-nav.next {
        right: 4px;
    }
    
    .gallery-modal-close {
        width: 32px;
        height: 32px;
        font-size: 18px;
        top: 6px;
        right: 8px;
    }
    
    .gallery-modal-counter {
        font-size: 10px;
        padding: 2px 10px;
        top: 8px;
        left: 8px;
    }
    
    .gallery-toggle-btn {
        padding: 10px 24px;
        font-size: var(--font-size-sm);
    }
}

/* ============================================
   ANIMACIONES PARA ZOOM
============================================ */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal.active .gallery-modal-content {
    animation: zoomIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}