* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --header-height: 0px; /* Se establecerá dinámicamente con JS */
}

/* FONDO CON EFECTO VIGNETTE BORROSO EN LOS BORDES */
html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #000; /* Fondo negro sólido de respaldo */
    position: relative;
}

/* Vignette borroso en los bordes laterales */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
                transparent 30%, 
                rgba(0,0,0,0.4) 70%, 
                rgba(0,0,0,0.9) 100%);
    pointer-events: none;
    z-index: 1; /* Encima del slideshow pero debajo del contenido */
}

/* FONDO BORROSO EXTENDIDO (mejorado para cubrir áreas no abarcadas por las imágenes) */
.blurred-bg {
    position: fixed;
    top: -10%; left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(30px); /* Aumenté la borrosidad para un efecto más pronunciado como borde borroso */
    transform: scale(1.2); /* Escalado mayor para extender y cubrir bordes/bordes vacíos */
    z-index: -3; /* Detrás de todo */
    transition: background-image 1.5s ease-in-out; /* Transición suave al cambiar imagen */
    opacity: 0.8; /* Ligeramente transparente para mezclar con vignette */
}

/* SLIDESHOW CENTRADO Y NÍTIDO */
.slideshow-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 5s linear;
    transform: scale(1.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide.active {
    opacity: 1;
    transform: scale(1.1);
}

.slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: brightness(0.95);
}

/* Overlay ligero para más contraste */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: -1;
}

/* HEADER SIEMPRE ARRIBA */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to right, #600000, #9D0000);
    padding: 10px 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: background 0.5s;
}

.header-fixed:hover {
    background: linear-gradient(to right, #9D0000, #600000);
}

.logo-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.logo {
    height: 60px;
    margin: 0 10px;
    transition: transform 0.3s, filter 0.3s;
    object-fit: contain;
}

.logo:hover {
    transform: rotate(5deg) scale(1.1);
    filter: brightness(1.2);
}

nav {
    width: 100%;
    background: transparent;
    padding: 12px 30px;
    display: flex;
    justify-content: flex-start;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

nav ul li {
    margin: 0 20px 0 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    font-weight: 550;
    transition: color 0.3s, transform 0.3s;
}

nav ul li a:hover {
    color: #FFD700;
    transform: translateY(-2px);
}

/* CONTENIDO ENCIMA */
.content-overlay {
    position: relative;
    height: 100vh; /* Ajustado para ocupar exactamente la viewport */
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: var(--header-height) 20px 40px;
}

.frase {
    position: absolute;
    bottom: 20px;
    left: 3%;
    color: white;
    animation: slideIn 2s ease-out;
    text-align: left;
}

.frase h2 {
    font-size: 48px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

@keyframes slideIn {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.boton-centro {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.btn-iniciar {
    background: linear-gradient(to right, #600000, #9D0000);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 15px 50px;
    cursor: pointer;
    font-size: 30px;
    transition: all 0.4s;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    animation: buttonPulse 2s infinite;
}

.btn-iniciar:hover {
    background: linear-gradient(to right, #FFD700, #FFA000);
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 16px rgba(255,215,0,0.5);
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* RESPONSIVE - Tablets y móviles (mejorado para mejor acomodo) */
@media (max-width: 768px) {
    .header-fixed {
        padding: 5px 0;
    }

    .logo {
        height: 40px;
    }

    nav {
        padding: 5px 20px;
        justify-content: center; /* Centrar nav en tablets */
    }

    nav ul li a {
        font-size: 14px;
    }

    .frase h2 {
        font-size: 28px;
        line-height: 1.1;
    }

    .btn-iniciar {
        font-size: 18px;
        padding: 10px 35px;
    }

    .content-overlay {
        height: calc(100vh - var(--header-height));
        padding: var(--header-height) 15px 15px; /* Reducir padding para caber */
        justify-content: flex-end; /* Posicionar al fondo */
    }

    .frase {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        text-align: center;
        margin-bottom: 10px; /* Espacio mínimo entre frase y botón */
    }

    .boton-centro {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        text-align: center;
    }

    .slide img {
        object-fit: contain; /* Mantiene proporciones en tablets */
    }

    .blurred-bg {
        filter: blur(25px); /* Ajuste para tablets */
        transform: scale(1.15);
    }

    .slideshow-bg,
    .overlay {
        height: 100%; /* Asegura que no desborde */
    }
}

@media (max-width: 480px) {
    .logo-container {
        flex-direction: row;
        gap: 5px;
        justify-content: center;
    }

    .logo {
        height: 30px;
        max-width: 33%; /* Ajuste para 3 logos en una línea */
    }

    nav {
        padding: 5px 10px;
        justify-content: center; /* Centrar nav en móviles */
    }

    nav ul {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    nav ul li {
        margin: 0;
    }

    nav ul li a {
        font-size: 12px;
    }

    .frase h2 {
        font-size: 20px;
        line-height: 1.0; /* Reducir para ajustar verticalmente */
    }

    .btn-iniciar {
        font-size: 16px;
        padding: 8px 25px;
        width: 100%; /* Full-width en móviles */
    }

    .content-overlay {
        height: calc(100vh - var(--header-height));
        padding: var(--header-height) 10px 10px; /* Reducir padding para caber en viewport */
        justify-content: flex-end;
        align-items: center; /* Centrar horizontalmente en móviles */
    }

    .frase {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        text-align: center;
        margin-bottom: 5px; /* Espacio mínimo para ajuste */
    }

    .boton-centro {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        text-align: center;
    }

    .slideshow-bg {
        top: var(--header-height); /* Comienza debajo del header en mobile */
        height: calc(100vh - var(--header-height)); /* Altura ajustada al área visible exacta */
    }

    .overlay {
        top: var(--header-height); /* Ajuste para overlay */
        height: calc(100vh - var(--header-height));
    }

    .slide img {
        object-fit: contain; /* Asegura que quepa sin crop en móviles */
    }

    .blurred-bg {
        filter: blur(20px); /* Menos borrosidad en móviles para rendimiento */
        transform: scale(1.3); /* Mayor escala para cubrir bordes en portrait */
    }
}