/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    /* PALETA DE COLORES */
    --color-bg: #eef2f6;           
    --color-card-bg: #ffffff;      
    
    --color-text-main: #1f2937;    
    --color-text-light: #64748b;   
    
    --color-accent: #49cbda;       
    --color-accent-dark: #3aa8b5;  
    
    /* HEADER & FOOTER */
    --color-header-bg: #0f172a;    
    --color-header-text: #f1f5f9;  
    
    /* WHATSAPP */
    --color-whatsapp: #25D366;

    /* SOMBRAS Y BORDES */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-card: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* =========================================
   2. HEADER
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-header-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo { max-height: 45px; transition: transform 0.3s ease; }
.logo:hover { transform: scale(1.05); }

.navbar { display: flex; gap: 2rem; transition: all 0.3s ease; }
.navbar a {
    text-decoration: none;
    color: var(--color-header-text);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}
.navbar a:hover { color: var(--color-accent); background: rgba(255, 255, 255, 0.05); }

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-header-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* =========================================
   3. ROBOT STICKY (LÓGICA CSS)
   ========================================= */

.hero-wrapper {
    position: relative;
    width: 100%;
}

.robot-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10; 
}

.robot-sticky-box {
    position: sticky;
    top: 0;
    height: 100vh; 
    width: 100%;
    display: block; 
    overflow: hidden; 
}

spline-viewer {
    width: 100%;
    height: calc(100vh + 150px);
    pointer-events: auto; 
    transform: translateY(-60px);
}


/* =========================================
   4. SECCIÓN INICIO
   ========================================= */
.inicio {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden; 
    background: linear-gradient(90deg, var(--color-bg) 30%, rgba(238, 242, 246, 0.01) 100%),
                url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=2072&auto=format&fit=crop') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; 
}

.inicio::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(73, 203, 218, 0.1) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(73, 203, 218, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

.inicio-content {
    max-width: 600px;
    z-index: 2; 
    position: relative;
    margin-right: auto; 
}

.inicio h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--color-text-main);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 0 20px rgba(238, 242, 246, 0.9); 
}

.highlight-text {
    color: var(--color-accent);
    position: relative;
    display: inline-block;
    text-shadow: none;
}

.description {
    font-size: 1.25rem;
    color: var(--color-text-main);
    margin-bottom: 2.5rem;
    max-width: 90%;
    font-weight: 500;
}

.buttons { display: flex; gap: 1rem; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-accent);
    color: #fff;
    padding: 0.9rem 2.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(73, 203, 218, 0.3);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--color-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(73, 203, 218, 0.5);
}

/* =========================================
   5. SECCIÓN SERVICIOS
   ========================================= */
.servicios-section {
    padding: 120px 5%;
    display: flex;
    justify-content: flex-end; 
    position: relative;
    min-height: 100vh;
    align-items: center;
}

.servicios-content {
    width: 100%;
    max-width: 600px;
    text-align: right; 
    z-index: 2; 
}

.section-title {
    font-size: 2.5rem;
    color: var(--color-text-main);
    margin-bottom: 2.5rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--color-accent);
    margin-top: 10px;
    border-radius: 2px;
}
.servicios-content .section-title::after { margin-left: auto; }

.servicios-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-end;
}

.servicio-card {
    background: var(--color-card-bg);
    padding: 2rem;
    border-radius: var(--radius-card);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.servicio-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-accent);
}

.icon-box {
    font-size: 1.8rem;
    background-color: #f0fdff;
    color: var(--color-accent);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.servicio-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--color-text-main); }
.servicio-card p { font-size: 0.95rem; color: var(--color-text-light); }

/* =========================================
   6. SECCIÓN PROCESO (OSCURA)
   ========================================= */
.proceso-section {
    padding: 100px 5%;
    background-color: var(--color-header-bg); 
    position: relative;
}

.inner-container { max-width: 1200px; margin: 0 auto; }
.center-title { display: block; text-align: center; }
.center-title::after { margin: 10px auto; }

.proceso-section .section-title { color: #ffffff; }
.proceso-section .section-subtitle { 
    text-align: center; 
    font-size: 1.1rem; 
    color: #cbd5e1; 
    margin-top: -1.5rem; 
    margin-bottom: 3rem; 
}

.proceso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.proceso-step {
    background: #1e293b; 
    padding: 2rem;
    border-radius: var(--radius-card);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: relative;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.05);
}
.proceso-step:hover { 
    transform: translateY(-5px); 
    border-color: var(--color-accent); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.step-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(73, 203, 218, 0.1);
    position: absolute;
    top: 5px; right: 15px;
    pointer-events: none;
}
.proceso-step h3 { font-size: 1.3rem; margin-bottom: 0.8rem; color: #ffffff; }
.proceso-step p { color: #94a3b8; font-size: 0.95rem; }

/* =========================================
   7. SECCIÓN PRODUCTOS
   ========================================= */
.productos-section { padding: 120px 5%; }
.productos-container { max-width: 1100px; margin: 0 auto; }

.producto-card-featured {
    background: var(--color-card-bg);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 4rem;
    overflow: hidden;
}

.producto-info { flex: 1; }
.producto-info h3 { font-size: 2rem; margin-bottom: 1rem; color: var(--color-accent); }
.producto-info p { font-size: 1.1rem; color: var(--color-text-light); margin-bottom: 1.5rem; }
.producto-features { list-style: none; margin-bottom: 2rem; }
.producto-features li { font-size: 1rem; margin-bottom: 0.8rem; color: var(--color-text-main); }
.producto-image { flex: 1.2; }
.producto-image img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); transition: transform 0.4s ease; }
.producto-image:hover img { transform: scale(1.02); }

/* =========================================
   8. SECCIÓN FAQ (PARALLAX)
   ========================================= */
.faq-section { 
    padding: 120px 5%; 
    background: 
        linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95)),
        url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?q=80&w=2070&auto=format&fit=crop') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; 
}

.faq-container { max-width: 800px; margin: 0 auto; }
.faq-section .section-title { color: #ffffff; }

.faq-item {
    background: var(--color-card-bg);
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.faq-item summary {
    padding: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
    color: var(--color-text-main);
    padding-right: 3rem;
}
.faq-item summary::after {
    content: '+';
    position: absolute; right: 20px; top: 50%;
    transform: translateY(-50%);
    color: var(--color-accent);
    font-size: 1.5rem;
}
.faq-item[open] summary::after { content: '-'; }
.faq-item p { padding: 0 1.2rem 1.2rem; color: var(--color-text-light); font-size: 0.95rem; border-top: 1px solid #eee; margin-top: 0.5rem; padding-top: 1rem; }

/* =========================================
   9. CONTACTO
   ========================================= */
.contacto-section { 
    padding: 100px 5%; 
    text-align: center;
    background-color: transparent;
}

.contacto-container { max-width: 600px; margin: 0 auto; }
.contacto-sub { color: var(--color-text-light); margin-bottom: 2.5rem; }

.contacto-form {
    background: var(--color-card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}
.input-group { margin-bottom: 1.5rem; }
.contacto-form input, .contacto-form textarea {
    width: 100%; padding: 1rem;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
}
.contacto-form input:focus, .contacto-form textarea:focus {
    outline: none; border-color: var(--color-accent); background: #fff;
}
.full-width { width: 100%; }

/* =========================================
   10. FOOTER COMPACTO
   ========================================= */
.footer {
    background-color: #0f172a; 
    color: #94a3b8;
    /* Reduje el padding vertical para aplastarlo */
    padding: 0.8rem 5% 0.5rem; 
    margin-top: 2rem; 
}

.footer-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; 
    padding-bottom: 0.5rem; 
    border-bottom: 1px solid #1e293b;
}

.footer-logo img { 
    /* Logo más pequeño (70px) */
    width: 70px; 
    opacity: 0.9; 
}

.footer-contact h4 { 
    color: var(--color-accent); 
    margin-bottom: 0.2rem; 
    font-size: 0.9rem;
}
.footer-contact p {
    font-size: 0.85rem;
    margin: 0; /* Sin margen para juntar líneas */
}
.footer-contact a { color: #e2e8f0; text-decoration: none; transition: color 0.3s; }
.footer-contact a:hover { color: var(--color-accent); }

.footer-bottom { 
    text-align: center; 
    padding-top: 0.5rem; 
    font-size: 0.75rem; 
    color: #64748b; 
}

/* =========================================
   11. BOTÓN FLOTANTE WHATSAPP
   ========================================= */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-whatsapp);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: transform 0.3s ease;
    text-decoration: none;
}
.whatsapp-btn:hover {
    transform: scale(1.1);
    background-color: #20bd5a;
}

/* =========================================
   12. RESPONSIVE (Media Queries)
   ========================================= */

/* AJUSTE INTERMEDIO ROBOT (1024px - 1350px) */
@media (max-width: 1350px) {
    spline-viewer {
        transform: translate(-120px, -60px);
    }
}

/* TABLETS Y MÓVILES (Menos de 1024px) */
@media (max-width: 1024px) {
    
    .robot-overlay { display: none !important; }
    .hero-wrapper { height: auto; display: block; }

    .inicio-content {
        margin: 0 auto;       
        text-align: center;   
        max-width: 100%;      
        padding-top: 2rem;
    }
    .inicio h1 { font-size: 2.8rem; }
    .buttons { justify-content: center; }

    .servicios-section {
        justify-content: center;
        padding-top: 4rem;
        min-height: auto;
    }

    .servicios-content {
        text-align: center;
        max-width: 100%;
        margin: 0 auto;
    }
    .servicios-content .section-title::after { margin: 10px auto; }
    .servicios-grid { align-items: center; }
    .servicio-card { align-items: center; text-align: center; max-width: 100%; }

    .producto-card-featured {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
        gap: 2rem;
    }
    .producto-image { width: 100%; }
}

/* MÓVILES (Menos de 768px) */
@media (max-width: 768px) {
    
    .menu-toggle { display: block; }

    .navbar {
        display: none; 
        position: absolute;
        top: 100%; left: 0; width: 100%;
        background-color: var(--color-header-bg);
        flex-direction: column; gap: 0; padding: 1rem 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.2);
    }
    
    .navbar.active { display: flex; animation: fadeIn 0.3s ease; }

    .navbar a {
        display: block; padding: 1rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: 0; width: 100%; text-align: center;
    }

    .inicio h1 { font-size: 2.2rem; }
    
    /* Ajuste Footer en móvil */
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
    .footer-logo img { margin-bottom: 0.5rem; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}