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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(circle at center, #151530, #0c0c1f 70%);
    color: #fff;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(255,0,168,0.45), transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(0,229,255,0.45), transparent 40%),
        radial-gradient(circle at 50% 40%, rgba(123,92,255,0.35), transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(255,208,0,0.3), transparent 45%),
        radial-gradient(circle at 70% 20%, rgba(0,255,180,0.25), transparent 50%);
    filter: blur(90px);
    animation: ambientMove 18s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 3px 3px;
    opacity: 0.25;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

@keyframes ambientMove {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-40px, -25px); }
}

/* ================= NAVBAR (FIJA PARA WEB) ================= */
.navbar {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%; 
    box-sizing: border-box;
    z-index: 1000;   
    background: rgba(10,10,20,0.85); 
    backdrop-filter: blur(14px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.3); 
}

.logo {
   max-height: 100px; 
   width: auto;
}

.navbar ul {
    display: flex;
    gap: 28px;
    list-style: none;
}

.navbar a {
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
    position: relative;
    transition: 0.3s;
}

.navbar a:hover {
    color: #fff;
}

.navbar a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    left: 0;
    bottom: -6px;
    background: #FF00A8;
    transition: 0.3s;
}

.navbar a:hover::after {
    width: 100%;
}

/* ================= HERO ================= */
.hero {
    position: relative;
    min-height: 100vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 150px 20px 60px 20px; 
    box-sizing: border-box;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0,0,0,0.3),
        rgba(0,0,0,0.7)
    );
}

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

.hero h1 {
    font-size: clamp(38px, 6vw, 72px);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(
        270deg,
        #00E5FF,
        #7B5CFF,
        #FF00A8,
        #FFD000,
        #00E5FF
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 8s ease infinite;
    filter: drop-shadow(0 0 15px rgba(255,0,168,0.4))
            drop-shadow(0 0 30px rgba(0,229,255,0.3))
            drop-shadow(0 0 60px rgba(123,92,255,0.25));
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 50%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 50%; }
    100% { background-position: 0% 50%; }
}

.slogan {
    font-size: 17px;
    opacity: 0.8;
}

.slogan span {
    color: #FF00A8;
}

.btn {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 40px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(45deg,#FF00A8,#00E5FF);
    transition: 0.3s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255,0,168,0.4);
}

/* ================= SECCIONES (CORREGIDO PARA EL MENÚ FIJO) ================= */
section {
    padding: 110px 60px;
    text-align: center;
    position: relative;
    z-index: 1;
    scroll-margin-top: 130px; /* 👈 CLAVE: Evita que el menú tape el título al hacer scroll */
}

section h2 {
    font-size: 36px;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 90px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg,#FF00A8,#00E5FF,#FFD000);
    background-size: 200%;
    animation: lineFlow 4s linear infinite;
}

/* ================= GRID ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 28px;
}

/* ================= CARDS ================= */
.card {
    background: rgba(20,20,30,0.6);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.4s;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card h3 {
    padding: 18px;
    font-size: 18px;
    color: #FFD000;
}

.card p {
    padding: 0 18px 20px;
    color: #bbb;
    font-size: 14px;
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow:
        0 0 25px rgba(255,0,168,0.2),
        0 0 40px rgba(0,229,255,0.15);
}

/* ================= FEATURES ================= */
.features-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
}

.feature {
    max-width: 300px;
}

.feature h3 {
    color: #FFD000;
}

/* ================= GALERÍA ================= */
.gallery-intro {
    max-width: 700px;
    margin: 0 auto 20px;
    color: #bbb;
    font-size: 15px;
}

.gallery-grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 18px;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

.gallery img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 12px;
    transition: 0.4s;
    filter: brightness(0.9);
}

.gallery img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ================= CLIENTES ================= */
.client-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.client-logos img {
    width: 200px;
    height: 120px;
    object-fit: contain;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    filter: grayscale(100%);
    transition: 0.3s;
}

.client-logos img:hover {
    filter: grayscale(0%);
}

/* ================= FOOTER ================= */
footer {
    padding: 50px 20px;
    text-align: center;
    background: linear-gradient(180deg, #0f0c29, #1b1b2f);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

footer h3 {
    margin-bottom: 15px;
    letter-spacing: 2px;
    font-weight: 700;
}

.social-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.social-links a {
    color: #ffffff;
    font-size: 28px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    transform: translateY(-8px) scale(1.2);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.social-links a:nth-child(1):hover { color: #1877f2; } 
.social-links a:nth-child(2):hover { color: #e1306c; } 
.social-links a:nth-child(3):hover { color: #ffffff; } 
.social-links a:nth-child(4):hover { color: #0077b5; } 

@media (max-width: 480px) {
    .social-links { gap: 20px; }
    .social-links a { font-size: 24px; }
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float img {
    width: 60%;
    height: 60%;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #128c7e;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes lineFlow {
    from { background-position: 0%; }
    to { background-position: 200%; }
}
/* --- ESTILO DEL BOTÓN HAMBURGUESA - MOBIL --- */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px auto;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* --- RESPONSIVE CORREGIDO --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        margin-left: auto; 
        margin-right: 10px; 
        transform: scale(0.7); 
        cursor: pointer;
        background: transparent;
        border: none;
        padding: 0;
    }

    .navbar {
        padding: 10px 15px; 
        position: fixed;    
        top: 0;             
        left: 0;            
        width: 100%;        
        z-index: 1000;      
        background: rgba(9, 9, 17, 0.95); 
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Ocultamos los enlaces del menú horizontal de forma tradicional para no romper el JS */
    .navbar ul {
        display: none; 
    }

    /* 2. Lógica del menú desplegable cuando se activa con JavaScript */
    .main-nav.active ul {
        display: flex;
        flex-direction: column;
        position: fixed;    
        top: 70px;          
        left: 0;
        width: 100%;
        background: rgba(9, 9, 17, 0.98); 
        padding: 40px 0;    
        align-items: center;
        gap: 25px;
        z-index: 998;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        height: calc(100vh - 70px); 
        list-style: none;
    }

    .hero {
        padding-top: 130px; 
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        margin-top: 0; 
    }

    .hero h1 {
        font-size: 2.5rem; 
        margin-bottom: 20px;
    }

    /* CORRECCIÓN DEL LOGO: Forzamos el ancho automático para que no se distorsione en Contacto/Nosotros */
    .logo {
        max-height: 50px; 
        width: auto !important; 
        margin-left: 10px;
        display: block;
    }

    .grid { 
        grid-template-columns: 1fr; 
    }
    
    section {
        padding: 60px 20px;
        scroll-margin-top: 80px; 
    }
}