/* =========================================
   VARIABLES (TEMA CLARO & CORPORATIVO)
   ========================================= */
:root {
    /* Paleta Neutra (Blanco y Gris Plomo) */
    /* CAMBIO 1: Fondo un poco más gris para que resalte el blanco */
    --bg-body: #e4e4e4;       
    --bg-surface: #ffffff;    /* Blanco puro para tarjetas */
    --bg-input: #dfdfdf;      /* Gris muy muy claro para inputs */
    
    /* Textos (Alto contraste para legibilidad) */
    --text-main: #0f172a;     /* Azul marino muy oscuro (casi negro) */
    --text-body: #475569;     /* Gris medio para párrafos */
    --text-muted: #94a3b8;    /* Gris claro para etiquetas secundarias */
    
    /* Colores de Marca */
    --primary: #1e293b;       /* Gris plomo oscuro */
    --accent: #eb2525;        /* Azul Royal para acciones */
    --accent-hover: #8f0021;
    
    /* Colores Funcionales */
    --success: #16a34a;       
    --danger: #dc2626;        
    --warning: #ca8a04;       
    
    /* Estilos */
    --radius: 12px;
    --border: #adadad;        
    
    /* CAMBIO 2: Sombra mucho más definida y elegante */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 
                   0 10px 15px -3px rgba(0, 0, 0, 0.08); 
                   
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                    0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   NAVBAR (HEADER FIJO - FULL WIDTH)
   ========================================= */
.navbar {
    background: #e5e5e5;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
    width: 100%; /* Asegura que la barra ocupe toda la pantalla */
    transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1);}
.nav-hidden {
    transform: translateY(-100%); /* Mueve la barra hacia arriba fuera de la vista */
    box-shadow: none; /* Quita la sombra cuando no está */
}

.nav-container {
    /* CAMBIO CLAVE: Quitamos el límite de 1200px */
    max-width: 100%; 
    margin: 0; 
    
    /* Damos "aire" a los lados para que no se pegue al borde literal */
    padding: 0 60px; 
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Ajuste Responsive: En móvil reducimos el espacio para que quepa bien */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 20px; 
    }
}

/* ... El resto de clases (.brand, .nav-links, .btn-nav) se quedan igual ... */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 800; color: #6a6a6a; font-size: 1.2rem; }
.brand-icon { color: var(--accent); font-size: 1.5rem; display: flex; }
.text-highlight { color: var(--accent); }

.nav-links { list-style: none; display: flex; gap: 30px; display: none; }
@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-links a { text-decoration: none; color: var(--text-body); font-weight: 500; font-size: 0.95rem; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }

.btn-nav {
    background: var(--primary); color: white; text-decoration: none;
    padding: 8px 18px; border-radius: 6px; font-weight: 600; font-size: 0.9rem;
    transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-nav:hover { background: var(--accent); box-shadow: 0 6px 10px rgba(37, 99, 235, 0.2); }
/* =========================================
   LAYOUT & HERO
   ========================================= */
.app-container { max-width: 1100px; margin: 0 auto; padding: 50px 20px; }

.page-header { text-align: center; margin-bottom: 60px; }
h1 { font-family: var(--font-heading); color: var(--text-main); font-size: 2.5rem; letter-spacing: -1px; margin-bottom: 15px; }
.year-badge { background: #dbeafe; color: var(--accent); font-size: 0.5em; padding: 4px 12px; border-radius: 20px; vertical-align: middle; border: 1px solid #bfdbfe; }
.subtitle { font-size: 1.15rem; color: var(--text-body); max-width: 600px; margin: 0 auto; }

/* GRID CALCULADORA */
.calculator-grid { display: grid; grid-template-columns: 1fr; gap: 40px; margin-bottom: 100px; }

/* =========================================
   TARJETAS (CARDS) - AQUÍ ESTÁ EL CAMBIO
   ========================================= */
.card {
    background: var(--bg-surface);
    border: 1px solid white; /* Borde blanco sutil */
    border-radius: var(--radius);
    padding: 35px;
    
    /* SOMBRA DEFINIDA */
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Efecto al pasar el ratón para dar sensación interactiva */
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
h2 { font-family: var(--font-heading); font-size: 1.2rem; color: var(--text-main); font-weight: 700; }

/* INPUTS */
.form-group { margin-bottom: 24px; }
label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-main); }

input, select {
    width: 100%; background: var(--bg-input); 
    border: 1px solid #cbd5e1; /* Borde un poco más visible */
    padding: 12px 14px; border-radius: 8px; color: var(--text-main); font-size: 1rem;
    transition: all 0.2s;
    font-family: var(--font-body);
}

input:focus, select:focus { outline: none; border-color: var(--accent); background: #adadad; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

.input-wrapper.currency input { padding-right: 35px; font-weight: 700; font-size: 1.1rem; }
.currency-symbol { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-weight: 600; }
.input-wrapper { position: relative; }

/* Rango Slider */
.range-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: #cfcfcf; border-radius: 5px; margin-top: 15px; border: none; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; background: var(--accent); border: 2px solid #fff; border-radius: 50%; cursor: pointer; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }

/* Controles +/- */
.counter-control { display: flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.counter-control button { background: var(--bg-input); border: none; width: 44px; height: 44px; cursor: pointer; color: var(--text-main); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: 0.2s; }
.counter-control button:hover { background: #e2e8f0; color: var(--accent); }
.counter-control span { flex: 1; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); font-weight: 700; margin: 30px 0 15px 0; }

.inner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group.disabled { opacity: 0.5; pointer-events: none; }

/* =========================================
   RESULTADOS
   ========================================= */
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.status-dot { width: 10px; height: 10px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1); animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.main-result-box { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; background: #f1f5f9; padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); }

/* Donut Chart */
.donut-chart { width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(var(--success) 0% 0%, var(--danger) 0% 100%); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.donut-chart::after { content: ''; position: absolute; width: 75%; height: 75%; background: #f1f5f9; border-radius: 50%; }
.chart-center { position: relative; z-index: 2; text-align: center; }
.chart-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 700; display: block; }
.chart-value { font-size: 1.2rem; font-weight: 800; color: var(--text-main); }

.amount-display .label { font-size: 0.85rem; color: var(--text-body); margin-bottom: 5px; display: block; font-weight: 500; }
.amount-display .amount { font-size: 2.4rem; font-weight: 800; color: var(--text-main); font-family: var(--font-heading); line-height: 1; letter-spacing: -1px; }
.meta-info { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; display: flex; align-items: center; }
.separator { margin: 0 6px; color: #cbd5e1; }

/* Tabla Desglose */
.breakdown-table { padding: 0 10px; }
.table-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.table-row.total { border-bottom: none; border-top: 2px solid var(--border); margin-top: 10px; padding-top: 15px; font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
.color-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 12px; }
.color-dot.gross { background: var(--text-muted); }
.color-dot.ss { background: var(--warning); }
.color-dot.irpf { background: var(--danger); }
.danger { color: var(--danger); font-weight: 600; }
.success { color: var(--success); font-weight: 700; }


/* =========================================
   SECCIÓN CONFIANZA & FAQ
   ========================================= */
.trust-section { margin-bottom: 80px; }
.section-title { font-family: var(--font-heading); text-align: center; margin-bottom: 50px; font-size: 1.8rem; color: var(--text-main); font-weight: 800; letter-spacing: -0.5px; }

.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.trust-item { background: var(--bg-surface); padding: 40px 30px; border-radius: var(--radius); border: 1px solid var(--border); text-align: center; transition: transform 0.3s; box-shadow: var(--shadow-card); }
.trust-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.trust-item i { font-size: 2.5rem; color: var(--accent); margin-bottom: 20px; display: inline-block; background: #eff6ff; padding: 15px; border-radius: 50%; }
.trust-item h3 { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 12px; color: var(--text-main); font-weight: 700; }
.trust-item p { font-size: 0.95rem; color: var(--text-body); line-height: 1.6; }

/* ACORDEÓN */
.faq-section { margin-bottom: 100px; }
.accordion { max-width: 800px; margin: 0 auto; }
details { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 15px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: all 0.3s; }
details[open] { box-shadow: var(--shadow-card); }
summary { padding: 25px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; color: var(--text-main); align-items: center; font-size: 1.05rem; }
summary:hover { background: #f8fafc; }
summary::after { content: '+'; font-size: 1.5rem; font-weight: 300; color: var(--accent); transition: transform 0.3s; }
details[open] summary::after { transform: rotate(45deg); }
.content { padding: 0 25px 25px 25px; color: var(--text-body); border-top: 1px solid var(--border); padding-top: 20px; line-height: 1.7; background: #fcfcfc; }

/* =========================================
   FOOTER (HEAVY)
   ========================================= */
.site-footer { background: var(--primary); color: #fff; padding: 80px 0 30px 0; font-size: 0.9rem; margin-top: auto; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 50px; margin-bottom: 50px; }

.footer-col h4 { color: #fff; margin-bottom: 25px; font-family: var(--font-heading); font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.footer-col a { display: block; color: #94a3b8; text-decoration: none; margin-bottom: 12px; transition: 0.2s; }
.footer-col a:hover { color: #fff; transform: translateX(5px); }
.brand-col p { color: #94a3b8; margin-top: 20px; line-height: 1.6; font-size: 0.9rem; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px; text-align: center; color: #64748b; font-size: 0.85rem; }

/* ANIMACIONES */
.reveal-up, .reveal-text, .reveal-scroll { opacity: 0; transform: translateY(20px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* MEDIA QUERIES */
@media (min-width: 900px) {
    .calculator-grid {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr; /* Ajuste visual */
        gap: 40px;
        align-items: start; /* CRÍTICO para que sticky funcione */
    }
    .sticky {
        position: sticky;
        top: 100px; /* Margen superior al hacer scroll */
        z-index: 10;
        transition: top 0.3s;
    }
}
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .main-result-box { flex-direction: column; text-align: center; }
    .amount-display .amount { font-size: 2.2rem; }
}

/* =========================================
   ESTILOS DE IMPRESIÓN (PDF GENERATOR)
   ========================================= */
@media print {
    /* Ocultar todo lo que no es relevante para el informe */
    .navbar, .trust-section, .faq-section, .site-footer, .range-slider, 
    .counter-control button, .ad-container, .action-btn, .page-header p {
        display: none !important;
    }

    /* Resetear colores para papel blanco */
    body { background: white; color: black; font-size: 12pt; }
    .app-container { max-width: 100%; margin: 0; padding: 0; }
    .calculator-grid { display: block; }
    
    /* Transformar la tarjeta en un documento oficial */
    .card {
        box-shadow: none; border: none; padding: 0; margin-bottom: 30px;
        page-break-inside: avoid; /* Evitar que se corte a mitad de página */
    }

    /* Cabecera del Informe */
    .page-header h1 { font-size: 24pt; color: #000; margin-bottom: 10px; }
    .page-header::after {
        content: "Informe generado el " attr(data-date);
        display: block; font-size: 10pt; color: #666; margin-top: 5px;
    }

    /* Ajuste de Resultados para papel */
    .main-result-box {
        border: 2px solid #000; background: #fff; 
        padding: 20px; border-radius: 8px;
    }
    .amount { color: #000 !important; }
    .donut-chart { display: none; } /* El gráfico no aporta en papel BN */

    /* Marca de agua al pie */
    body::after {
        content: "Documento generado gratuitamente en TuNómina2026.com";
        position: fixed; bottom: 0; left: 0; right: 0;
        text-align: center; font-size: 9pt; color: #888; border-top: 1px solid #ddd; padding: 10px;
    }
}

/* ESTILO BOTÓN PDF */
.btn-print {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    width: 100%;
    justify-content: center;
}

.btn-print:hover {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-print i {
    font-size: 1.2rem;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN PROFESIONAL (PDF A4 - UNA PÁGINA)
   ========================================================================== */
@media print {
    /* 1. CONFIGURACIÓN DE PÁGINA */
    @page {
        size: A4;
        margin: 1.5cm; /* Márgenes de oficina */
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
        font-family: 'Inter', sans-serif;
        font-size: 11pt; /* Tamaño letra documento */
/* AÑADE ESTAS DOS LÍNEAS JUNTAS: */
        -webkit-print-color-adjust: exact; /* Para compatibilidad antigua (Chrome/Safari) */
        print-color-adjust: exact;         /* El estándar moderno (Firefox y futuros) */    }

    /* 2. LIMPIEZA TOTAL (Ocultar lo que no sirve) */
    .navbar, 
    .range-slider, 
    .counter-control button, /* Botones + y - */
    .ad-container, 
    .trust-section, 
    .faq-section, 
    .site-footer, 
    .action-area,
    .donut-chart, /* El gráfico gasta mucha tinta y no aporta dato exacto */
    .page-header p.subtitle,
    .step-indicator,
    .live-badge,
    .status-dot {
        display: none !important;
    }

    /* 3. REESTRUCTURACIÓN (Grid para aprovechar el A4) */
    .app-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .page-header {
        text-align: left;
        margin-bottom: 30px;
        padding-bottom: 20px;
        border-bottom: 2px solid #000;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }

    /* Transformamos el título para el papel */
    .page-header h1 {
        font-size: 24pt;
        color: #000;
        margin: 0;
    }
    
    /* Truco: Añadir fecha automática con CSS */
    .page-header::after {
        content: "Informe Generado: " attr(data-date); /* Requiere pequeño JS extra abajo */
        font-size: 10pt;
        color: #666;
    }

    /* LAYOUT A DOS COLUMNAS */
    .calculator-grid {
        display: grid !important;
        grid-template-columns: 45% 50% !important; /* Izquierda datos, Derecha resultados */
        gap: 5%;
        align-items: start;
        margin-bottom: 0;
    }

    /* 4. TRANSFORMACIÓN DE INPUTS (De formulario a Texto) */
    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .input-panel {
        border-right: 1px solid #ddd !important;
        padding-right: 20px !important;
    }

    .input-panel h2, .result-panel h2 {
        font-size: 14pt;
        border-bottom: 1px solid #000;
        padding-bottom: 5px;
        margin-bottom: 15px;
        color: #000;
    }

    /* Hacemos que los inputs parezcan texto normal */
    input, select {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        font-weight: 700;
        color: #000 !important;
        font-size: 11pt;
        /* Quitamos la flecha del select */
        -webkit-appearance: none; 
        appearance: none;
    }
    
    .form-group {
        margin-bottom: 15px;
        border-bottom: 1px dotted #ccc; /* Línea de puntos elegante para separar datos */
        padding-bottom: 5px;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    label {
        color: #666;
        font-size: 10pt;
        font-weight: 400;
        margin: 0;
    }

    /* Alineamos valores a la derecha */
    .form-group input, .form-group select {
        text-align: right;
        width: auto;
    }

    .input-wrapper.currency input { padding-right: 0; }
    .currency-symbol { position: static; transform: none; font-weight: 700; color: #000; margin-left: 5px;}
    .input-wrapper { display: flex; justify-content: flex-end; align-items: center; }

    /* 5. RESULTADOS (Más impactantes) */
    .result-panel {
        background: #f9f9f9 !important; /* Fondo gris muy suave para destacar */
        padding: 20px !important;
        border-radius: 8px !important;
        border: 1px solid #eee !important;
    }

    .amount-display { margin-bottom: 30px; text-align: center; }
    .amount-display .label { text-transform: uppercase; letter-spacing: 2px; font-size: 9pt; }
    .amount-display .amount { font-size: 36pt; color: #000; }
    
    .table-row {
        border-bottom: 1px solid #ccc;
        padding: 8px 0;
    }
    .table-row.total {
        border-top: 2px solid #000;
        border-bottom: none;
        font-size: 14pt;
    }

    /* 6. PIE DE PÁGINA (WATERMARK) */
    body::after {
        content: "Documento meramente informativo sin validez legal. Generado gratuitamente en TuNómina2026.com";
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 8pt;
        color: #999;
        border-top: 1px solid #ddd;
        padding-top: 10px;
    }
}

.top-bar { background: #1e293b; color: #fff; font-size: 0.8rem; padding: 8px 0; text-align: center; }
.top-bar-content { display: flex; align-items: center; justify-content: center; gap: 8px; }

.badge-pill { 
    display: inline-block; background: #e0f2fe; color: #0284c7; 
    font-size: 0.75rem; font-weight: 700; padding: 4px 12px; 
    border-radius: 50px; margin-bottom: 15px; letter-spacing: 0.5px; text-transform: uppercase;
}
.trust-indicators {
    display: flex; justify-content: center; align-items: center; gap: 20px;
    margin-top: 25px; font-size: 0.9rem; color: var(--text-body);
}
.stars { color: #fbbf24; display: inline-flex; gap: 2px; }
.separator { color: #cbd5e1; }
.indicator { display: flex; align-items: center; gap: 6px; }

@media (max-width: 600px) {
    .trust-indicators { flex-direction: column; gap: 10px; }
    .separator { display: none; }
}

.integration-banner {
    text-align: center; margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 30px;
}
.integration-banner span { 
    font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); 
    letter-spacing: 1px; font-weight: 600; display: block; margin-bottom: 15px; 
}
.logos-row {
    display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; opacity: 0.6;
}
.logo-item {
    font-family: var(--font-heading); font-weight: 700; color: var(--text-main); 
    display: flex; align-items: center; gap: 8px; font-size: 1.1rem;
}

/* =========================================
   STOCK TICKER (MERCADO FINANCIERO)
   ========================================= */
.stock-ticker-wrap {
    background: #0b1120; /* Fondo muy oscuro, casi negro */
    height: 44px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
    font-family: 'Inter', sans-serif; /* O 'Roboto Mono' si la tienes */
    font-size: 0.8rem;
}

/* Etiqueta "MERCADO" fija a la izquierda */
.market-status {
    background: #0b1120;
    color: #94a3b8;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.7rem;
    position: relative;
    z-index: 10;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5); /* Sombra para tapar el scroll */
    border-right: 1px solid rgba(255,255,255,0.1);
}

/* Punto rojo parpadeante (LIVE) */
.pulse-dot {
    width: 6px; height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.7);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Pista de movimiento */
.stock-track {
    display: flex;
    animation: scrollTicker 40s linear infinite; /* Velocidad del ticker */
}

/* Pausar al pasar el ratón */
.stock-ticker-wrap:hover .stock-track {
    animation-play-state: paused;
}

.stock-group {
    display: flex;
    align-items: center;
}

/* Cada Item de Bolsa */
.stock-item {
    display: flex;
    align-items: center;
    padding: 0 25px; /* Espacio entre acciones */
    border-right: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}

.symbol { font-weight: 700; color: #fff; margin-right: 8px; }
.value { color: #cbd5e1; margin-right: 8px; font-variant-numeric: tabular-nums; }
.change { font-weight: 600; font-size: 0.75rem; }

/* Colores Dinámicos */
.up .change { color: #10b981; /* Verde subida */ }
.down .change { color: #ef4444; /* Rojo bajada */ }

/* Animación Infinita */
@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); } /* Se mueve un bloque entero a la izquierda */
}

/* Ocultar en impresión */
@media print { .stock-ticker-wrap { display: none; } }

/* =========================================
   SECCIÓN DE FACTORES (TEXT GRID)
   ========================================= */
.factors-section {
    padding: 80px 0;
    background: transparent; /* Se integra con tu fondo actual */
    margin-bottom: 60px;
}

.factors-content {
    max-width: 1000px; /* Un poco más estrecho para facilitar lectura */
    margin: 0 auto;
    padding: 0 20px;
}

.factors-header {
    text-align: center;
    margin-bottom: 60px;
}

.factors-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.factors-header p {
    color: var(--text-body);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* La rejilla de 2 columnas */
.factors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px; /* Espacio generoso entre columnas */
}

.factor-item h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.factor-item p {
    font-size: 0.95rem;
    color: var(--text-body);
    line-height: 1.7; /* Lectura muy cómoda */
    text-align: left;
}

/* En móvil, una sola columna */
@media (max-width: 768px) {
    .factors-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .factors-header h2 {
        font-size: 1.6rem;
    }
}

/* Ocultar en impresión para ahorrar tinta y papel */
@media print {
    .factors-section { display: none; }
}

/* =========================================
   ESPACIADO ENTRE SECCIONES (MÁS AIRE)
   ========================================= */

/* Aumentamos la separación vertical de TODOS los bloques grandes */
.calculator-grid, 
.trust-section, 
.factors-section, 
.faq-section {
    margin-bottom: 140px; /* Mucho más espacio (antes era 80px) */
}

/* Ajuste específico para la sección de factores */
.factors-section {
    padding: 60px 0; /* Un poco de padding interno extra */
}

/* En móvil no queremos tanto espacio porque hay que hacer mucho scroll */
@media (max-width: 768px) {
    .calculator-grid, 
    .trust-section, 
    .factors-section, 
    .faq-section {
        margin-bottom: 80px; /* En móvil lo reducimos para que sea cómodo */
    }
    
    /* Ajuste extra para que el título no quede pegado arriba en móvil */
    .page-header {
        margin-bottom: 40px;
    }
}

/* =========================================
   ESTILOS ARTÍCULO SEO (AUTHORITY BUILDING)
   ========================================= */
.seo-article {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 80px 0;
    color: var(--text-main);
}

.article-content {
    max-width: 800px; /* Ancho de lectura óptimo (como Medium o periódicos) */
    margin: 0 auto;
    padding: 0 20px;
}

.article-header {
    text-align: center;
    margin-bottom: 50px;
}

.article-header h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.text-block {
    margin-bottom: 50px;
}

.text-block h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-main);
    border-left: 4px solid var(--accent);
    padding-left: 15px;
}

.text-block p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 20px;
}

.text-block strong {
    color: var(--text-main);
    font-weight: 600;
}

/* TABLA DE TRAMOS IRPF (ESTILO PREMIUM) */
.table-responsive {
    overflow-x: auto;
    margin: 30px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 500px; /* Para que no se rompa en móvil */
}

.tax-table th {
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 700;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.tax-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-body);
    font-size: 0.95rem;
}

.tax-table tr:last-child td { border-bottom: none; }
.tax-table tr:hover { background: #f1f5f9; }

/* LISTAS LIMPIAS */
.clean-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.clean-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: var(--text-body);
}

.clean-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 800;
}

.small-note {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    margin-top: 10px;
}

/* OCULTAR EN IMPRESIÓN */
@media print {
    .seo-article { display: none; }
}

/* AJUSTE SCROLL ANCLAS */


/* Esto hace que al viajar a una sección, se respete el espacio del Header fijo */
section {
    scroll-margin-top: 120px;
}

/* AJUSTE ESPACIADO FAQ */
.faq-section {
    margin-top: 100px; /* Empuja la sección hacia abajo */
    padding-top: 40px; /* Añade un poco de aire extra antes del título */
}

/* Opcional: Si quieres que el título en sí tenga aún más separación */
.faq-section h2 {
    margin-bottom: 60px; /* Separa el título de las preguntas */
}

/* =========================================
   LIMPIEZA MÓVIL (SÓLO PARA PANTALLAS PEQUEÑAS)
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. OCULTAR CINTA DE BOLSA Y BARRA SUPERIOR
       En móvil distraen y empujan el contenido importante hacia abajo. */
    .stock-ticker-wrap,
    .top-bar {
        display: none !important;
    }

    /* 2. OCULTAR ELEMENTOS SECUNDARIOS DEL HEADER
       La etiqueta "Versión 2.4" y los sellos de confianza ocupan mucho espacio vertical. */
    .badge-pill, 
    .trust-indicators,
    .integration-banner {
        display: none !important;
    }

    /* 3. COMPACTAR EL TÍTULO
       Hacemos el texto más pequeño y reducimos márgenes para que la calculadora suba. */
    .page-header {
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
        text-align: center; /* Aseguramos que esté centrado */
    }

    .page-header h1 {
        font-size: 1.8rem; /* Título más manejable */
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .page-header .subtitle {
        font-size: 0.95rem; /* Subtítulo más fino */
        margin-bottom: 0;
        padding: 0 10px; /* Margen lateral para que no toque los bordes */
    }

    /* 4. AJUSTE DEL NAVBAR
       Reducimos el padding lateral del menú para ganar espacio */
    .nav-container {
        padding: 0 15px !important;
    }
}

/* =========================================
   MENÚ MÓVIL PREMIUM (DARK GLASS)
   ========================================= */

/* OCULTAR EN ESCRITORIO */
.hamburger, .mobile-overlay { display: none; }

@media (max-width: 768px) {
    
    /* 1. EL BOTÓN (Animado estilo cruz) */
    .hamburger {
        display: flex; flex-direction: column; justify-content: center; gap: 6px;
        background: none; border: none; cursor: pointer; z-index: 201;
        width: 40px; height: 40px; padding: 5px;
    }
    .bar {
        width: 28px; height: 2px; background-color: var(--text-main);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        align-self: flex-end; /* Alineado a la derecha para estilo */
    }
    .bar-2 { width: 18px; } /* La segunda barra es más corta (estilo moderno) */

    /* Estado ACTIVO del botón */
    body.menu-open .bar-1 { transform: rotate(45deg) translate(5px, 6px); background-color: #fff; }
    body.menu-open .bar-2 { transform: rotate(-45deg) translate(5px, -6px); width: 28px; background-color: #fff; }

    /* 2. EL CONTENEDOR (OVERLAY) */
    .mobile-overlay {
        display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: #0f172a; /* Fondo Oscuro Premium */
        z-index: 200;
        
        /* Animación de entrada: CLIP PATH (Efecto cortina circular) */
        clip-path: circle(0% at 100% 0);
        transition: clip-path 0.6s cubic-bezier(0.77, 0, 0.175, 1);
        pointer-events: none;
    }

    /* Estado ABIERTO */
    .mobile-overlay.open {
        clip-path: circle(150% at 100% 0); /* Se abre todo */
        pointer-events: all;
    }

    .mobile-content {
        height: 100%; display: flex; flex-direction: column; justify-content: center;
        padding: 40px 30px; position: relative; z-index: 2;
    }

    /* 3. ENLACES PRINCIPALES (Tipografía Gigante) */
    .mobile-main-links { list-style: none; margin-bottom: 30px; }
    .mobile-main-links li { 
        margin-bottom: 20px; 
        opacity: 0; transform: translateY(30px); /* Preparado para animar */
        transition: 0.4s ease;
    }
    
    .mobile-main-links a {
        text-decoration: none; color: #fff; font-family: var(--font-heading);
        font-size: 2.2rem; font-weight: 800; letter-spacing: -1px;
        display: flex; align-items: center; gap: 15px;
    }

    .nav-num {
        font-size: 0.9rem; color: var(--accent); font-family: 'Inter', monospace;
        border: 1px solid rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 20px;
    }

    /* 4. TARJETA DE EMPRESAS (CTA) */
    .mobile-card-wrapper {
        opacity: 0; transform: translateY(20px); transition: 0.4s ease;
    }
    .business-card {
        background: rgba(255,255,255,0.05); /* Cristal sutil */
        border: 1px solid rgba(255,255,255,0.1);
        padding: 20px; border-radius: 16px;
        display: flex; align-items: center; gap: 15px; text-decoration: none;
        transition: 0.3s;
    }
    .business-card:active { background: rgba(255,255,255,0.1); transform: scale(0.98); }
    
    .card-icon { 
        background: var(--accent); color: white; width: 40px; height: 40px; 
        border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    }
    .card-text { flex: 1; }
    .card-title { color: #fff; font-weight: 700; display: block; font-size: 1rem; }
    .card-desc { color: #94a3b8; font-size: 0.8rem; display: block; }
    .card-arrow { color: #fff; font-size: 1.2rem; }

    /* 5. FOOTER DEL MENÚ */
    .mobile-footer {
        margin-top: auto; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1);
        opacity: 0; transition: 0.4s ease;
    }
    .contact-info span { display: block; color: #64748b; font-size: 0.85rem; margin-bottom: 5px; }
    .contact-info a { color: #fff; text-decoration: none; font-size: 1.1rem; }
    .legal-mini { margin-top: 20px; font-size: 0.8rem; }
    .legal-mini a { color: #475569; text-decoration: none; margin-right: 10px; }

    /* ANIMACIONES EN CASCADA (STAGGER) */
    .mobile-overlay.open li:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
    .mobile-overlay.open li:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
    .mobile-overlay.open li:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
    .mobile-overlay.open .mobile-card-wrapper { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
    .mobile-overlay.open .mobile-footer { opacity: 1; transition-delay: 0.5s; }

    /* 6. GLOW DE FONDO (Efecto WOW) */
    .menu-bg-glow {
        position: absolute; bottom: -20%; right: -20%; width: 300px; height: 300px;
        background: var(--accent); filter: blur(120px); opacity: 0.2; pointer-events: none;
    }
}
/* =========================================
   ESTILOS ESPECÍFICOS PARA PÁGINA EMPRESAS (B2B)
   ========================================= */

/* 1. HERO SECTION (Cabecera) */
.contact-hero {
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 40px;
}

/* 2. GRID DE SERVICIOS (Tarjetas de Publicidad/API) */
.b2b-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.b2b-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.b2b-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

/* Iconos dentro de las tarjetas */
.b2b-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    background: rgba(235, 37, 37, 0.1); /* Color acento muy suave */
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.b2b-card h3 {
    font-family: var(--font-heading);
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--text-main);
    font-weight: 700;
}

.b2b-card p {
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 3. FORMULARIO CONTACTO MEJORADO */
.form-section {
    max-width: 800px;
    margin: 0 auto 100px auto;
    background: #fff;
    padding: 50px;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.form-intro {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

/* Área de texto específica */
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid #cbd5e1;
    padding: 15px;
    border-radius: 8px;
    font-family: var(--font-body);
    resize: vertical;
    min-height: 150px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: #adadad; /* O el color que uses para focus */
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Ajustes Responsive para Empresas */
@media (max-width: 768px) {
    .form-section {
        padding: 30px;
    }
    .b2b-grid {
        grid-template-columns: 1fr; /* Una columna en móvil */
        gap: 20px;
    }
    .contact-hero {
        padding-top: 20px;
        margin-bottom: 40px;
    }
}