/* --- RESET Y VARIABLES GLOBALES --- */
:root {
    --gradient-principal: linear-gradient(90deg, #0d6efd, #ff4848);
    --color-fondo: #121212;
    --color-superficie: #1e1e1e;
    --color-texto: #EAEAEA;
    --color-texto-secundario: #A0A0A0;
    --font-principal: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-principal);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    cursor: default;
}
body.nav-open {
    overflow: hidden;
}

/* --- CURSOR PERSONALIZADO --- */
.custom-cursor {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--gradient-principal);
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.2s, height 0.2s, opacity 0.2s;
    opacity: 0.5;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
    overflow: hidden;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 3rem; margin-bottom: 20px; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 50px; }
p { color: var(--color-texto-secundario); margin-bottom: 20px; }

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-principal);
    color: white;
    background-size: 200% auto;
    transition: background-position 0.5s;
}

.btn-primary:hover {
    background-position: right center;
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-texto);
    border-color: var(--color-superficie);
}

.btn-secondary:hover {
    background-color: var(--color-superficie);
    color: white;
}

/* --- TEXTO CON DEGRADADO --- */
.hero h1 span, .solution span, .service-card h3, .faq-answer-content h4 {
    background: var(--gradient-principal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease-in-out; /* << AÑADIDO para la animación */
}

/* << AÑADIDO: Clase para ocultar el header >> */
.main-header.header-hidden {
    transform: translateY(-100%);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--color-texto-secundario);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-principal);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.main-nav a:hover {
    color: var(--color-texto);
}
.main-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}


.header-cta .btn { padding: 10px 24px; }
.menu-toggle { display: none; z-index: 1001; }

/* --- HERO SECTION --- */
.hero {
    position: relative;
    padding-top: 160px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    color: var(--color-texto);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    max-width: 600px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
}

.hero-buttons { display: flex; justify-content: center; gap: 20px; }

/* --- SOCIAL PROOF --- */
.social-proof { padding-top: 0; text-align: center; }
.social-proof h3 { font-weight: 400; color: var(--color-texto-secundario); margin-bottom: 30px; }
.logos { display: flex; justify-content: center; align-items: center; gap: 50px; flex-wrap: wrap; filter: grayscale(1) brightness(1.5); opacity: 0.6; }
.logos span { font-size: 1.5rem; font-weight: 600; }

/* --- PROBLEM & SERVICES CARDS --- */
.problem-card, .service-card {
    background-color: var(--color-superficie);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.problem-card:hover, .service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 20px rgba(255, 72, 72, 0.2), 0 0 30px rgba(13, 110, 253, 0.2);
}
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; text-align: left; }
.problem-card .icon { background: var(--gradient-principal); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 20px; }
.problem-card h3 { margin-bottom: 10px; font-size: 1.3rem; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.service-card h3 { margin-bottom: 15px; font-size: 1.4rem; }

/* --- PROCESS SECTION --- */
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; position: relative; }
.process-step .number {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
    position: relative;
    background-color: var(--color-superficie);
}
.process-step .number::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--gradient-principal);
    z-index: -1;
}
.process-step h3 { font-size: 1.3rem; margin-bottom: 10px; }

/* --- CONTACT FORM SECTION --- */
.contact-section {
    position: relative;
    background-color: var(--color-superficie);
}
#contact-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.contact-content {
    position: relative;
    z-index: 2;
}
.contact-section .subtitle { text-align: center; max-width: 600px; margin: 0 auto 40px; }
.contact-form { max-width: 700px; margin: 0 auto; }
.form-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--color-texto);
    font-family: var(--font-principal);
    font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: #ff4848; }
.contact-form textarea { resize: vertical; min-height: 150px; }
.form-submit { text-align: center; }
#form-message { text-align: center; margin-top: 20px; font-weight: 600; display: none; }

/* --- FAQ SECTION --- */
.faq-layout {
    display: flex;
    gap: 50px;
    min-height: 300px;
}
.faq-questions-column {
    flex: 1;
}
.faq-question-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 20px;
    margin-bottom: 15px;
    background-color: var(--color-superficie);
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--color-texto-secundario);
    font-family: var(--font-principal);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}
.faq-question-btn:hover {
    color: var(--color-texto);
    transform: translateX(5px);
}
.faq-question-btn.active {
    color: var(--color-texto);
    border-image: var(--gradient-principal) 1;
}
.faq-answers-column {
    flex: 1.5;
    position: relative;
}
.faq-answer-content {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    position: absolute;
}
.faq-answer-content.active {
    display: block;
    opacity: 1;
}
.faq-answer-content h4 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* --- FOOTER --- */
.main-footer { padding: 60px 0; background-color: var(--color-superficie); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-col {
    display: flex;
    flex-direction: column;
}
.logo-footer img {
    height: 60px;
    width: auto;
    margin-bottom: 15px;
}
.footer-col h4 { font-size: 1.2rem; margin-bottom: 20px; }
.footer-col p { margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { color: var(--color-texto-secundario); text-decoration: none; transition: color 0.3s ease; }
.footer-col ul a:hover { color: #ff4848; }
.copyright { text-align: center; padding: 20px 0; margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); color: var(--color-texto-secundario); font-size: 0.9rem; }



/* ================================================= */
/* ---             RESPONSIVE DESIGN             --- */
/* ================================================= */

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .logo-footer img { margin-left: auto; margin-right: auto; }
    .process-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .header-cta { display: none; }
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: white;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: var(--color-fondo);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }
    .main-nav.nav-open {
        transform: translateX(0);
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .main-nav a {
        font-size: 1.5rem;
    }
    
    .form-group-grid { grid-template-columns: 1fr; }

    .faq-layout {
        flex-direction: column;
        min-height: auto;
    }
    .faq-answers-column {
        position: static;
        margin-top: 20px;
    }
    .faq-answer-content {
        position: static;
        opacity: 1;
        transition: none;
    }
    .faq-answer-content:not(.active) {
        display: none;
    }

    .chat-widget {
        bottom: 95px;
        right: 15px;
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-height: none;
    }
    .floating-buttons {
        right: 15px;
        bottom: 20px;
    }
}

@media (max-width: 576px) {
    .hero-buttons { flex-direction: column; }
}
