/* Thumbnails: scroll horizontal */
.gallery-wrapper {
    position: relative;
    width: 80%;
    overflow: hidden;
}

.gallery-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 1rem 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE */
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Fade izquierda y derecha */
.gallery-wrapper::before,
.gallery-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 1;
}

.gallery-wrapper::before {
    left: 0;
    background: linear-gradient(to right, white 0%, transparent 100%);
}

.gallery-wrapper::after {
    right: 0;
    background: linear-gradient(to left, white 0%, transparent 100%);
}




.gallery-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.gallery-scroll img.thumb {
    height: 80px;
    flex-shrink: 0;
    scroll-snap-align: start;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

/* Lightbox base */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
}

.lightbox .close {
    position: absolute;
    top: 1rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Navigation arrows */
.lightbox .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0 1rem;
    z-index: 1001;
}

.lightbox .nav.prev {
    left: 1rem;
}

.lightbox .nav.next {
    right: 1rem;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .gallery-wrapper {
        width: 100%;
    }
}