/* Galería */
.gallery-section {
    min-height: 600px;
}

/* Lightbox Mejorado */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(36,1,41,0.92);
    backdrop-filter: blur(0px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(27, 77, 62, 0.3);
    border: 3px solid var(--pb-green-custom);
    background: #fff;
    object-fit: contain;
    transform: scale(0.8);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 32px;
    right: 32px;
    font-size: 2.2rem;
    color: var(--pb-gold);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100000;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.3);
    color: white;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 100001;
    transition: background-color 0.3s ease;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.6);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    position: relative;
    min-height: 400px;
}

/* Skeleton Loading */
.skeleton-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    height: 200px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Gallery Item con Animación de Entrada */
.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    border: 2px solid transparent;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delay para cada item */
.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:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-item:nth-child(12) { animation-delay: 0.6s; }

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    z-index: 1;
    border-radius: 15px;
}

.gallery-item::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: white;
    font-size: 2rem;
    z-index: 2;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover::before {
    background: rgba(0, 0, 0, 0.5);
}

.gallery-item:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-item:hover {
    box-shadow: 0 8px 32px rgba(27, 77, 62, 0.4), 0 0 20px rgba(27, 77, 62, 0.2);
    border: 2px solid var(--pb-green-custom);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease, filter 0.3s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 42, 47, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}
