/* --- Estructura Base --- */
.hexa-bg-wrapper {
    width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Cambiado a visible para evitar recortes */
    clear: both;
}

.hexa-bg-wrapper.is-full-width {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.hexa-container {
    box-sizing: border-box;
    padding: 0 15px;
}

.hexa-slide {
    display: none;
    gap: 15px;
    animation: hexaFade 0.7s ease;
}

.hexa-slide.active {
    display: grid;
}

.hexa-item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

/* --- LIGHTBOX: EL SECRETO PARA QUE SEA FLOTANTE --- */
#hexa-lightbox {
    position: fixed; /* Esto hace que flote respecto a la pantalla, no al contenido */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Fondo casi negro */
    display: none; /* Se activa con JS */
    align-items: center;
    justify-content: center;
    z-index: 99999999 !important; /* Prioridad máxima sobre Elementor y Temas */
    cursor: zoom-out;
}

/* Clase que añade el JS para mostrarlo */
#hexa-lightbox.visible {
    display: flex;
    animation: hexaFadeIn 0.3s ease;
}

#hexa-lb-img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,1);
}

.hexa-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 60px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* --- Animaciones --- */
@keyframes hexaFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hexaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsivo */
@media (max-width: 768px) {
    .hexa-slide { grid-template-columns: repeat(2, 1fr) !important; }
    .hexa-close { top: 15px; right: 20px; font-size: 45px; }
}

.hexa-slide {
    display: none;
    gap: 15px;
    opacity: 0;
}

.hexa-slide.active {
    display: grid;
    animation: hexaFade 0.8s ease forwards;
}

@keyframes hexaFade {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}