/* ============================================================
   LIGHTBOX — VISOR OSCURO
   ============================================================ */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 70px 20px 20px 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
    touch-action: none;
}

.lightbox.activo {
    display: flex;
    opacity: 1;
}

.imagen-lightbox {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.texto-lightbox {
    display: none;
}

.contador-lightbox {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    letter-spacing: 3px;
    z-index: 10001;
    user-select: none;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 14px;
}

.cerrar {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    background: none;
    border: none;
    padding: 5px 15px;
    transition: color 0.2s ease;
    font-weight: 300;
}

.cerrar:hover {
    color: #d4b98c;
}

.anterior,
.siguiente {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    user-select: none;
    z-index: 10000;
    background: none;
    border: none;
    padding: 15px 20px;
    transition: color 0.2s ease;
}

.anterior:hover,
.siguiente:hover {
    color: #d4b98c;
}

.anterior {
    left: 20px;
}

.siguiente {
    right: 20px;
}

.pantalla-completa {
    position: absolute;
    top: 15px;
    left: 25px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    background: none;
    border: none;
    padding: 8px 14px;
    transition: color 0.2s ease;
    display: none;
}

.pantalla-completa.visible {
    display: block;
}

.pantalla-completa:hover {
    color: #d4b98c;
}

.cerrar:focus-visible,
.anterior:focus-visible,
.siguiente:focus-visible,
.pantalla-completa:focus-visible {
    outline: 2px solid #d4b98c;
    outline-offset: 4px;
}

/* ============================================================
   PANTALLA COMPLETA
   ============================================================ */

.lightbox:fullscreen {
    padding: 60px 20px 20px 20px;
}

.lightbox:-webkit-full-screen {
    padding: 60px 20px 20px 20px;
}

.lightbox:fullscreen .imagen-lightbox {
    max-width: 100vw;
    max-height: 100vh;
}

.lightbox:-webkit-full-screen .imagen-lightbox {
    max-width: 100vw;
    max-height: 100vh;
}

/* ============================================================
   MÓVIL
   ============================================================ */

@media (max-width: 768px) {

    .lightbox {
        padding: 60px 10px 10px 10px;
    }

    .imagen-lightbox {
        max-width: 95vw;
        max-height: 75vh;
    }

    .anterior,
    .siguiente {
        display: none;
    }

    .contador-lightbox {
        top: 15px;
        font-size: 10px;
        padding: 3px 10px;
    }

    .cerrar {
        top: 5px;
        right: 10px;
        font-size: 28px;
    }

    .pantalla-completa {
        top: 5px;
        left: 10px;
        font-size: 16px;
    }

    .lightbox:fullscreen .imagen-lightbox,
    .lightbox:-webkit-full-screen .imagen-lightbox {
        max-height: 100vh;
    }
}