/* Galería - Estilos específicos */

.gallery-hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    padding: var(--spacing-3xl) 0 var(--spacing-2xl);
    text-align: center;
    color: white;
}

.gallery-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    animation: fadeInUp 1s ease-out;
}

.gallery-hero__subtitle {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* Filtros */
.gallery-filters {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg-alt);
}

.filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--color-rosy-granite);
    color: var(--color-rosy-granite);
    transform: translateY(-2px);
}

.filter-btn--active {
    background: linear-gradient(135deg, var(--color-rosy-granite), var(--color-accent));
    color: white;
    border-color: transparent;
}

/* Grid de Galería */
.gallery-section {
    padding: var(--spacing-2xl) 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--color-bg-alt);
    animation: fadeIn 0.6s ease-out backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }

.gallery-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-item__image {
    transform: scale(1.1);
}

.gallery-item__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(107, 98, 90, 0.9) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-lg);
    color: white;
}

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

.gallery-item__title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

.gallery-item__category {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox__content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox__image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
    text-align: center;
    color: white;
    margin-top: var(--spacing-md);
    font-size: 1.1rem;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox__close {
    top: 20px;
    right: 20px;
}

.lightbox__prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox__next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__next:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox__close svg,
.lightbox__prev svg,
.lightbox__next svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .lightbox__prev,
    .lightbox__next {
        width: 40px;
        height: 40px;
    }
    
    .lightbox__prev svg,
    .lightbox__next svg {
        width: 20px;
        height: 20px;
    }
    
    .lightbox__prev {
        left: 10px;
    }
    
    .lightbox__next {
        right: 10px;
    }
}

/* Estado de filtrado */
.gallery-item.hidden {
    display: none;
}

.gallery-item.show {
    display: block;
}
