/* D-Nexus - capa de diseño "neón" (se carga DESPUÉS de tailwind.css y styles.css)
   Fondo oscuro con brillos cian/magenta, tarjetas de cristal con borde degradado,
   botones neón y navbar nuevo. No requiere recompilar Tailwind. */

:root {
    --nx-h: 4.2rem;
    --nx-cyan: #00f0ff;
    --nx-purple: #c026d3;
    --nx-pink: #e879f9;
    --nx-bg: #03050c;
    --nx-glass: rgba(8, 12, 26, 0.52);
    --nx-muted: #cbd5e1;
}

/* ================= BASE ================= */
/* clip (no hidden): evita el scroll horizontal sin crear un contenedor de scroll que rompa el header fijo */
html, body { overflow-x: clip !important; }
html body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background-color: var(--nx-bg);
}
/* Reemplaza la foto fija anterior por brillos suaves cian/magenta */
body::before {
    background-image:
        radial-gradient(ellipse 60% 40% at 8% 0%, rgba(0, 240, 255, 0.10), transparent 70%),
        radial-gradient(ellipse 55% 45% at 100% 20%, rgba(192, 38, 211, 0.12), transparent 70%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(0, 102, 255, 0.07), transparent 70%);
    background-size: auto;
}
#bg-canvas { display: none; }
::selection { background: rgba(192, 38, 211, 0.55); color: #fff; }

/* ================= NAVBAR NUEVO ================= */
.nx-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: sticky; top: 0; z-index: 50; width: 100%;
    height: var(--nx-h); padding: 0 4%;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nx-header.nx-scrolled {
    background: rgba(3, 5, 12, 0.72);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(0, 240, 255, 0.14);
}
/* Al saltar a un ancla, deja libre el header sticky */
section[id], span[id] { scroll-margin-top: calc(var(--nx-h) + 1rem); }
.nx-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; line-height: 1; }
.nx-logo img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; border: 1px solid rgba(0, 240, 255, 0.3); }
.nx-logo-text { display: flex; flex-direction: column; }
.nx-logo-title { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.5px; color: #fff; text-shadow: 0 0 20px rgba(0, 240, 255, 0.3); }
.nx-logo-title span { color: var(--nx-cyan); }
.nx-logo-sub { font-size: 0.54rem; letter-spacing: 3.2px; color: #94a3b8; margin-top: 3px; }

.nx-nav { display: none; }
.nx-nav ul { display: flex; list-style: none; gap: 1.8rem; }
.nx-nav a {
    position: relative; padding-bottom: 4px; text-decoration: none;
    color: #e2e8f0; font-size: 0.88rem; font-weight: 500; transition: color 0.25s ease;
}
.nx-nav a:hover, .nx-nav a[aria-current="page"] { color: #fff; }
.nx-nav a[aria-current="page"]::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--nx-cyan), var(--nx-pink)); box-shadow: 0 0 10px var(--nx-cyan);
}

.nx-actions { display: flex; align-items: center; gap: 0.75rem; }
.nx-btn-contact { display: none; }
.nx-menu-btn {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer;
    border-radius: 12px; color: var(--nx-cyan); background: rgba(8, 13, 28, 0.55);
    border: 1px solid rgba(0, 240, 255, 0.35); transition: background 0.2s;
}
.nx-menu-btn:hover { background: rgba(0, 240, 255, 0.12); }

.nx-mobile {
    display: flex; flex-direction: column; gap: 0.4rem;
    position: fixed; top: calc(var(--nx-h) + 0.25rem); left: 4%; right: 4%; z-index: 60;
    padding: 1rem; border-radius: 16px;
    background: rgba(6, 10, 22, 0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.25);
}
.nx-mobile.hidden { display: none; }
.nx-mobile a { color: #e2e8f0; text-decoration: none; font-size: 0.95rem; padding: 0.6rem 0.75rem; border-radius: 10px; transition: background 0.2s; }
.nx-mobile a:hover, .nx-mobile a[aria-current="page"] { background: rgba(0, 240, 255, 0.1); color: #fff; }
.nx-mobile a.nx-mobile-cta { margin-top: 0.4rem; text-align: center; font-weight: 600; background: linear-gradient(90deg, rgba(0, 240, 255, 0.18), rgba(217, 70, 239, 0.28)); border: 1px solid rgba(0, 240, 255, 0.4); }

@media (min-width: 1100px) {
    .nx-nav { display: block; }
    .nx-btn-contact { display: inline-flex; }
    .nx-menu-btn { display: none; }
    .nx-mobile, .nx-mobile.hidden { display: none; }
}

/* Botón "Cotizar Proyecto" del navbar (contorno degradado) */
.nx-btn-contact {
    align-items: center; gap: 0.45rem; position: relative; padding: 0.5rem 1.25rem; border-radius: 999px;
    color: #fff; text-decoration: none; font-size: 0.86rem; font-weight: 500;
    background: rgba(8, 13, 28, 0.55); backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.nx-btn-contact::before,
a[class~="from-blue-600"][class~="bg-gradient-to-r"]::before,
button[class~="from-blue-600"][class~="bg-gradient-to-r"]::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: linear-gradient(135deg, var(--nx-cyan), #a855f7, var(--nx-pink));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.nx-btn-contact:hover { transform: translateY(-2px); box-shadow: 0 0 24px rgba(0, 240, 255, 0.45); }

/* ================= BOTONES PRINCIPALES (todas las páginas) ================= */
a[class~="from-blue-600"][class~="bg-gradient-to-r"],
button[class~="from-blue-600"][class~="bg-gradient-to-r"] {
    position: relative;
    background-image: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(217, 70, 239, 0.25)) !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
}
a[class~="from-blue-600"][class~="bg-gradient-to-r"]:hover,
button[class~="from-blue-600"][class~="bg-gradient-to-r"]:hover {
    box-shadow: -8px 0 28px rgba(0, 240, 255, 0.5), 8px 0 28px rgba(217, 70, 239, 0.55);
}
/* Botones secundarios de contorno */
a[class~="border-cyan-400/50"] { background: rgba(8, 13, 28, 0.55); border-color: rgba(0, 240, 255, 0.5); backdrop-filter: blur(12px); }
a[class~="border-cyan-400/50"]:hover { box-shadow: 0 0 22px rgba(0, 240, 255, 0.3); }

/* ================= TARJETAS DE CRISTAL ================= */
.card, .service-box, .about-box, .glass-panel {
    position: relative;
    background: var(--nx-glass);
    border: 1px solid transparent !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4);
}
.glass-panel.rounded-full { box-shadow: none; }
.card::before, .service-box::before, .about-box::before, .glass-panel::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.3px; pointer-events: none;
    background: linear-gradient(135deg, var(--nx-cyan), rgba(192, 132, 252, 0.8), var(--nx-pink));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0.55; transition: opacity 0.3s ease;
}
.card:hover, .service-box:hover, .about-box:hover, .glass-panel.group:hover {
    box-shadow: 0 0 26px rgba(0, 240, 255, 0.22), 0 20px 40px rgba(0, 0, 0, 0.5);
}
.card:hover::before, .service-box:hover::before, .about-box:hover::before, .glass-panel.group:hover::before { opacity: 1; }
/* El menú móvil viejo y los contenedores ya no usan estas reglas */
.nx-mobile::before { display: none; }

/* FAQ con el mismo lenguaje visual */
.faq-item { background: var(--nx-glass); border: 1px solid rgba(0, 240, 255, 0.28); }
.faq-item[open] { border-color: rgba(232, 121, 249, 0.6); }

/* Pie de página */
footer { border-top: 1px solid transparent !important; border-image: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.5), rgba(232, 121, 249, 0.5), transparent) 1; }
.legal-links a { color: var(--nx-cyan); }

/* ================= HERO DE INICIO ================= */
.nx-hero {
    position: relative; width: 100%;
    min-height: calc(100vh - var(--nx-h)); min-height: calc(100svh - var(--nx-h));
    display: flex; flex-direction: column; justify-content: space-between; gap: 0.75rem;
    padding-bottom: 1.25rem;
}
.nx-hero > * { position: relative; z-index: 15; }

/* Imagen de la laptop fija en toda la página; el scroll la atenúa (--dim 0→1, lo escribe main.js) pero no desaparece */
.nx-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; --dim: 0; }
.nx-bg::before {
    content: ''; position: absolute; inset: 0;
    background: url('../img/bg-dnexus.webp') center right / cover no-repeat;
    filter: saturate(1.28) contrast(1.06) brightness(1.04);
}
/* Video de portada: cubre la capa; si no carga o hay "reducir movimiento", queda la imagen de ::before */
.nx-bg-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center right;
    filter: saturate(1.1) contrast(1.05);
}
@media (prefers-reduced-motion: reduce) { .nx-bg-video { display: none; } }
@media (max-width: 640px) { .nx-bg-video { object-position: 70% center; } }
.nx-bg::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,calc(0.95 - var(--dim) * 0.3)) 0%, rgba(0,0,0,calc(0.82 - var(--dim) * 0.3)) 26%, rgba(0,0,0,calc(0.38 - var(--dim) * 0.12)) 50%, rgba(0,0,0,0.06) 70%, transparent 100%),
        linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 16%, transparent 80%, rgba(3,5,12,0.5) 100%),
        rgba(3, 5, 12, calc(var(--dim) * 0.34));
}

.nx-hero-center { display: flex; align-items: center; flex: 1; padding: 1rem 4%; }
.nx-hero-main { max-width: 720px; }
.nx-hero-title {
    font-size: clamp(2rem, 3.4vw, 3.1rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance;
    margin-bottom: 1.1rem; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7);
}
.nx-hero-title .hl { color: var(--nx-cyan); text-shadow: 0 0 30px rgba(0, 240, 255, 0.4); }
.nx-hero-sub {
    font-size: clamp(0.95rem, 1.05vw, 1.05rem); line-height: 1.6; color: var(--nx-muted);
    max-width: 480px; margin-bottom: 1.75rem; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.nx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.nx-btn-primary {
    display: inline-flex; align-items: center; gap: 0.65rem; position: relative;
    padding: 0.8rem 1.7rem; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 500; font-size: 0.95rem;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(217, 70, 239, 0.25)); backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}
.nx-btn-primary::before {
    content: ''; position: absolute; inset: 0; border-radius: 999px; padding: 1.6px; pointer-events: none;
    background: linear-gradient(90deg, var(--nx-cyan), #a855f7, var(--nx-pink));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.nx-btn-primary:hover { transform: translateY(-2px); box-shadow: -8px 0 28px rgba(0, 240, 255, 0.5), 8px 0 28px rgba(217, 70, 239, 0.55); }
.nx-btn-video { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: transform 0.2s ease; }
.nx-btn-video:hover { transform: translateX(3px); }
.nx-play {
    width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
    background: rgba(8, 13, 28, 0.65); border: 1.5px solid var(--nx-cyan); color: var(--nx-cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.5); padding-left: 2px;
}

.nx-arrow { display: none; }
@media (min-width: 1100px) {
    /* Con el botón "Cotizar Proyecto" visible en el navbar, el del hero sobra: "Ver portafolio" toma su lugar */
    .nx-only-compact { display: none; }
    .nx-btn-video {
        position: relative; gap: 0.65rem; padding: 0.8rem 1.7rem; border-radius: 999px;
        background: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(217, 70, 239, 0.25)); backdrop-filter: blur(12px);
    }
    .nx-btn-video::before {
        content: ''; position: absolute; inset: 0; border-radius: 999px; padding: 1.6px; pointer-events: none;
        background: linear-gradient(90deg, var(--nx-cyan), #a855f7, var(--nx-pink));
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor; mask-composite: exclude;
    }
    .nx-btn-video:hover { transform: translateY(-2px); box-shadow: -8px 0 28px rgba(0, 240, 255, 0.5), 8px 0 28px rgba(217, 70, 239, 0.55); }
    .nx-play { display: none; }
    .nx-arrow { display: inline; font-size: 0.75rem; }
}

/* Franja de datos: una sola línea discreta, sin caja, alineada a la izquierda (no tapa la laptop) */
.nx-hero-bottom { padding: 0 4%; }
.nx-stats {
    list-style: none; display: flex; max-width: 720px; padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.nx-stat { flex: 1; display: flex; align-items: center; gap: 0.7rem; padding: 0 1.25rem; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.nx-stat:first-child { padding-left: 0; border-left: 0; }
.nx-stat > i { font-size: 1.1rem; color: var(--nx-cyan); filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.55)); flex-shrink: 0; }
.nx-stat:nth-child(2) > i { color: #d946ef; filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.55)); }
.nx-stat strong { display: block; font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.nx-stat span { display: block; font-size: 0.75rem; color: var(--nx-muted); margin-top: 2px; }

/* Páginas interiores: misma imagen fija, perfil más claro y constante (no depende del scroll) */
.nx-bg--page::after {
    background:
        linear-gradient(90deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.38) 35%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0.05) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 16%),
        rgba(3, 5, 12, 0.3);
}

/* Bloque "Rápidos y Escalables" a todo el ancho (ya no comparte fila con las métricas) */
.nx-wide { grid-column: 1 / -1; }

@media (max-width: 640px) {
    .nx-hero { padding-bottom: 4.5rem; } /* deja libre la zona del botón flotante de WhatsApp */
    /* CTAs del hero: mismo tamaño y ancho completo */
    .nx-cta { flex-direction: column; align-items: stretch; gap: 0.85rem; }
    .nx-btn-primary, .nx-btn-video {
        width: 100%; justify-content: center; min-height: 50px;
        padding: 0.8rem 1.25rem; border-radius: 999px; font-size: 0.95rem;
    }
    .nx-btn-video {
        background: rgba(8, 13, 28, 0.55); border: 1px solid rgba(0, 240, 255, 0.45);
        backdrop-filter: blur(12px);
    }
    .nx-play { display: none; }
    .nx-arrow { display: inline; font-size: 0.75rem; }
    .nx-bg::before { background-position: 70% center; }
    .nx-logo-title { font-size: 1.25rem; }
    .nx-stat { padding: 0 0.6rem; }
    .nx-stat > i { display: none; }
    .nx-stat strong { font-size: 0.85rem; }
    .nx-stat span { font-size: 0.7rem; }

    /* Selector de modalidad: bordes definidos al apilarse */
    .pricing-switch { border-radius: 1.1rem; }
    .pricing-switch::before { opacity: 0.35; }
    .pricing-switch button {
        border-radius: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .pricing-switch button.bg-gradient-to-r { border-color: rgba(103, 232, 249, 0.55); }
}

/* Comparativa de planes: en móvil, filas apiladas en lugar de tabla con scroll horizontal */
@media (max-width: 780px) {
    #comparativa > .glass-panel { overflow-x: visible; }
    #comparativa table { display: block; width: 100%; min-width: 0; }
    #comparativa thead { display: none; }
    #comparativa tbody { display: block; }
    #comparativa tbody tr {
        display: block; padding: 0.9rem 0.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    #comparativa tbody tr:first-child { border-top: 0; padding-top: 0.25rem; }
    #comparativa tbody th[scope="row"] {
        display: block; padding: 0 0 0.55rem; font-size: 0.95rem;
        color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    #comparativa tbody td {
        display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
        padding: 0.45rem 0; text-align: right;
    }
    #comparativa tbody td + td { border-top: 1px dashed rgba(255, 255, 255, 0.06); }
    #comparativa tbody td::before {
        content: attr(data-label); flex: 0 0 auto; text-align: left;
        font-size: 0.72rem; font-weight: 600; color: #67e8f9;
    }
}
