/* GALERÍA MACOSEVIAL - Masonry Layout */

/* === HERO GALERÍA === */
.gallery-hero {
    background: linear-gradient(135deg, var(--primary-black) 0%, #2c2c2c 100%);
    padding: 120px 0 80px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 107, 0, 0.03) 10px,
        rgba(255, 107, 0, 0.03) 20px
    );
    pointer-events: none;
}

.gallery-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.gallery-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* === FILTROS === */
.gallery-filters {
    background: var(--white);
    padding: var(--spacing-lg) 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px;
    z-index: 100;
}

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

.filter-btn {
    padding: 12px 28px;
    background: transparent;
    border: 2px solid var(--gray-medium);
    color: var(--gray-dark);
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
}

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

.filter-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

/* === GALERÍA MASONRY === */
.gallery-section {
    padding: 60px 0 100px;
    background: #f8f8f8;
}

.masonry-grid {
    column-count: 4;
    column-gap: 20px;
    margin: 0 auto;
}

/* Responsive columns */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* === MASONRY ITEMS === */
.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

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

/* Stagger animation delays */
.masonry-item:nth-child(1) { animation-delay: 0.05s; }
.masonry-item:nth-child(2) { animation-delay: 0.1s; }
.masonry-item:nth-child(3) { animation-delay: 0.15s; }
.masonry-item:nth-child(4) { animation-delay: 0.2s; }
.masonry-item:nth-child(5) { animation-delay: 0.25s; }
.masonry-item:nth-child(6) { animation-delay: 0.3s; }
.masonry-item:nth-child(7) { animation-delay: 0.35s; }
.masonry-item:nth-child(8) { animation-delay: 0.4s; }

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

.masonry-item.hidden {
    display: none;
}

.masonry-item img,
.masonry-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.masonry-item:hover img,
.masonry-item:hover video {
    transform: scale(1.05);
}

/* Video play overlay */
.masonry-item.video-item::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 107, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    opacity: 0.8;
    transition: all 0.3s ease;
    pointer-events: none;
}

.masonry-item.video-item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* === LIGHTBOX === */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

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

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox-content video {
    background: #000;
}

/* Lightbox controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(255, 107, 0, 0.9);
    color: white;
    border: none;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    border-radius: 50%;
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    line-height: 1;
}

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

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

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-orange);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Counter */
.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 107, 0, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-family: var(--font-heading);
    font-weight: 600;
    z-index: 10001;
}

/* Loading state */
.masonry-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 100px 20px;
    color: var(--gray-medium);
}

.gallery-empty h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .gallery-hero h1 {
        font-size: 2.5rem;
    }

    .gallery-hero {
        padding: 100px 0 60px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .masonry-item.video-item::after {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-hero h1 {
        font-size: 2rem;
    }

    .gallery-hero p {
        font-size: 1rem;
    }

    .masonry-grid {
        column-gap: 15px;
    }

    .masonry-item {
        margin-bottom: 15px;
    }
}

/* Keyboard navigation hint */
.lightbox-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-family: var(--font-body);
    z-index: 10001;
    animation: fadeOut 3s ease forwards;
}

@keyframes fadeOut {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; }
}
