/* ==========================================================================
   PraxisMD — Motor Estacional & Píldora Clínica (v6.6.5)
   - Día de Muertos: Papel Picado 1:1 en flujo natural + Cempasúchil Botánico
   - Popover compacto de Ofrenda (< 215px, anclado junto al header)
   - Barra de Píldora Clínica del Día en Dashboard (GPC / NOM / ENARE)
   ========================================================================== */

:root {
    --seasonal-accent: transparent;
    --seasonal-glow: transparent;
}

body.theme-muertos {
    --seasonal-accent: #f59e0b;
    --seasonal-glow: rgba(245, 158, 11, 0.24);
}

body.theme-navidad {
    --seasonal-accent: #10b981;
    --seasonal-glow: rgba(16, 185, 129, 0.22);
}

/* Capa atmosférica fija en plano profundo DETRÁS de tarjetas, píldoras y texto (pointer-events: none, z-index: 1) */
#seasonal-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    contain: strict;
}

.seasonal-3d-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.92;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Asegura que los contenedores de fondo permitan ver el canvas z-index: 1 en los espacios oscuros,
   mientras que todas las tarjetas, píldoras, botones y encabezados queden POR ENCIMA (z-index >= 10) */
body.theme-muertos,
body.theme-navidad {
    background-color: #0b1121;
}

body.theme-muertos #app-content,
body.theme-navidad #app-content,
body.theme-muertos #decks-view,
body.theme-navidad #decks-view {
    background-color: transparent !important;
    position: relative;
}

body.theme-muertos main.praxis-main,
body.theme-navidad main.praxis-main,
body.theme-muertos #decks-view > main,
body.theme-navidad #decks-view > main,
body.theme-muertos section,
body.theme-navidad section,
body.theme-muertos footer,
body.theme-navidad footer {
    position: relative;
    z-index: 10;
}

body.theme-muertos .glass-card,
body.theme-muertos .glass-panel,
body.theme-muertos .praxis-daily-pill-bar,
body.theme-muertos #btn-pase-visita,
body.theme-muertos #study-view {
    position: relative;
    z-index: 12;
}

/* ==========================================================================
   1. PAPEL PICADO ARTESANAL (1:1 SIN DEFORMACIÓN · FLUJO NATURAL DE SCROLL)
   ========================================================================== */

.muertos-garland {
    position: relative;
    width: 100%;
    height: 32px;
    pointer-events: none;
    z-index: 12;
    overflow: hidden;
    overflow: clip;
    contain: paint;
    max-width: 100%;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.42));
}

@media (min-width: 768px) {
    .muertos-garland {
        height: 38px;
    }
}

/* En Dashboard: primer hijo de main.praxis-main -> cuelga justo debajo de .praxis-topbar y hace scroll natural */
.muertos-garland.is-dashboard-garland {
    margin-top: -1.5rem;
    margin-bottom: 0.75rem;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .muertos-garland.is-dashboard-garland {
        margin-top: -2rem;
        margin-bottom: 0.9rem;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

/* En Landing (index.html): justo debajo del navbar h-20 (80px), hace scroll natural con la página */
.muertos-garland.is-landing-garland {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    height: 34px;
    z-index: 24;
}

@media (min-width: 768px) {
    .muertos-garland.is-landing-garland {
        height: 40px;
    }
}

/* En Praxicards (flashcards.html): primer hijo de #decks-view > main */
.muertos-garland.is-flashcards-garland {
    margin-top: -1rem;
    margin-bottom: 0.75rem;
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
}

.muertos-garland svg {
    width: 100%;
    height: 100%;
    display: block;
}

.muertos-garland .pp-flag {
    transform-box: fill-box;
    transform-origin: top center;
    animation: papelPicadoBreeze 4.8s ease-in-out infinite alternate;
    animation-delay: calc(var(--pp-idx, 0) * -0.32s);
}

@keyframes papelPicadoBreeze {
    0% {
        transform: rotate(-0.8deg) scaleY(0.99);
    }
    100% {
        transform: rotate(0.9deg) scaleY(1.02);
    }
}

/* Resplandor cálido de veladoras en los bordes de la pantalla */
body.theme-muertos #seasonal-atmosphere::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 0%, rgba(251, 146, 60, 0.09), transparent 38%),
        radial-gradient(circle at 88% 0%, rgba(217, 70, 239, 0.07), transparent 38%),
        radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.06), transparent 44%);
}

/* ==========================================================================
   2. CHIPS INTERACTIVOS DE HEADER (DASHBOARD, LANDING Y PRAXICARDS)
   ========================================================================== */

.seasonal-hero-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 0.65rem;
    position: relative;
    z-index: 26;
}
.seasonal-hero-wrap:has(.seasonal-hero-badge.hidden) {
    display: none;
}

body.theme-muertos .hero-landing-section,
body.theme-navidad .hero-landing-section {
    padding-top: 8.75rem !important;
}
@media (min-width: 1024px) {
    body.theme-muertos .hero-landing-section,
    body.theme-navidad .hero-landing-section {
        padding-top: 9.75rem !important;
        padding-bottom: 5.5rem !important;
    }
}

body.theme-muertos #seasonal-edition:not(.hidden),
body.theme-muertos .seasonal-hero-badge:not(.hidden),
.seasonal-inline-header-chip:not(.hidden) {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 70, 239, 0.14));
    border: 1px solid rgba(251, 191, 36, 0.46);
    color: #fef3c7;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

#seasonal-edition,
.seasonal-edition {
    padding: 0.18rem 0.62rem;
    border-radius: 9999px;
    font-size: 0.64rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

body.theme-muertos .seasonal-hero-badge,
body.theme-navidad .seasonal-hero-badge {
    padding: 0.34rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.seasonal-inline-header-chip {
    padding: 0.24rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.66rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

body.theme-muertos #seasonal-edition:hover,
body.theme-muertos .seasonal-hero-badge:hover,
.seasonal-inline-header-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(251, 191, 36, 0.82);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   3. POPOVER COMPACTO DE OFRENDA (ANCLADO ARRIBA · < 215px ALTO)
   ========================================================================== */

.seasonal-ofrenda-popover {
    position: fixed;
    top: 70px;
    right: 12px;
    left: 12px;
    z-index: 95;
    max-width: 380px;
    margin-left: auto;
    pointer-events: auto;
    animation: ofrendaPopoverIn 0.24s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (min-width: 640px) {
    .seasonal-ofrenda-popover {
        top: 84px;
        right: 24px;
        left: auto;
        width: 376px;
    }
}

@keyframes ofrendaPopoverIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ofrenda-popover-card {
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.97) 0%, rgba(26, 16, 40, 0.97) 100%);
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 1.15rem;
    padding: 0.85rem 0.95rem;
    box-shadow:
        0 20px 44px -12px rgba(0, 0, 0, 0.82),
        0 0 24px rgba(245, 158, 11, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #f8fafc;
}

.ofrenda-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.ofrenda-popover-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ofrenda-popover-emblem {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.22), rgba(15, 23, 42, 0.88));
    border: 1px solid rgba(251, 191, 36, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ofrenda-emblem-svg {
    width: 34px;
    height: 34px;
}

.muertos-ecg-trace {
    stroke-dasharray: 90;
    stroke-dashoffset: 90;
    animation: muertosEcgPulse 3.2s ease-in-out infinite;
}

@keyframes muertosEcgPulse {
    0% { stroke-dashoffset: 90; opacity: 0.35; }
    45% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: -90; opacity: 0.35; }
}

.ofrenda-popover-kicker {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #fbbf24;
    line-height: 1.15;
}

.ofrenda-popover-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin: 0.1rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ofrenda-popover-top-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ofrenda-btn-ghost {
    padding: 0.28rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(30, 41, 59, 0.78);
    color: #cbd5e1;
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.ofrenda-btn-ghost:hover {
    background: rgba(51, 65, 85, 0.92);
    color: #ffffff;
}

.ofrenda-popover-close {
    width: 26px;
    height: 26px;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-size: 0.74rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.ofrenda-popover-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.ofrenda-pearl-box {
    background: rgba(9, 13, 24, 0.72);
    border: 1px solid rgba(251, 146, 60, 0.26);
    border-radius: 0.85rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.6rem;
}

.ofrenda-pearl-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.22rem;
}

.ofrenda-pearl-tag {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fb923c;
}

.ofrenda-pearl-counter {
    font-size: 0.6rem;
    font-weight: 800;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.ofrenda-pearl-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fef3c7;
    margin: 0 0 0.22rem;
    line-height: 1.25;
}

.ofrenda-pearl-body {
    font-size: 0.71rem;
    color: #cbd5e1;
    line-height: 1.42;
    margin: 0;
}

.ofrenda-pearl-source {
    font-size: 0.61rem;
    color: #94a3b8;
    line-height: 1.35;
    margin: 0.35rem 0 0;
    padding-top: 0.3rem;
    border-top: 1px dashed rgba(251, 191, 36, 0.18);
}

.ofrenda-popover-actions {
    display: flex;
}

.ofrenda-btn-primary {
    width: 100%;
    padding: 0.46rem 0.75rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(251, 191, 36, 0.48);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(234, 88, 12, 0.24));
    color: #fef3c7;
    font-size: 0.71rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.23, 1, 0.32, 1);
}

.ofrenda-btn-primary:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(234, 88, 12, 0.34));
    transform: translateY(-1px);
}

/* ==========================================================================
   4. TARJETA DE PÍLDORA CLÍNICA DEL DÍA EN DASHBOARD (INICIO)
   ========================================================================== */

.praxis-daily-pill-card {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.52) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #f59e0b;
    box-shadow:
        0 12px 30px -14px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 0.95rem 1.1rem;
    transition: border-color 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s ease;
}

body.theme-muertos .praxis-daily-pill-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(45, 21, 40, 0.56) 100%);
    border-color: rgba(251, 191, 36, 0.26);
    border-left: 3px solid #fbbf24;
}

.praxis-daily-pill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.42rem;
}

.praxis-daily-pill-badge-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-width: 0;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    padding: 0.18rem 0.58rem;
    border-radius: 9999px;
}

.praxis-daily-pill-icon {
    font-size: 0.78rem;
    line-height: 1;
    flex-shrink: 0;
}

.praxis-daily-pill-kicker {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fde68a;
    line-height: 1.25;
}

.praxis-daily-pill-counter {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.18rem 0.56rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.28);
    color: #a7f3d0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.praxis-daily-pill-next {
    font-size: 0.68rem;
    font-weight: 800;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.32);
    padding: 0.24rem 0.62rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
}

.praxis-daily-pill-next:hover {
    background: rgba(245, 158, 11, 0.26);
    border-color: rgba(251, 191, 36, 0.6);
    transform: translateX(1px);
}

.praxis-daily-pill-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.praxis-daily-pill-body {
    font-size: 0.76rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.48;
}

.praxis-daily-pill-source {
    font-size: 0.65rem;
    color: #94a3b8;
    margin: 0.38rem 0 0;
    padding-top: 0.32rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    line-height: 1.38;
}

/* ==========================================================================
   5. TEMA NAVIDAD · "Edición de Invierno"
   Paleta: pino, arándano, oro viejo y hielo, sobre el índigo de la marca (acentos, no fondo).
   Todo es inerte si body no tiene .theme-navidad.
   ========================================================================== */

body.theme-navidad {
    --xmas-pine: #5cc99a;
    --xmas-berry: #f07a92;
    --xmas-gold: #f2cf7e;
    --xmas-ice: #a9d8f2;
    --xmas-ink: #fdf3d7;
    --xmas-wire: rgba(203, 213, 225, 0.38);
    --xmas-halo: 0.34;
    --xmas-snow: rgba(255, 255, 255, 0.075);
}
html[data-theme="light"] body.theme-navidad {
    --xmas-pine: #23744f;
    --xmas-berry: #b3213f;
    --xmas-gold: #9a6c14;
    --xmas-ice: #3d7fa8;
    --xmas-ink: #1b4532;
    --xmas-wire: rgba(51, 65, 85, 0.42);
    --xmas-halo: 0.2;
    --xmas-snow: rgba(255, 255, 255, 0.96);
}

/* ---------- 5.1 Serie de luces (SVG, flujo natural de scroll) ---------- */
.christmas-lights {
    position: relative;
    width: 100%;
    height: 40px;
    pointer-events: none;
    z-index: 12;
    overflow: hidden;
    overflow: clip;
    contain: paint;
}
@media (min-width: 768px) {
    .christmas-lights { height: 48px; }
}
.christmas-lights svg { display: block; width: 100%; height: 100%; }
.christmas-lights.is-landing-garland { position: absolute; top: 80px; left: 0; right: 0; z-index: 24; }
.christmas-lights.is-auth-garland { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.christmas-lights.is-dashboard-garland { margin: -0.9rem 0 0.5rem; }
@media (min-width: 768px) {
    .christmas-lights.is-dashboard-garland { margin: -2rem 0 0.6rem; }
}
.christmas-lights.is-flashcards-garland { margin: -1rem -1rem 0.5rem; width: calc(100% + 2rem); }

.xmas-wire { fill: none; stroke: var(--xmas-wire, rgba(203, 213, 225, 0.38)); stroke-width: 1.3; }
.xmas-cap { fill: #8d929c; }
.xmas-shine { fill: #fff; opacity: 0.55; }
.xmas-halo { opacity: var(--xmas-halo, 0.34); }
.xmas-bulb.is-gold  { --b: #f5c451; }
.xmas-bulb.is-warm  { --b: #fff0c4; }
.xmas-bulb.is-berry { --b: #e8476c; }
.xmas-bulb.is-pine  { --b: #3fbf7f; }
.xmas-bulb.is-ice   { --b: #9fd8f5; }
.xmas-glass, .xmas-halo { fill: var(--b); }
html[data-theme="light"] .xmas-bulb.is-warm { --b: #f3d47a; }
html[data-theme="light"] .xmas-glass { stroke: rgba(15, 23, 42, 0.18); stroke-width: 0.6; }

/* Parpadeo cálido: solo opacidad (barato), desfasado por foco */
.xmas-glass, .xmas-halo {
    animation: xmasTwinkle 3.6s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * -0.53s);
}
.xmas-bulb:nth-child(3n) .xmas-glass, .xmas-bulb:nth-child(3n) .xmas-halo { animation-duration: 4.4s; }
.xmas-bulb:nth-child(5n) .xmas-glass, .xmas-bulb:nth-child(5n) .xmas-halo { animation-duration: 2.9s; }
@keyframes xmasTwinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.74; }
}
.xmas-halo { animation-name: xmasHalo; }
@keyframes xmasHalo {
    0%, 100% { opacity: var(--xmas-halo, 0.34); }
    50% { opacity: 0.06; }
}

/* ---------- 5.2 Chips (hero, topbar del dashboard, Praxicards) ---------- */
body.theme-navidad .seasonal-hero-badge:not(.hidden),
body.theme-navidad #seasonal-edition:not(.hidden),
body.theme-navidad .seasonal-inline-header-chip:not(.hidden) {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--xmas-ink);
    background:
        linear-gradient(180deg, rgba(22, 46, 38, 0.82), rgba(12, 26, 24, 0.82)) padding-box,
        linear-gradient(120deg, rgba(242, 207, 126, 0.75), rgba(242, 207, 126, 0.16) 50%, rgba(240, 122, 146, 0.5)) border-box;
    border: 1px solid transparent;
    box-shadow: 0 6px 18px -8px rgba(47, 138, 95, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.22s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.22s ease;
}
html[data-theme="light"] body.theme-navidad .seasonal-hero-badge:not(.hidden),
html[data-theme="light"] body.theme-navidad #seasonal-edition:not(.hidden),
html[data-theme="light"] body.theme-navidad .seasonal-inline-header-chip:not(.hidden) {
    background:
        linear-gradient(135deg, #f0f8f3, #fdf1f3) padding-box,
        linear-gradient(120deg, rgba(154, 108, 20, 0.6), rgba(154, 108, 20, 0.15) 45%, rgba(179, 33, 63, 0.45)) border-box;
    box-shadow: 0 6px 16px -10px rgba(35, 116, 79, 0.5);
}
body.theme-navidad .seasonal-hero-badge:not(.hidden)::before,
body.theme-navidad #seasonal-edition:not(.hidden)::before,
body.theme-navidad .seasonal-inline-header-chip:not(.hidden)::before {
    content: "";
    width: 0.95em;
    height: 0.95em;
    flex: none;
    background: var(--xmas-gold);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M20.7 7 3.3 17M9.5 3.5 12 6l2.5-2.5M9.5 20.5 12 18l2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M20.7 7 3.3 17M9.5 3.5 12 6l2.5-2.5M9.5 20.5 12 18l2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (hover: hover) {
    body.theme-navidad .seasonal-hero-badge:not(.hidden):hover,
    body.theme-navidad #seasonal-edition:not(.hidden):hover,
    body.theme-navidad .seasonal-inline-header-chip:not(.hidden):hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px -10px rgba(47, 138, 95, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}
body.theme-navidad .seasonal-hero-badge:focus-visible,
body.theme-navidad #seasonal-edition:focus-visible,
body.theme-navidad .seasonal-inline-header-chip:focus-visible {
    outline: 2px solid var(--xmas-gold);
    outline-offset: 2px;
}

/* Ramitas de pino con arándanos a los lados del chip del hero */
body.theme-navidad .seasonal-hero-wrap { align-items: center; gap: 0.5rem; }
body.theme-navidad .seasonal-hero-wrap::before,
body.theme-navidad .seasonal-hero-wrap::after {
    content: "";
    width: 40px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cg fill='none' stroke='%232f8a5f' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M38 10 C28 9 17 9.5 3 11'/%3E%3Cpath d='M33 9.6 l-3.5 -5 M27 9.4 l-3.6 -5.2 M21 9.6 l-3.8 -5 M15 10 l-3.8 -4.6 M9 10.5 l-3.6 -4'/%3E%3Cpath d='M33 9.8 l-3 4.6 M27 9.7 l-3.2 4.9 M21 9.9 l-3.4 4.7 M15 10.3 l-3.4 4.3 M9 10.8 l-3.2 3.8'/%3E%3C/g%3E%3Ccircle cx='35.5' cy='13.4' r='2.4' fill='%23c0264b'/%3E%3Ccircle cx='31.6' cy='15.2' r='2.1' fill='%23d93b60'/%3E%3Ccircle cx='34.6' cy='13' r='.7' fill='%23fff' fill-opacity='.7'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.theme-navidad .seasonal-hero-wrap::before { transform: scaleX(-1); }
html:not([data-theme="light"]) body.theme-navidad .seasonal-hero-wrap::before,
html:not([data-theme="light"]) body.theme-navidad .seasonal-hero-wrap::after { filter: brightness(1.45) saturate(0.9); }

/* ---------- 5.3 Landing: aurora, tarjetas con nieve, divisores, CTA y pie ---------- */
body.theme-navidad .hero-landing-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(60% 45% at 12% 8%, rgba(47, 138, 95, 0.16), transparent 70%),
        radial-gradient(50% 40% at 90% 12%, rgba(192, 38, 75, 0.12), transparent 70%),
        radial-gradient(70% 45% at 50% 105%, rgba(242, 207, 126, 0.09), transparent 70%);
}
html[data-theme="light"] body.theme-navidad .hero-landing-section::before {
    background:
        radial-gradient(60% 45% at 12% 8%, rgba(35, 116, 79, 0.09), transparent 70%),
        radial-gradient(50% 40% at 90% 12%, rgba(179, 33, 63, 0.07), transparent 70%),
        radial-gradient(70% 45% at 50% 105%, rgba(154, 108, 20, 0.07), transparent 70%);
}

/* Copete de nieve sobre las tarjetas flotantes del hero */
body.theme-navidad .hero-pill-card { position: relative; }
body.theme-navidad .hero-pill-card::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    top: -5px;
    height: 9px;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.92);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M0 10 V4 C10 1 22 0 34 3 C44 6 52 2 64 2.5 C78 3 84 7 98 5 C112 3 120 0 136 1.5 C150 3 156 7 170 5.5 C182 4 192 1 200 3 V10 Z' fill='%23000'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M0 10 V4 C10 1 22 0 34 3 C44 6 52 2 64 2.5 C78 3 84 7 98 5 C112 3 120 0 136 1.5 C150 3 156 7 170 5.5 C182 4 192 1 200 3 V10 Z' fill='%23000'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18));
}
html[data-theme="light"] body.theme-navidad .hero-pill-card::after {
    background: #ffffff;
    filter: drop-shadow(0 1px 1.5px rgba(30, 64, 110, 0.28));
}

/* Divisor ornamental entre secciones (estrella dorada + bayas) */
body.theme-navidad.v7-public section + section:not(.overflow-hidden)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: min(280px, 64vw);
    height: 18px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 18'%3E%3Cdefs%3E%3ClinearGradient id='l' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23c9a24a' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23c9a24a' stop-opacity='.75'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='1' x2='0'%3E%3Cstop offset='0' stop-color='%23c9a24a' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23c9a24a' stop-opacity='.75'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 9 H118' stroke='url(%23l)' stroke-width='1'/%3E%3Cpath d='M162 9 H280' stroke='url(%23r)' stroke-width='1'/%3E%3Ccircle cx='126' cy='9' r='1.6' fill='%232f8a5f'/%3E%3Ccircle cx='154' cy='9' r='1.6' fill='%23c0264b'/%3E%3Cpath d='M140 1.5 L142 7 L147.5 9 L142 11 L140 16.5 L138 11 L132.5 9 L138 7 Z' fill='%23d9b45a'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* CTA principal del hero: aro dorado sutil */
body.theme-navidad .hero-landing-section a[href="planes.html"] {
    box-shadow: 0 0 0 1px rgba(242, 207, 126, 0.45), 0 14px 34px -14px rgba(192, 38, 75, 0.55);
}

/* Banco de nieve sobre el pie de página */
body.theme-navidad.v7-public footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -26px;
    height: 27px;
    pointer-events: none;
    background: var(--xmas-snow);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28 V16 C80 6 150 4 240 12 C330 20 400 22 500 13 C600 4 680 2 780 11 C880 20 960 21 1060 12 C1160 3 1250 4 1340 13 C1390 17 1420 16 1440 14 V28 Z' fill='%23000'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28 V16 C80 6 150 4 240 12 C330 20 400 22 500 13 C600 4 680 2 780 11 C880 20 960 21 1060 12 C1160 3 1250 4 1340 13 C1390 17 1420 16 1440 14 V28 Z' fill='%23000'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- 5.4 Login / registro ---------- */
body.theme-navidad.v7-public > div > .glass-card { position: relative; }
body.theme-navidad.v7-public > div > .glass-card::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: -1px;
    height: 2px;
    border-radius: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--xmas-pine) 22%, var(--xmas-gold) 50%, var(--xmas-berry) 78%, transparent);
    opacity: 0.85;
}

/* ---------- 5.5 Dashboard: píldora del día y popover ---------- */
body.theme-navidad .praxis-daily-pill-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(16, 48, 38, 0.55) 100%);
    border-color: rgba(92, 201, 154, 0.24);
    border-left: 3px solid var(--xmas-gold);
}

body.theme-navidad .ofrenda-popover-card {
    background: linear-gradient(165deg, rgba(13, 22, 34, 0.97) 0%, rgba(14, 38, 32, 0.97) 100%);
    border-color: rgba(242, 207, 126, 0.38);
    box-shadow: 0 22px 50px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(92, 201, 154, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
body.theme-navidad .ofrenda-popover-emblem {
    background: radial-gradient(circle at 50% 35%, rgba(169, 216, 242, 0.2), rgba(13, 22, 34, 0.9));
    border-color: rgba(169, 216, 242, 0.35);
}
body.theme-navidad .xmas-emblem-svg g { stroke: #dff1fb; }
body.theme-navidad .xmas-emblem-svg circle { fill: #f2cf7e; }
body.theme-navidad .ofrenda-popover-kicker { color: #f2cf7e; }
body.theme-navidad .ofrenda-pearl-box { border-color: rgba(92, 201, 154, 0.26); }
body.theme-navidad .ofrenda-pearl-tag { color: #6ee7b7; }
body.theme-navidad .ofrenda-pearl-title { color: #fdf3d7; }
body.theme-navidad .ofrenda-pearl-source { border-top-color: rgba(242, 207, 126, 0.2); }
body.theme-navidad .ofrenda-btn-primary {
    border-color: rgba(242, 207, 126, 0.5);
    background: linear-gradient(135deg, rgba(47, 138, 95, 0.36), rgba(192, 38, 75, 0.26));
    color: #fdf3d7;
}
body.theme-navidad .ofrenda-btn-primary:hover {
    background: linear-gradient(135deg, rgba(47, 138, 95, 0.5), rgba(192, 38, 75, 0.38));
}
html[data-theme="light"] body.theme-navidad .ofrenda-popover-card {
    background: linear-gradient(165deg, #ffffff 0%, #f3f9f5 100%);
    border-color: rgba(154, 108, 20, 0.35);
    color: #0f172a;
    box-shadow: 0 22px 44px -20px rgba(15, 23, 42, 0.35);
}
html[data-theme="light"] body.theme-navidad .ofrenda-popover-title { color: #0f172a; }
html[data-theme="light"] body.theme-navidad .ofrenda-popover-kicker { color: #8a5f10; }
html[data-theme="light"] body.theme-navidad .ofrenda-popover-emblem { background: radial-gradient(circle at 50% 35%, #eef7fc, #dcebf5); border-color: rgba(61, 127, 168, 0.35); }
html[data-theme="light"] body.theme-navidad .xmas-emblem-svg g { stroke: #2c6f97; }
html[data-theme="light"] body.theme-navidad .xmas-emblem-svg circle { fill: #b3213f; }
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-box { background: #ffffff; border-color: rgba(35, 116, 79, 0.22); }
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-tag { color: #23744f; }
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-title { color: #0f172a; }
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-body { color: #334155; }
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-counter,
html[data-theme="light"] body.theme-navidad .ofrenda-pearl-source { color: #64748b; }
html[data-theme="light"] body.theme-navidad .ofrenda-btn-ghost,
html[data-theme="light"] body.theme-navidad .ofrenda-popover-close { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
html[data-theme="light"] body.theme-navidad .ofrenda-btn-primary {
    background: linear-gradient(135deg, #23744f, #1b5e40);
    border-color: rgba(154, 108, 20, 0.5);
    color: #ffffff;
}

body.theme-muertos .praxis-sidebar,
body.theme-muertos .praxis-topbar {
    border-color: rgba(245, 158, 11, 0.22) !important;
}

body.theme-navidad .praxis-sidebar,
body.theme-navidad .praxis-topbar {
    border-color: rgba(16, 185, 129, 0.22) !important;
}

@media (prefers-reduced-motion: reduce) {
    .xmas-glass,
    .xmas-halo,
    .muertos-garland .pp-flag,
    .muertos-ecg-trace {
        animation: none !important;
    }
}

/* 7.0: partículas a pantalla completa como fondo decorativo, detrás de tarjetas y sin bloquear toques. */
html.v7 .seasonal-3d-canvas,
html.v7 #seasonal-atmosphere{
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 0 !important;
    pointer-events: none !important;
    clip-path: none;
    -webkit-mask-image: none;
            mask-image: none;
    opacity: .75 !important;
}
/* La nieve ya regula opacidad por plano; no aplicar el 0.75 del cempasúchil. */
html.v7 .xmas-snow-canvas{
    opacity: 1 !important;
}
html.v7 .praxis-main{ position: relative; z-index: 1; }
html.v7[data-calm="1"] .seasonal-3d-canvas,
html.v7[data-calm="1"] #seasonal-atmosphere{ display: none !important; }
html[data-calm="1"] .papel-picado, html[data-calm="1"] [class*="garland"] *{ animation: none !important; }
@media (prefers-reduced-motion: reduce){
    html.v7 .seasonal-3d-canvas, html.v7 #seasonal-atmosphere{ display: none; }
    .papel-picado, [class*="garland"] *{ animation: none !important; }
}

/* Guard global: ningún efecto estacional puede ensanchar el layout (iOS hace pan horizontal) */
html:has(body.theme-muertos), html:has(body.theme-navidad), body.theme-muertos, body.theme-navidad { overflow-x: clip; }

/* Nieve con CSS (Navidad): copos animados solo con transform, colores por tema. */
.xmas-snow-field{position:absolute;inset:0;overflow:hidden;pointer-events:none;contain:strict;display:none;
    --sn-core:rgba(255,255,255,1);--sn-halo:rgba(220,232,250,.32);--sn-edge:transparent;--sn-shadow:transparent}
.xmas-snow-field.is-on{display:block}
html[data-theme="light"] .xmas-snow-field{--sn-core:#9cc3e6;--sn-halo:rgba(156,195,230,.40);--sn-edge:rgba(110,155,195,.85);--sn-shadow:rgba(90,140,185,.38)}
/* Columna de alto completo: translateY en % se compone en GPU (sin var() ni vh en keyframes). */
.xmas-snow-field .sf{position:absolute;top:0;height:100%;width:var(--sz);will-change:transform;
    animation:xmasFall var(--d) linear var(--dl) infinite}
.xmas-snow-field .sf i{display:block;width:100%;aspect-ratio:1;border-radius:50%;background:var(--sn-core);
    box-shadow:0 0 0 .6px var(--sn-edge),.8px 1.1px 0 .4px var(--sn-shadow);
    animation:xmasSway0 var(--sd) ease-in-out var(--dl) infinite alternate}
.xmas-snow-field .sf.l1 i{animation-name:xmasSway1}
.xmas-snow-field .sf.l2 i{animation-name:xmasSway2}
.xmas-snow-field .sf.l0,.xmas-snow-field .sf.l1:not(.is-crystal){width:calc(var(--sz)*2.3)}
.xmas-snow-field .sf.l0 i,.xmas-snow-field .sf.l1:not(.is-crystal) i{box-shadow:none;
    background:radial-gradient(circle,var(--sn-core) 0 30%,var(--sn-halo) 46%,transparent 70%)}
.xmas-snow-field .sf.is-crystal i{border-radius:0;box-shadow:none;background:var(--sn-core);
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 1v22M2.5 6.5l19 11M2.5 17.5l19-11M12 4.5l-2.2-2M12 4.5l2.2-2M12 19.5l-2.2 2M12 19.5l2.2 2M5.4 8.2l-.8-3M5.4 8.2l-3 .8M18.6 15.8l.8 3M18.6 15.8l3-.8M5.4 15.8l-3-.8M5.4 15.8l-.8 3M18.6 8.2l3 .8M18.6 8.2l.8-3'/%3E%3C/svg%3E") center/contain no-repeat;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M12 1v22M2.5 6.5l19 11M2.5 17.5l19-11M12 4.5l-2.2-2M12 4.5l2.2-2M12 19.5l-2.2 2M12 19.5l2.2 2M5.4 8.2l-.8-3M5.4 8.2l-3 .8M18.6 15.8l.8 3M18.6 15.8l3-.8M5.4 15.8l-3-.8M5.4 15.8l-.8 3M18.6 8.2l3 .8M18.6 8.2l.8-3'/%3E%3C/svg%3E") center/contain no-repeat;
    animation-name:xmasSwaySpin}
html[data-theme="light"] .xmas-snow-field .sf.is-crystal i{background:#7fadd6}
.xmas-snow-field.is-paused .sf,.xmas-snow-field.is-paused .sf i{animation-play-state:paused}
@keyframes xmasFall{from{transform:translate3d(0,-8%,0)}to{transform:translate3d(0,106%,0)}}
@keyframes xmasSway0{from{transform:translate3d(-8px,0,0)}to{transform:translate3d(8px,0,0)}}
@keyframes xmasSway1{from{transform:translate3d(-15px,0,0)}to{transform:translate3d(15px,0,0)}}
@keyframes xmasSway2{from{transform:translate3d(-22px,0,0)}to{transform:translate3d(22px,0,0)}}
@keyframes xmasSwaySpin{from{transform:translate3d(-18px,0,0) rotate(-40deg)}to{transform:translate3d(18px,0,0) rotate(40deg)}}
.xmas-spark-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
@media (prefers-reduced-motion:reduce){.xmas-snow-field{display:none!important}}
html[data-calm="1"] .xmas-snow-field{display:none!important}
