﻿.gallery {
    columns: 5;
    column-gap: 15px;
}

.gallery-item {
    display: block;
    margin-bottom: 15px;
    cursor: pointer;
    break-inside: avoid;
}

    .gallery-item img {
        width: 100%;
        border-radius: 14px;
        display: block;
        transition: all .3s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
    }

    .gallery-item:hover img {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 10px 24px rgba(0,0,0,.18);
    }

@media (max-width:1200px) {
    .gallery {
        columns: 4;
    }
}

@media (max-width:992px) {
    .gallery {
        columns: 3;
    }
}

@media (max-width:768px) {
    .gallery {
        columns: 2;
    }
}

@media (max-width:576px) {
    .gallery {
        columns: 1;
    }
}

/* **CSS del Modal Corregido** */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 102;
}
.modal {
    background-color: rgba(0, 0, 0, 0.9);
}
/* ✅ Una sola regla .modal, sin duplicado */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

/* ✅ keyframes corregido para flexbox (sin translate) */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content {
    max-width: 70vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn .25s ease;
    display: block;
}

/* Botón de cerrar */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

    .close:hover,
    .close:focus {
        color: #bbb;
        text-decoration: none;
    }

/* Flechas de navegación */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Ajuste para centrar mejor las flechas */
    width: auto;
    padding: 20px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    user-select: none;
    z-index: 101;
    background-color: rgba(0, 0, 0, 0.5);
    /* Agrega un fondo para visibilidad */
    border-radius: 20%;
    /* Los hace redondos */
}

.prev,
.next {
    top: 50%;
    transform: translateY(-50%);
}

.prev {
    left: 30px;
}

.next {
    right: 30px;
}

    .prev:hover,
    .next:hover {
        background-color: rgba(0, 0, 0, 0.8);
    }