/* ==========================================================================
   1. RESET, VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    --purple-main: #4D2380;       /* Morado Corporativo */
    --purple-light: #F4EFFF;
    --dark-graphite: #2D2F31;     /* Gris Grafito para textos principales */
    --gray-text: #50575E;         /* Gris medio */
    --bg-light: #F8F9FA;          /* Contenedores y secciones alternativas */
    --white: #FFFFFF;
    --border-color: #E2E2E9;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: sans-serif;
    color: var(--dark-graphite);
    background-color: var(--white);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-purple { color: var(--purple-main); }

/* ==========================================================================
   2. COMPONENTES REUTILIZABLES (BOTONES)
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    /*border-radius: 6px;*/
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--purple-main);
    color: var(--white);
    border: 1px solid var(--purple-main);
}

.btn-primary:hover {
    background-color: #3b1a63;
}

.btn-secondary {
    background-color: var(--dark-graphite);
    color: var(--white);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--purple-main);
}

.btn-outline {
    background-color: transparent;
    color: var(--purple-main);
    border: 2px solid var(--purple-main);
}

.btn-outline:hover {
    background-color: var(--purple-light);
}

.btn-block {
    width: 100%;
    display: block;
}

/* ==========================================================================
   3. NAVBAR (BARRA DE NAVEGACIÓN)
   ========================================================================== */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-text {
    /*font-weight: 700;*/
    font-size: 22px;
    letter-spacing: 1px;
    color: var(--dark-graphite);
}

.logo-span {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 1px;
    color: var(--purple-main);
}

.logo-cube {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.logo-l {
    font-weight: 700;
    font-size: 18px;
    color: var(--purple-main);
    margin-top: -2px;
}

/* ==========================================================================
   4. HERO SECTION (CORREGIDO Y PROPORCIONAL)
   ========================================================================== */
.hero {
    padding: 80px 0;
    background-color: var(--white);
    display: flex;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.hero-grid {
    display: grid;
    /* Proporción equilibrada para que la imagen central tenga espacio sin aplastar el texto */
    grid-template-columns: 1.1fr 1.4fr; 
    gap: 40px;
    align-items: center;
}

.hero-content h1 {
    font-size: 44px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--dark-graphite);
}

.hero-content p {
    font-size: 16px;
    color: var(--gray-text);
    margin-bottom: 40px;
    max-width: 95%;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-image-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    width: 130%;
    overflow: hidden;
}

.hero-img {
    width: 125%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 10px 30px rgba(0, 0, 0, 0.04));
}

/* ==========================================================================
   5. MANIFIESTO
   ========================================================================== */
.manifesto {
    padding: 80px 0;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.manifesto-tag {
    color: var(--purple-main);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.manifesto h2 {
    font-size: 28px;
    font-weight: 500;
    color: var(--dark-graphite);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   6. INTERACTIVE DIAGRAM SECTION (SIMULADOR DE ARQUITECTURA)
   ========================================================================== */
.architecture {
    padding: 100px 0;
}

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

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-header p {
    color: #252833;
    font-size: 18px;
}

.architecture-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Lienzo oscuro emulando consola/Excalidraw */
.diagram-canvas {
    background-color: #f2f2f2; 
    height: 480px;
    /*border-radius: 12px;*/
    position: relative;
    /*box-shadow: inset 0 4px 30px rgba(0,0,0,0.2);*/
    overflow: hidden;
}

.cloud-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.08);
    color: #252833;
    padding: 6px 12px;
    font-size: 12px;
    /*border-radius: 4px;*/
    font-family: monospace;
    border: 1px solid rgba(255,255,255,0.1);
}

.diagram-node {
    position: absolute;
    background: #f3f3f3f3;
    border: 1px solid var(--purple-main);
    /*border-radius: 8px;*/
    padding: 16px;
    color: #252833;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
    width: 170px;
}

.diagram-node h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.diagram-node .node-sub {
    display: block;
    font-size: 11px;
    color: #252833;
    font-family: monospace;
}

.diagram-node .node-type {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    color: #A435F0;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* Coordenadas absolutas del mapa interactivo */
.node-whatsapp  { top: 60px; left: 160px; }
.node-db        { top: 220px; left: 40px; }
.node-core      { top: 220px; left: 280px; width: 190px; border-color: #A435F0;  }
.node-zoho      { top: 90px; left: 540px; }
.node-pipedrive { top: 260px; left: 540px; }

.diagram-node:hover, .diagram-node.active, .diagram-node.active.span {
    background: #252833;
    border-color: #A435F0;
    transform: translateY(-2px);
    color: #F4EFFF;
}

/* Conexiones SVG */
.diagram-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.link-line {
    stroke: #3A3F50;
    stroke-width: 2;
    stroke-dasharray: 4;
}

.diagram-node.active ~ svg .link-line {
    stroke: #A435F0;
}

/* Panel lateral del simulador */
.diagram-details {
    background-color: var(--white);
    /*border-radius: 12px;*/
    padding: 32px;
    /*box-shadow: var(--shadow);*/
    min-height: 350px;
}

.diagram-details h3 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--purple-main);
    border-bottom: 2px solid var(--purple-light);
    padding-bottom: 8px;
}

.diagram-details p {
    color: #252833;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.8;
}

.diagram-details ul {
    list-style: none;
}

.diagram-details ul li {
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    gap: 8px;
    line-height: 1.8;
}

/* ==========================================================================
   7. SECCIÓN COMPARATIVA (TABLA)
   ========================================================================== */
.comparison {
    padding: 100px 0;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    /*border-radius: 8px;*/
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comparison-table th, .comparison-table td {
    padding: 20px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background-color: var(--dark-graphite);
    color: var(--white);
    font-weight: 600;
}

.comparison-table th.highlight-th {
    background-color: var(--purple-main);
}

.comparison-table td.highlight-td {
    background-color: rgba(77, 35, 128, 0.02);
    font-weight: 500;
}
/* ==========================================================================
   8. SECCIÓN DE PLANES / PRICING (LWHATSAPP)
   ========================================================================== */
.pricing {
    padding: 100px 0;
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: stretch;
    margin-top: 40px;
}

.pricing-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px 32px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

/* Estilos para el plan Destacado (Pro) */
.pricing-card.featured {
    border-color: var(--purple-main);
    box-shadow: 0 10px 30px rgba(77, 35, 128, 0.08);
}

.plan-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--purple-main);
    color: var(--white);
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.pricing-header {
    margin-bottom: 32px;
}

.pricing-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-graphite);
    margin-bottom: 12px;
}

.plan-desc {
    font-size: 14px;
    color: var(--gray-text);
    min-height: 44px; /* Mantiene alineados los precios */
    line-height: 1.4;
}

.price {
    font-size: 48px;
    font-weight: 700;
    color: var(--dark-graphite);
    line-height: 1;
    margin-top: 16px;
}

.price span {
    font-size: 24px;
    font-weight: 600;
    vertical-align: super;
    margin-right: 2px;
}

.price small {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-text);
}

.plan-features {
    list-style: none;
    margin-bottom: 40px;
    flex-grow: 1; /* Empuja el botón hacia abajo para que todos queden alineados */
}

.plan-features li {
    font-size: 14px;
    color: var(--dark-graphite);
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.plan-features li:last-child {
    border-bottom: none;
}

/* Ajustes en Media Queries existentes para soportar Tablets y Móviles */
@media (max-width: 992px) {
    .pricing-grid {
        grid-template-columns: 1fr; /* Una sola columna en tablets/móviles */
        gap: 40px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ==========================================================================
   8. FORMULARIO DE CONTACTO
   ========================================================================== */
.contact {
    padding: 100px 0;
    background: #252833;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 80px;
    align-items: center;
}

.contact h2 {
    font-size: 38px;
    margin-bottom: 20px;
    color: var(--purple-light);
    line-height: 1.2;
}

.contact p {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.8;
}

.contact-meta p {
    margin-bottom: 12px;
    font-size: 16px;
    color: #E2E2E9;
    line-height: 1.8;
}

.contact-card {
    padding: 40px;
    /*box-shadow: var(--shadow);*/
    color: #E2E2E9;

}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--purple-main);
    box-shadow: 0 0 0 3px var(--purple-light);
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer {
    background-color: var(--dark-graphite);
    color: #A2A5B5;
    padding: 40px 0;
    border-top: 1px solid #3A3F50;
    font-size: 14px;
}

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

.footer-tag {
    color: var(--white);
    font-weight: 500;
}

/* ==========================================================================
   10. MEDIA QUERIES (SOPORTE RESPONSIVO GLOBAL)
   ========================================================================== */
@media (max-width: 992px) {
    /* El Hero pasa a ser vertical y se centra */
    .hero {
        padding: 60px 0;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }
    .hero-content p {
        margin: 0 auto 32px auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-image-wrapper {
        justify-content: center;
    }
    .hero-img {
        max-width: 540px;
    }

    /* Modulos colapsables verticales */
    .architecture-wrapper, .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* El lienzo del mapa permite scroll horizontal si la pantalla es muy chica */
    .diagram-canvas {
        overflow-x: auto;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 32px;
    }
    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .contact-card {
        padding: 24px;
    }
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}