/* qupapps — base compartida (variables de tema, barra superior, pie de página, botón de WhatsApp).
   Cambia aquí y se actualizan TODAS las páginas. Tema: <html data-theme="dark"> (guardado en localStorage 'qup-theme'). */

:root {
    --bg: #ffffff;
    --bg-card: rgba(255,255,255,0.9);
    --bg-card-solid: #ffffff;
    --bg-nav: rgba(255,255,255,0.75);
    --border: #e5e5ea;

    --text: #1d1d1f;
    --text-2: #55555a;
    --text-3: #757579;

    --marca: #0d1d4a;
    --accion: #4a90e2;
    --accion-hover: #3a7bc8;
    --accion-texto: #ffffff;
    --acento: #4a90e2;
    --acento-label: #2264c4;
    --acento-titulo: #2264c4;
    --bg-subtle: #f4f5f7;
    --text-muted: var(--text-3);

    --problema-bg: #fafafa;
    --solucion-bg: #eef3fb;
    --mockup-header: #eceef2;
    --testimonio-bg: #fafbfd;
    --testimonio-border: #c7cede;

    --sombra: 0 12px 32px rgba(13,29,74,0.10);
    --radio: 24px;
    --seccion: 96px;
}

html[data-theme="dark"] {
    --bg: #0a0e1a;
    --bg-card: rgba(17,24,39,0.6);
    --bg-card-solid: #111827;
    --bg-nav: rgba(10,14,26,0.65);
    --border: rgba(255,255,255,0.08);

    --text: #e0e4ef;
    --text-2: #94a3b8;
    --text-3: #7b8794;

    --marca: #4a90e2;
    --accion: #4a90e2;
    --accion-hover: #6aa5e8;
    --accion-texto: #0a0e1a;
    --acento: #4a90e2;
    --acento-label: #7eb3f0;
    --acento-titulo: #7eb3f0;
    --bg-subtle: #0d1424;

    --problema-bg: rgba(17,24,39,0.4);
    --solucion-bg: rgba(74,144,226,0.07);
    --mockup-header: #141b2d;
    --testimonio-bg: rgba(17,24,39,0.3);
    --testimonio-border: rgba(255,255,255,0.1);

    --sombra: none;
}

/* Reinicio solo dentro de lo que pone la base */
:where(nav.navbar, .mobile-menu, .qfooter, .whatsapp-fab) { box-sizing: border-box; }
:where(nav.navbar, .mobile-menu, .qfooter) :where(*, *::before, *::after) { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
#qup-nav:empty { min-height: 94px; }
#qup-footer:empty { min-height: 320px; }

        /* ============================================================
           NAV — sticky con blur
           ============================================================ */
        nav.navbar {
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 26px 72px;
            background: var(--bg-nav);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border);
        }

        .nav-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            font-family: 'Sora', sans-serif;
            font-weight: 700;
            font-size: 17px;
            color: var(--text);
        }

        .nav-logo img { width: 42px; height: 42px; display: block; }

        .nav-right {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .nav-links {
            display: flex;
            gap: 24px;
            list-style: none;
        }

        .nav-links a {
            color: var(--text-2);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: color 0.2s;
        }

        .nav-links a:hover { color: var(--marca); }

        .theme-toggle {
            padding: 7px 14px;
            border-radius: var(--radio);
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-2);
            font-size: 13px;
            font-weight: 500;
            font-family: 'Inter', sans-serif;
            cursor: pointer;
            transition: background 0.2s;
        }

        .theme-toggle:hover { background: var(--border); }

        .btn-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 12px 30px;
            background: rgba(74,144,226,.85);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: var(--accion-texto);
            text-decoration: none;
            border: 1px solid rgba(255,255,255,.15);
            border-radius: var(--radio);
            font-size: 14px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.2s, transform 0.1s;
        }

        .btn-primary:hover { background: var(--accion); }
        .btn-primary:active { transform: scale(0.97); }


        /* ============================================================
           MENÚ MÓVIL (hamburguesa)
           ============================================================ */
        .hamburger {
            display: none;
            width: 40px;
            height: 40px;
            border: 1px solid var(--border);
            border-radius: var(--radio);
            background: transparent;
            color: var(--text);
            font-size: 20px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
        }

        .mobile-menu {
            position: fixed;
            inset: 0;
            z-index: 999;
            background: rgba(10,14,26,0.7);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 32px;
            opacity: 0;
            pointer-events: none;
            transform: translateY(-10px);
            transition: opacity 0.25s ease, transform 0.25s ease;
        }

        html[data-theme="dark"] .mobile-menu,
        html:not([data-theme]) .mobile-menu {
            background: rgba(10,14,26,0.75);
        }

        .mobile-menu.open {
            opacity: 1;
            pointer-events: auto;
            transform: translateY(0);
        }

        .mobile-menu a {
            font-family: 'Sora', sans-serif;
            font-size: 26px;
            font-weight: 700;
            color: #fff;
            text-decoration: none;
        }

        .mobile-menu .btn-primary {
            margin-top: 12px;
            font-size: 16px;
            padding: 14px 32px;
        }

        .mobile-menu-close {
            position: absolute;
            top: 20px;
            right: 24px;
            width: 40px;
            height: 40px;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 10px;
            background: transparent;
            color: #fff;
            font-size: 20px;
            cursor: pointer;
        }


        /* Mejora 5 — Botón flotante WhatsApp (FAB) */
        .whatsapp-fab {
            position: fixed;
            bottom: 28px;
            right: 28px;
            z-index: 9999;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: #25d366;
            display: flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            box-shadow: 0 4px 20px rgba(37,211,102,0.45);
            transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
            opacity: 0;
            transform: scale(0.75);
            pointer-events: none;
        }
        .whatsapp-fab.visible {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }
        .whatsapp-fab:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 28px rgba(37,211,102,0.6);
        }
        .whatsapp-fab::before {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: rgba(37,211,102,0.35);
            animation: wafab-pulse 2.6s ease-out infinite;
        }
        @keyframes wafab-pulse {
            0%   { transform: scale(1);   opacity: 0.7; }
            70%  { transform: scale(1.6); opacity: 0; }
            100% { transform: scale(1.6); opacity: 0; }
        }


/* Estados del botón dentro de páginas con enlaces propios */
.btn-primary:hover { color: var(--accion-texto); }
nav.navbar .nav-logo { color: var(--text); }

/* ============================================================
   PIE DE PÁGINA
   ============================================================ */
.qfooter {
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
    padding: 64px 72px 28px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}
.qf-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(4, 1fr);
    gap: 40px;
}
.qf-brand img { height: 36px; width: auto; display: block; }
.qf-brand p { font-size: 14px; color: var(--text-2); margin: 16px 0 20px; max-width: 270px; }
.qf-social { display: flex; gap: 10px; }
.qf-social a {
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2); text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.qf-social a:hover { background: var(--accion); color: var(--accion-texto); border-color: var(--accion); }
.qf-col h4 {
    font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text); margin-bottom: 16px;
}
.qf-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.qfooter .qf-col a, .qfooter .qf-legal a { font-size: 14px; color: var(--text-2); text-decoration: none; }
.qfooter .qf-col a:hover, .qfooter .qf-legal a:hover { color: var(--acento-label); text-decoration: underline; }
.qf-bottom {
    max-width: 1180px; margin: 48px auto 0; padding-top: 22px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px 24px; flex-wrap: wrap;
    font-size: 13px; color: var(--text-3);
}
.qf-bottom strong { color: var(--text-2); }
.qf-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.qfooter .qf-legal a { font-size: 13px; color: var(--text-3); }

/* ============================================================
   RESPONSIVO DE LA BASE
   ============================================================ */
@media (max-width: 992px) {
    nav.navbar { padding: 22px 32px; }
    .nav-right { gap: 12px; }
    .nav-links { gap: 16px; }
    .theme-toggle { white-space: nowrap; padding: 7px 10px; }
    .qfooter { padding: 56px 32px 24px; }
    .qf-inner { grid-template-columns: repeat(2, 1fr); gap: 36px; }
    .qf-brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    nav.navbar { padding: 16px 20px; }
    .nav-right { gap: 8px; }
    nav.navbar .btn-primary { padding: 10px 14px; font-size: 13px; }
    nav.navbar .theme-toggle { padding: 7px 10px; font-size: 12px; }
    #qup-nav:empty { min-height: 74px; }
    .whatsapp-fab { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    .qfooter { padding: 48px 20px 24px; }
    .qf-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .qf-inner { grid-template-columns: 1fr; }
}
