:root {
    --primary: #0F766E;
    --primary-dark: #115E59;
    --secondary: #0F172A;
    --accent: #F59E0B;
    --danger: #EF4444;
    --success: #10B981;
    --theme-glow: #10B981;
    --bg-dark: #0B1120;
    --card-bg: rgba(30, 41, 59, 0.78);
    --border-glass: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: #F8FAFC;
    line-height: 1.55;
    overflow-x: hidden;
    width: 100%;
}

/* Header */
header {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.7rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #2DD4BF;
    text-decoration: none;
}

.logo img {
    height: 44px;
    width: 44px;
    border-radius: 50%;
    object-fit: contain;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    text-decoration: none;
    color: #CBD5E1;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #2DD4BF;
}

.btn-cta {
    background: var(--primary);
    color: white !important;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #2DD4BF;
    cursor: pointer;
}

/* ESCENARIO INTERACTIVO: RULETA + TARJETAS DINÁMICAS */
.interactive-stage {
    padding: 105px 1.5rem 3rem;
    max-width: 1260px;
    margin: 0 auto;
    position: relative;
}

/* Luz ambiental que cambia según la estación */
.ambient-orb {
    position: fixed;
    top: 15%;
    left: 25%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--theme-glow) 0%, transparent 70%);
    opacity: 0.16;
    filter: blur(70px);
    pointer-events: none;
    transition: background 0.6s ease;
    z-index: 0;
}

.stage-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #FDE68A;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.75rem;
}

.stage-header h1 {
    font-size: 2.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.stage-header h1 span {
    color: #2DD4BF;
}

.stage-header p {
    color: #94A3B8;
    max-width: 680px;
    margin: 0 auto;
    font-size: 0.98rem;
}

/* LAYOUT DIVIDIDO: RULETA A LA IZQUIERDA, TARJETAS A LA DERECHA */
.cockpit-grid {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    /* minmax(0, 1fr) impide que la columna derecha se desborde */
    gap: 2rem;
    align-items: start;
    position: relative;
    z-index: 2;
    max-width: 100%;
}

/* ==========================================
   LA RULETA / BRÚJULA CLIMÁTICA 360°
   ========================================== */
.wheel-panel {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 1.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 90px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.wheel-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0.5rem auto 1.25rem;
    user-select: none;
}

/* Anillo exterior decorativo con las 4 estaciones */
.wheel-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.14);
    background: conic-gradient(from -15deg,
            rgba(245, 158, 11, 0.12) 0deg 90deg,
            /* Verano */
            rgba(234, 88, 12, 0.12) 90deg 180deg,
            /* Otoño */
            rgba(2, 132, 199, 0.14) 180deg 270deg,
            /* Invierno */
            rgba(16, 185, 129, 0.14) 270deg 360deg
            /* Primavera */
        );
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

/* Aguja indicadora que gira hacia el mes activo */
.wheel-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 135px;
    background: linear-gradient(to top, transparent 15%, var(--theme-glow) 100%);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    pointer-events: none;
    border-radius: 4px;
}

/* Botones de cada uno de los 12 meses */
.month-node {
    position: absolute;
    width: 52px;
    height: 52px;
    margin-left: -26px;
    margin-top: -26px;
    border-radius: 50%;
    background: #1E293B;
    border: 2px solid rgba(255, 255, 255, 0.18);
    color: #CBD5E1;
    font-weight: 800;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.month-node small {
    font-size: 0.62rem;
    opacity: 0.75;
    font-weight: 600;
}

.month-node:hover {
    transform: scale(1.13);
    border-color: white;
    color: white;
}

.month-node.active {
    background: var(--theme-glow);
    color: #0B1120;
    border-color: white;
    transform: scale(1.22);
    box-shadow: 0 0 22px var(--theme-glow);
}

.month-node.is-today::after {
    content: "HOY";
    position: absolute;
    bottom: -14px;
    background: var(--accent);
    color: #0F172A;
    font-size: 0.55rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}

/* Núcleo Central de la Ruleta */
.wheel-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 175px;
    height: 175px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #1E293B, #0F172A);
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    z-index: 5;
}

.core-season-tag {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--theme-glow);
    margin-bottom: 2px;
}

.core-month-name {
    font-size: 1.45rem;
    font-weight: 900;
    color: white;
    line-height: 1.1;
    margin-bottom: 4px;
}

.core-weather {
    font-size: 0.73rem;
    color: #94A3B8;
    line-height: 1.25;
}

/* Controles rápidos bajo la ruleta */
.wheel-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    justify-content: center;
}

.btn-spin-step {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-spin-step:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-random-spin {
    background: linear-gradient(135deg, #0F766E, #14B8A6);
    border: none;
    color: white;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

/* ==========================================
   MAZO DE TARJETAS DINÁMICAS (DERECHA)
   ========================================== */
.cards-deck-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    /* CRÍTICO: evita que los filtros horizontales empujen las tarjetas fuera de pantalla */
    max-width: 100%;
}

.climate-alert-banner {
    background: rgba(30, 41, 59, 0.85);
    border-left: 4px solid var(--theme-glow);
    border-top: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    padding: 1.1rem 1.35rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-chips-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    max-width: 100%;
    /* Impide que estire el contenedor padre */
    padding-bottom: 6px;
    scrollbar-width: none;
}

.filter-chips-bar::-webkit-scrollbar {
    display: none;
}

.chip-filter {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: #CBD5E1;
    padding: 0.42rem 0.9rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip-filter.active {
    background: white;
    color: #0F172A;
    border-color: white;
    font-weight: 800;
}

.dynamic-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    /* Se adapta solo sin salirse jamás */
    gap: 1.15rem;
    width: 100%;
    min-width: 0;
}

/* Tarjeta individual con animación de entrada */
.mission-card {
    min-width: 0;
    max-width: 100%;
    word-wrap: break-word;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: cardPopIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
    cursor: pointer;
}

@keyframes cardPopIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mission-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.mission-card.selected {
    border-color: #2DD4BF;
    background: linear-gradient(160deg, rgba(15, 118, 110, 0.38), rgba(15, 23, 42, 0.9));
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.22);
}

.m-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.m-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--theme-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.m-system-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    color: #CBD5E1;
}

.mission-card h3 {
    font-size: 1.08rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Termómetro visual de riesgo */
.urgency-meter {
    margin-bottom: 0.75rem;
}

.urgency-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.meter-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.m-consequence {
    background: rgba(15, 23, 42, 0.65);
    border-left: 3px solid var(--accent);
    padding: 0.55rem 0.75rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.8rem;
    color: #E2E8F0;
    margin-bottom: 0.75rem;
}

.m-desc {
    font-size: 0.84rem;
    color: #94A3B8;
    margin-bottom: 1rem;
}

.m-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Permite bajar el botón si la pantalla es muy angosta */
    border-top: 1px solid var(--border-glass);
    padding-top: 0.8rem;
    gap: 0.5rem;
}

.m-plan-tag {
    font-size: 0.72rem;
    color: #5EEAD4;
    font-weight: 700;
}

.btn-card-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.42rem 0.9rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mission-card.selected .btn-card-select {
    background: #10B981;
    border-color: #10B981;
    color: #0B1120;
    font-weight: 800;
}

/* SECCIÓN DE COTIZACIÓN DIRECTA */
.checkout-section {
    max-width: 960px;
    margin: 2rem auto 5rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.checkout-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1.5px solid rgba(45, 212, 191, 0.35);
    border-radius: 24px;
    padding: 2.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.selected-chips-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 1rem;
    margin: 1rem 0 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sel-chip {
    background: #0F766E;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sel-chip button {
    background: none;
    border: none;
    color: #99F6E4;
    cursor: pointer;
    font-size: 0.85rem;
}

.upsell-plan-alert {
    display: none;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 0.9rem 1.15rem;
    margin-bottom: 1.25rem;
    color: #FDE68A;
    font-size: 0.86rem;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.input-dark {
    width: 100%;
    padding: 0.85rem 1rem;
    background: #0F172A;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: white;
    font-size: 0.92rem;
}

.btn-wa-submit {
    width: 100%;
    background: #25D366;
    color: #0B1120;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.btn-wa-submit:hover {
    transform: translateY(-2px);
}

/* BARRA FLOTANTE INFERIOR */
.floating-dock {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #0F172A;
    border: 1.5px solid #2DD4BF;
    padding: 0.75rem 1.35rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    z-index: 1500;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 92vw;
}

.floating-dock.visible {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 1024px) {
    .cockpit-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .wheel-panel {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 85px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #0F172A;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-glass);
    }

    .nav-links.active {
        display: flex;
    }

    .interactive-stage {
        padding: 85px 0.85rem 1.5rem;
    }

    .stage-header h1 {
        font-size: 1.55rem;
    }

    .wheel-wrapper {
        width: 270px;
        height: 270px;
    }

    .wheel-needle {
        height: 102px;
    }

    .wheel-core {
        width: 132px;
        height: 132px;
        padding: 0.6rem;
    }

    .core-month-name {
        font-size: 1.1rem;
    }

    .month-node {
        width: 40px;
        height: 40px;
        margin-left: -20px;
        margin-top: -20px;
        font-size: 0.68rem;
    }

    .dynamic-cards-grid,
    .form-grid-2 {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.9rem;
    }

    .mission-card {
        padding: 1.1rem;
    }

    .checkout-section {
        padding: 0 0.85rem;
    }

    .checkout-card {
        padding: 1.25rem 1rem;
    }
}

/* =========================================================
   SISTEMA DÍA (LIGHT MODE REFINADO) Y NOCHE PARA ANUARIO
   ========================================================= */
:root:not([data-theme="dark"]) {
    --bg-dark: #F8FAFC;
    --card-bg: #FFFFFF;
    --border-glass: #E2E8F0;
}

:root:not([data-theme="dark"]) body {
    background-color: #F8FAFC;
    color: #334155;
}

:root:not([data-theme="dark"]) .ambient-orb {
    opacity: 0.08;
}

/* Píldora superior y títulos */
:root:not([data-theme="dark"]) .live-pill {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

:root:not([data-theme="dark"]) .stage-header h1,
:root:not([data-theme="dark"]) .mission-card h3,
:root:not([data-theme="dark"]) .checkout-card h2 {
    color: #0F172A;
}

:root:not([data-theme="dark"]) .stage-header h1 span {
    color: #0F766E;
}

:root:not([data-theme="dark"]) .stage-header p,
:root:not([data-theme="dark"]) .m-desc,
:root:not([data-theme="dark"]) .checkout-card p {
    color: #475569 !important;
}

/* Paneles y Ruleta en Modo Día */
:root:not([data-theme="dark"]) .wheel-panel,
:root:not([data-theme="dark"]) .mission-card,
:root:not([data-theme="dark"]) .climate-alert-banner,
:root:not([data-theme="dark"]) .checkout-card {
    background: #FFFFFF;
    border-color: #CBD5E1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

:root:not([data-theme="dark"]) .wheel-ring {
    border-color: #CBD5E1;
    box-shadow: inset 0 0 25px rgba(15, 23, 42, 0.05);
}

:root:not([data-theme="dark"]) .month-node {
    background: #FFFFFF;
    border: 2px solid #CBD5E1;
    color: #334155;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

:root:not([data-theme="dark"]) .month-node:hover {
    border-color: #0F766E;
    color: #0F766E;
}

:root:not([data-theme="dark"]) .month-node.active {
    background: var(--theme-glow);
    color: #FFFFFF;
    border-color: #0F172A;
}

:root:not([data-theme="dark"]) .btn-random-spin[onclick="girarRuletaAzar()"] {
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    box-shadow: none;
}

/* Tarjetas dinámicas y medidores en Modo Día */
:root:not([data-theme="dark"]) .mission-card:hover {
    border-color: #0F766E;
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.12);
}

:root:not([data-theme="dark"]) .mission-card.selected {
    background: #F0FDFA;
    border-color: #0F766E;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.15);
}

:root:not([data-theme="dark"]) #bannerAdvice,
:root:not([data-theme="dark"]) .urgency-label-row span:first-child {
    color: #0F172A !important;
}

:root:not([data-theme="dark"]) .meter-track {
    background: #E2E8F0;
}

:root:not([data-theme="dark"]) .chip-filter,
:root:not([data-theme="dark"]) .m-system-badge,
:root:not([data-theme="dark"]) .m-icon-box,
:root:not([data-theme="dark"]) .btn-spin-step {
    background: #F1F5F9;
    color: #334155;
    border-color: #CBD5E1;
}

:root:not([data-theme="dark"]) .m-icon-box {
    color: #0F766E;
}

:root:not([data-theme="dark"]) .chip-filter.active {
    background: #0F766E;
    color: #FFFFFF;
    border-color: #0F766E;
}

:root:not([data-theme="dark"]) .m-consequence {
    background: #FFFBEB;
    color: #92400E;
    border-left-color: #F59E0B;
}

:root:not([data-theme="dark"]) .m-plan-tag {
    color: #0F766E;
}

:root:not([data-theme="dark"]) .btn-card-select {
    background: #F8FAFC;
    color: #0F766E;
    border-color: #0F766E;
}

/* Sección Cotizador Inferior en Modo Día */
:root:not([data-theme="dark"]) .checkout-card span[style*="#2DD4BF"] {
    color: #0F766E !important;
}

:root:not([data-theme="dark"]) .selected-chips-box,
:root:not([data-theme="dark"]) .input-dark {
    background: #F8FAFC;
    color: #0F172A;
    border-color: #CBD5E1;
}

:root:not([data-theme="dark"]) #rouletteForm label {
    color: #1E293B !important;
}

:root:not([data-theme="dark"]) .upsell-plan-alert {
    background: #FFFBEB;
    border-color: #F59E0B;
    color: #92400E;
}

:root:not([data-theme="dark"]) .upsell-plan-alert label {
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: 1px solid #F59E0B;
}

/* =========================================================
HEADER MAESTRO UNIFICADO + DROPDOWN + ELEVATOR LATERAL
========================================================= */
:root {
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --border: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.96);
}

[data-theme="dark"] {
    --surface: #1e293b;
    --surface-soft: #0f172a;
    --border: rgba(255, 255, 255, 0.12);
    --header-bg: rgba(15, 23, 42, 0.94);
}

header {
    background-color: var(--header-bg) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1240px !important;
    margin: 0 auto;
    padding: 0.65rem 1.5rem !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    flex-shrink: 0;
}

.logo img {
    height: 46px !important;
    width: 46px !important;
    object-fit: contain;
    border-radius: 50%;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links>a {
    margin: 0 !important;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-links>a:hover {
    color: var(--primary);
}

.nav-links .btn-cta {
    background-color: var(--primary);
    color: #ffffff !important;
    padding: 0.52rem 1.1rem !important;
    border-radius: 8px;
    font-weight: 700 !important;
    font-size: 0.86rem !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-login-nav {
    border: 1.5px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-main) !important;
    padding: 0.48rem 0.9rem !important;
    border-radius: 8px;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
}

.btn-login-nav:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
}

.theme-toggle-btn {
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 !important;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.nav-mobile-actions {
    display: none;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.65rem;
    color: var(--primary);
    cursor: pointer;
}

/* Dropdown de Especialidades */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropbtn {
    background: none;
    border: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0;
    white-space: nowrap;
}

.nav-dropbtn i {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropbtn {
    color: var(--primary);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--surface);
    min-width: 250px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    padding: 0.5rem;
    z-index: 1100;
}

.nav-dropdown-content::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

@media (min-width: 981px) {
    .nav-dropdown:hover .nav-dropdown-content {
        display: block;
    }
}

.nav-dropdown.open .nav-dropdown-content {
    display: block;
}

.nav-dropdown.open .nav-dropbtn i {
    transform: rotate(180deg);
}

.nav-dropdown-content a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 0.58rem 0.75rem !important;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main) !important;
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    width: 100% !important;
    text-align: left !important;
}

.nav-dropdown-content a i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-dropdown-content a:hover {
    background: var(--surface-soft);
    color: var(--primary) !important;
}

.dropdown-footer-link {
    border-top: 1px solid var(--border);
    margin-top: 0.3rem !important;
    padding-top: 0.6rem !important;
    color: var(--primary) !important;
    justify-content: center;
}

/* Elevator Lateral de Secciones (Puntos de Scroll) */
.section-elevator {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
}

.elevator-dot {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.38);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
}

.elevator-dot:hover,
.elevator-dot.active {
    background: var(--primary);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(15, 118, 110, 0.5);
}

.elevator-label {
    position: absolute;
    right: 22px;
    background: #1e293b;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.elevator-dot:hover .elevator-label {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 980px) {
    .nav-mobile-actions {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .desktop-only-theme {
        display: none !important;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--surface);
        padding: 0.75rem 1.5rem 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        max-height: 82vh;
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links>a,
    .nav-dropbtn {
        padding: 0.75rem 0 !important;
        width: 100%;
        text-align: left !important;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
    }

    .nav-dropdown {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--surface-soft);
        border-radius: 10px;
        margin: 0.4rem 0;
        width: 100%;
    }

    .nav-links>.btn-cta,
    .nav-links>.btn-login-nav {
        justify-content: center;
        text-align: center !important;
        margin-top: 0.6rem !important;
        padding: 0.75rem !important;
        border-bottom: none;
    }

    .section-elevator {
        display: none;
    }
}

.logo-brand-part {
    color: #0F172A;
    transition: color 0.2s ease;
}

[data-theme="dark"] .logo-brand-part {
    color: #F8FAFC;
}