/**
 * BEM-WEB_CLAUD - Sistema de Estilos
 * Diseño Tech Minimalista (Vercel/OpenAI style)
 */

 :root {
    /* Paleta de Colores Base */
    --bg-primary: #FAFAFA;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-subtle: #E5E7EB;
    
    /* Color de Acento (Electric Indigo Tech) */
    --accent: #6366F1;
    --accent-hover: #4F46E5;
    --accent-light: rgba(99, 102, 241, 0.1);

    /* Tipografía */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

    /* Espaciado de Sección */
    --section-px: 5%;
    --section-py: 80px;
    
    /* Efectos */
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESETS --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }

/* --- UTILIDADES --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--section-px);
}

/* --- COMPONENTES BÁSICOS --- */
/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 99px; /* Pill shape para tech moderno */
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-body);
}

.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

.btn-primary {
    background: var(--text-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.btn i { font-size: 1.1em; }

/* Textos */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.text-highlight {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 20px 0;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 15px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}
.logo i { color: var(--accent); font-size: 1.5rem; }

.nav-links {
    display: flex;
    gap: 32px;
}
.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.nav-link:hover { color: var(--text-primary); }

/* --- HERO SECTION --- */
.hero {
    position: relative;
    padding-top: 140px;
    padding-bottom: 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Efecto Vercel Glow Background */
.hero-glow {
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, rgba(250,250,250,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1f 0.9fr;
    gap: 60px;
    align-items: center;
}

/* Contenido Hero */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.badge-icon { color: var(--accent); display: flex; align-items: center; }

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 90%;
}

.hero-cta { margin-bottom: 48px; }
.cta-microcopy {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-left: 8px;
}

/* Social Proof */
.social-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.tech-stack {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #9CA3AF;
    transition: var(--transition);
}
.tech-item:hover { color: var(--text-primary); }

/* --- HERO VISUAL (CSS ART) --- */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    width: 100%;
    overflow: hidden;
}

/* --- N8N CANVAS HERO VISUAL --- */
.n8n-board {
    width: 100%;
    height: 420px;
    display: flex;
    flex-direction: column;
}

.n8n-header {
    background: rgba(243, 244, 246, 0.9);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.board-title {
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-secondary);
    font-weight: 500;
}

.n8n-canvas {
    flex: 1;
    position: relative;
    background-color: rgba(255, 255, 255, 0.6);
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 20px;
    overflow: hidden;
}

.n-node {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
    min-width: 155px;
    transition: var(--transition);
}

.n-node:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.n-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.1rem; color: white;
}

.n-desc strong { display: block; font-size: 0.85rem; color: var(--text-primary); }
.n-desc span { display: block; font-size: 0.7rem; color: var(--text-secondary); }

.connector-in, .connector-out {
    position: absolute; width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid #D1D5DB; z-index: 3;
}
.connector-in { left: -6px; top: 50%; transform: translateY(-50%); }
.connector-out { right: -6px; top: 50%; transform: translateY(-50%); }
.connector-out.out-top { top: 35%; }
.connector-out.out-bottom { top: 65%; }

/* Nodos Posiciones */
.node-trigger { top: 40%; left: 5%; }
.node-ai { top: 40%; left: 38%; }
.node-crm { top: 15%; left: 70%; }
.node-msg { top: 65%; left: 70%; }

/* Cables de Conexión (CSS Art) */
.n-wire { z-index: 1; }
.wire-path { stroke: #D1D5DB; stroke-width: 2px; }

.w1 { top: 48%; left: 28.5%; width: 9%; height: 10px; } /* trigger to ai */
.w2 { top: 25%; left: 63%; width: 7%; height: 60px; } /* ai to crm */
.w3 { top: 48%; left: 63%; width: 7%; height: 60px; } /* ai to msg */

.run-indicator {
    position: absolute;
    bottom: 16px; right: 16px;
    background: var(--surface); padding: 6px 14px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 500; display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-subtle); box-shadow: var(--shadow-sm); z-index: 3;
}

/* (Removidos los componentes anteriores de hero-visual porque ya están sustituidos por el n8n canvas nuevo) */

/* --- RESPONSIVE BASICO --- */
@media (max-width: 968px) {
    .hero-container { grid-template-columns: 1fr; text-align: center; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { margin: 0 auto 32px; }
    .nav-links { display: none; } /* Oculto en móvil por ahora */
    .tech-stack { justify-content: center; }
    .badge { margin: 0 auto 24px; }
    .hero-cta { display: flex; flex-direction: column; align-items: center; }
}

/* --- GENERIC SECTIONS --- */
.section {
    padding: var(--section-py) 0;
    position: relative;
}

.bg-light {
    background-color: #F8FAFC;
}

.section-header {
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 16px;
    line-height: 1.15;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-6 { margin-bottom: 24px; }
.max-w-md { max-width: 800px; margin: 0 auto; }
.pb-xl { padding-bottom: 100px; }
.relative-z { position: relative; z-index: 10; }
.text-sm { font-size: 0.85rem; }

/* --- SERVICES GRID --- */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
}

.service-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    width: calc(33.333% - 22px);
    min-width: 280px;
}

.service-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
}

.service-card .icon-box {
    margin-bottom: 24px;
    background: rgba(99,102,241,0.08); /* accent-light but slightly more visible */
    color: var(--accent);
    border: none;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    font-size: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.service-card p {
    font-size: 0.95rem;
}

/* --- CASES PORTFOLIO --- */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.case-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.case-card:hover {
    box-shadow: var(--shadow-md);
}

.case-header {
    padding: 24px 32px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-subtle);
}

.case-header h3 {
    font-size: 1.2rem;
    margin-top: 16px;
}

.case-body {
    padding: 32px;
}

.before-after .before, .before-after .after {
    font-size: 0.95rem;
    line-height: 1.5;
}

.before-after .arrow {
    text-align: center;
    color: #D1D5DB;
    margin: 16px 0;
    font-size: 1.5rem;
}

.before-after .after strong {
    color: var(--text-primary);
}

/* --- PROCESS TIMELINE --- */
.process-timeline {
    max-width: 700px;
    margin: 48px auto 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step {
    display: flex;
    gap: 24px;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.step:hover {
    border-color: var(--accent-light);
    transform: translateX(4px);
}

.step-number {
    width: 48px; height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(99,102,241,0.1);
    color: var(--accent);
    display: flex; justify-content: center; align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
}

.step-content h4 {
    font-size: 1.2rem;
}

/* --- AUTORIDAD --- */
.img-text-container {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 60px;
    align-items: center;
}

.avatar-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    border-radius: var(--radius-lg);
    display: flex; justify-content: center; align-items: center;
    font-size: 5rem; color: #9CA3AF;
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.check-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.check-list li i {
    font-size: 1.2rem;
    margin-top: 4px;
}

.text-accent { color: var(--accent); }

/* --- FAQ --- */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.faq-question {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
    transition: var(--transition);
}

.faq-question h4 {
    font-size: 1.1rem;
    font-family: var(--font-body);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: var(--accent);
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.1);
}

.faq-item.active .faq-answer {
    padding: 0 24px 24px;
    max-height: 500px;
    opacity: 1;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--accent);
}
.faq-item.active .faq-question { color: var(--accent); }

/* --- CONTACTO --- */
.container-sm { max-width: 600px; margin: 0 auto; }

.contact-card {
    padding: 48px;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
    background: #F9FAFB;
    color: var(--text-primary);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: #9CA3AF;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-full { width: 100%; }

/* --- FOOTER --- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface);
}

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

.footer .logo { font-size: 1.1rem; }

.footer-links a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.footer-links a:hover { color: var(--accent); }

/* --- WHATSAPP WIDGET --- */
.wpp-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wpp-flotante:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.6);
}

.whatsapp-ico {
    width: 32px;
    height: 32px;
}

/* Responsive Extra */
@media (max-width: 768px) {
    .section { padding: 60px 0; }
    .img-text-container { grid-template-columns: 1fr; }
    .contact-card { padding: 32px 24px; }
    .footer-container { flex-direction: column; gap: 16px; text-align: center; }
    .section-title { font-size: 2rem; }
    
    .service-card { width: 100%; }
    
    /* n8n canvas adaptado a mobile */
    .node-trigger { top: 10%; left: 50%; transform: translateX(-50%); }
    .node-ai { top: 35%; left: 50%; transform: translateX(-50%); }
    .node-crm { top: 60%; left: 20%; }
    .node-msg { top: 60%; left: 70%; transform: translateX(-50%); }
    .n-wire { display: none; /* Hide wires on small screens to prevent overlap logic mismatch */ }
}
