/* ===================================
   CAPTURAS - GALERÍA DE SISTEMA
   =================================== */


/* SECCIÓN DE GALERÍA */

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 18px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


/* GRID DE IMÁGENES */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}


/* ITEM DE LA GALERÍA */

.gallery-item {
    opacity: 1;
    transition: opacity 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.gallery-item.hidden {
    display: none !important;
}

.gallery-item-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 16 / 10;
}

.gallery-item:hover .gallery-item-wrapper {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.gallery-img {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.btn-expand {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-expand:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px 15px 10px;
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    transform: translateY(10px);
    opacity: 0;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}


/* MODAL DE GALERÍA */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 60%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@media (max-width: 768px) {
    .gallery-modal-content {
        max-width: 95vw;
        max-height: 85vh;
    }
}


/* BOTÓN CERRAR */

.gallery-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}


/* IMAGEN PRINCIPAL */

.gallery-modal-image {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 300px;
}

#modalImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* CONTROLES DE NAVEGACIÓN */

.gallery-modal-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.gallery-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav-btn:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

.gallery-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.gallery-indicators {
    flex: 1;
    text-align: center;
}

.image-counter {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}


/* INFORMACIÓN DE LA IMAGEN */

.gallery-modal-info {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #ddd;
}

.modal-caption {
    margin: 0;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}


/* THUMBNAILS */

.gallery-thumbnails {
    background: white;
    border-top: 1px solid #ddd;
    padding: 15px;
    max-height: 120px;
    overflow-y: auto;
}

.thumbnails-container {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.gallery-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail:hover {
    border-color: var(--primary);
}

.gallery-thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}


/* OVERLAY DE FONDO */

.gallery-overlay-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    animation: fadeIn 0.3s ease;
}

.gallery-overlay-backdrop.active {
    display: block;
}


/* ANIMACIONES */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* RESPONSIVE */

@media (max-width: 768px) {
    .gallery-filters {
        margin-bottom: 30px;
    }
    .gallery-hero .section-title {
        font-size: 1.8rem;
    }
    .gallery-hero .section-subtitle {
        font-size: 0.95rem;
    }
    .gallery-modal-content {
        border-radius: 8px;
    }
    .gallery-modal-controls {
        padding: 15px;
    }
    .gallery-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .image-counter {
        font-size: 0.85rem;
    }
}