/* ===== CONTENEDOR PRINCIPAL DE LA GALERÍA ===== */
.galeria_imagenes {
    display: grid;
    /* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); */
    gap: 1.5rem;
    flex: 1 1 0;
    min-width: 280px;
    grid-template-columns: repeat(3, 1fr);
    
}

/* ===== CADA CONTENEDOR DE IMAGEN ===== */
.contenedor_imagenes {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0px 0px 7px 6px hsla(0, 0%, 0%, 0.499);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    aspect-ratio: 4/3; /* Ajusta según tus imágenes */
    border: 2px solid rgba(250, 250, 250, 0.542);
}

.contenedor_imagenes:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

/* ===== IMAGEN DENTRO DEL CONTENEDOR ===== */
.contenedor_imagenes img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* Para que todas las imágenes mantengan proporción */
    display: block;
    transition: transform 0.5s ease;
}

.contenedor_imagenes:hover img {
    transform: scale(1.05);
}

/* ===== TEXTO "Galería:" ===== */
.galeria_imagenes + span {
    display: block;
    font-size: 1.8rem;
    color: var(--primary-color, #2563eb);
    margin: 1rem 0;
    font-weight: 600;
}

/* ===== RESPONSIVE ===== */

/* 2 columnas desde 1200px hasta muy pequeño */
@media (max-width: 1200px) {
    .galeria_imagenes {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 768px) {
    .galeria_imagenes {
        /* grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); */
        gap: 1rem;
        flex-direction: column;
    }
}


/* 1 columna solo en móvil muy pequeño */
@media (max-width: 480px) {
    .galeria_imagenes {
        grid-template-columns: 1fr;
        /* grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); */
        gap: 0.8rem;
    }
}

/* ===== MODO OSCURO ===== */
.dark-mode .contenedor_imagenes {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.dark-mode .contenedor_imagenes:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.7);
}



/* ===== LIGHTBOX BASE ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
}

.lightbox.mostrar {
    display: block;  /* Usamos block para control total */
}

/* ===== CONTADOR ===== */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 1rem;
    z-index: 10002;
}

/* ===== FLECHAS ===== */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* ===== CONTENEDOR DE LA IMAGEN ===== */
.lightbox-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

/* ===== IMAGEN ===== */
#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.15);
    transition: opacity 0.15s ease;
    opacity: 1;
}

#lightbox-img.cambiando {
    opacity: 0;
}

/* ===== TEXTO DESCRIPTIVO (DEBAJO, FIJO) ===== */
.lightbox-description {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    max-width: 80%;
    text-align: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

/* ===== BOTONES SUPERIORES ===== */
.lightbox-header {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 15px;
    z-index: 10002;
}

.lightbox-close,
.lightbox-fullscreen,
.lightbox-lupa {
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: rgba(175, 82, 82, 0.74);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: rotate(90deg);
}

.lightbox-fullscreen:hover {
    background: rgba(76, 175, 80, 0.3);
    transform: scale(1.1);
}

.lightbox-lupa:hover {
    background: rgba(255, 193, 7, 0.3);
    transform: scale(1.1);
}


/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .lightbox-image-container {
        width: 95vw;
        height: 60vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 30px;
    }

    .lightbox-description {
        bottom: 20px;
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
        max-width: 90%;
    }

    .lightbox-header {
        top: 10px;
        right: 10px;
        gap: 10px;
    }

    .lightbox-close,
    .lightbox-fullscreen,
    .lightbox-lupa {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .lightbox-counter {
        top: 15px;
        left: 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .lightbox-prev, .lightbox-next {
        display: none;
    }
}