:root {
    --primary: #0F172A;
    --secondary: #10B981;
    --bg-light: #f6f6f6;
    --text: #334155;
    --font: 'Poppins', sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    scroll-behavior: smooth;
    font-family: var(--font);
    color: var(--text);
    background-color: #ffffff;
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6, p, a, span, div {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* HEADER Y NAVEGACIÓN AÉRO MÓDULAR */
.header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99999;
    padding: 15px 20px;
    background: transparent;
    pointer-events: none;
}

.nav-container {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Logo con azul oscuro */
.logo { 
    font-weight: 700; 
    font-size: 1.2rem; 
    white-space: nowrap; 
}
.logo span { 
    color: var(--primary); 
}

.navbar { 
    display: flex; 
    align-items: center; 
    gap: 12px;
}

/* Enlaces individuales en formato de tarjetas aero gris */
.navbar a { 
    text-decoration: none; 
    color: #ffffff; 
    font-weight: 600; 
    font-size: 0.85rem; 
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(120, 130, 140, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar a:hover { 
    background: rgba(120, 130, 140, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Modificador activado por scroll: texto negro u oscuro */
.header.scrolled .navbar a:not(.btn-acceder) {
    color: #000000 !important;
}

.btn-acceder { 
    background: var(--primary) !important; 
    color: white !important; 
    padding: 10px 22px !important; 
    border-radius: 20px !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}
.btn-acceder:hover { 
    background: var(--secondary) !important; 
    color: white !important;
}

.menu-toggle { display: none; cursor: pointer; flex-direction: column; justify-content: center; width: 30px; height: 30px; }
.bar { height: 3px; width: 25px; background: var(--primary); margin: 3px 0; transition: 0.3s; border-radius: 2px; }

/* HERO Y CARRUSEL */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    touch-action: pan-y;
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    margin-top: 40px;
}

.hero h1 { font-size: clamp(1.8rem, 5vw, 3.5rem); margin-bottom: 20px; line-height: 1.2; }
.hero p { font-size: clamp(0.95rem, 2.5vw, 1.2rem); margin-bottom: 30px; }

.carousel-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active, .dot:hover { background-color: var(--secondary); transform: scale(1.3); }

.btn-primary {
    background: var(--secondary); color: white; padding: 15px 30px; text-decoration: none; border: none;
    border-radius: 30px; font-weight: bold; cursor: pointer; transition: transform 0.3s, background 0.3s; display: inline-block;
}

.btn-primary:hover { transform: translateY(-3px); background: #0ea5e9; }
.section { padding: 80px 20px; width: 100%; }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }
.bg-light { background-color: var(--bg-light); }
.text-center { text-align: center; margin-bottom: 40px; }
.layout-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; width: 100%; }
.testimonios-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; width: 100%; }
.card { background: white; padding: 25px 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; transition: transform 0.3s; }
.card:hover { transform: translateY(-5px); border-bottom: 3px solid var(--secondary); }
.icon { font-size: 2.5rem; margin-bottom: 15px; }
.news-card { background: white; padding: 25px 20px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); width: 100%; }

.burbuja-testimonio {
    background: white; padding: 25px 20px; border-radius: 20px 20px 20px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); position: relative;
    opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; width: 100%;
}

.burbuja-testimonio.visible { opacity: 1; transform: translateY(0); }
.burbuja-testimonio img { width: 60px; height: 60px; border-radius: 50%; margin-bottom: 15px; border: 2px solid var(--secondary); }
.estrellas { color: #F59E0B; margin-bottom: 10px; }

/* ESPACIO PUBLICITARIO (CARRUSEL MARQUEE INFINITO 1:1) */
.publicidad-section {
    overflow: hidden;
    padding-bottom: 80px;
}

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    display: flex;
    position: relative;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, #ffffff, transparent);
}

.marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, #ffffff, transparent);
}

.marquee-track {
    display: flex;
    gap: 25px;
    width: max-content;
    animation: marqueeScroll 25s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.publi-item {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.publi-item:hover {
    transform: scale(1.05);
}

.publi-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* FORMULARIO Y FOOTER */
.form-container { background: white; padding: 30px 20px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); width: 100%; }
form input, form textarea { width: 100%; padding: 12px 15px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 10px; font-family: var(--font); font-size: 0.95rem; }
form input:focus, form textarea:focus { outline: none; border-color: var(--secondary); }

.footer { background: var(--primary); color: white; padding: 40px 20px; width: 100%; font-size: 14px; }
.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.social-icons a { 
    color: white; 
    text-decoration: none; 
    font-size: 1.6rem; 
    transition: color 0.3s, transform 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-icons a:hover { 
    color: var(--secondary); 
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.2);
}

.image-content img { width: 100%; border-radius: 20px; }

/* REGLAS MÓVILES */
@media (max-width: 900px) {
    .header { padding: 10px 15px; }

    .section { 
        padding: 60px 28px !important; 
    }

    .layout-2 { grid-template-columns: 1fr; gap: 35px; }
    .menu-toggle { display: flex; }

    .navbar {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        text-align: center;
        border-radius: 20px;
        padding: 20px 0;
        gap: 0;
        box-shadow: 0 10px 25px rgba(0,0,0,0.25);
        border: none;
    }

    .navbar.active { display: flex; }

    .navbar a { 
        margin: 8px 20px; 
        font-size: 1rem; 
        color: #ffffff !important; 
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0;
    }

    .header.scrolled .navbar a:not(.btn-acceder) {
        color: #ffffff !important;
    }

    .form-container, .card, .news-card, .burbuja-testimonio { 
        padding: 30px 22px; 
    }

    .grid-3, .grid-2, .testimonios-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .publi-item {
        width: 140px;
        height: 140px;
    }
}