/* =========================================================================
   PolTraders · Tema de Navidad
   Solo se carga cuando pt_xmas_on() lo activa (partials/xmas.php).
   Identidad negro + oro intacta; añade rojo vino, verde pino y nieve.
   Las piezas (gorros, nieve acumulada, acebo, lazos...) las crea pt-xmas.js.
   ========================================================================= */
body.pt-xmas {
    --x-red: #c8303b;
    --x-red-hi: #f0505b;
    --x-pine: #2f7a4f;
    --x-snow: #fffaf0;
}

/* ---------- Ambiente ---------- */
body.pt-xmas .pt-aurora i:nth-child(1) { background: radial-gradient(closest-side, rgba(232, 177, 42, .32), transparent); }
body.pt-xmas .pt-aurora i:nth-child(2) { background: radial-gradient(closest-side, rgba(200, 48, 59, .26), transparent); }
body.pt-xmas .pt-aurora i:nth-child(3) { background: radial-gradient(closest-side, rgba(47, 122, 79, .22), transparent); }
body.pt-xmas ::selection { background: rgba(200, 48, 59, .5); color: #fff; }
body.pt-xmas .pt-halo { background: radial-gradient(closest-side, rgba(255, 220, 160, .1), transparent); }

/* Barra de scroll de bastón de caramelo */
html:has(body.pt-xmas) { scrollbar-color: #c8303b #0b0a08; }
html:has(body.pt-xmas)::-webkit-scrollbar { width: 11px; }
html:has(body.pt-xmas)::-webkit-scrollbar-track { background: #0b0a08; }
html:has(body.pt-xmas)::-webkit-scrollbar-thumb {
    border-radius: 10px; border: 2px solid #0b0a08;
    background: repeating-linear-gradient(45deg, #c8303b 0 7px, #fffaf0 7px 14px);
}

/* Barra de progreso de lectura: rojo + oro + verde */
body.pt-xmas .pt-progress { background: linear-gradient(90deg, #c8303b, #e8b12a 50%, #2f7a4f) !important; }

/* ---------- Nieve ---------- */
.pt-snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }

/* ---------- Estela del cursor ---------- */
.x-trail {
    position: fixed; z-index: 95; pointer-events: none; width: var(--sz, 8px); height: var(--sz, 8px);
    margin: -4px 0 0 -4px; background: #f6cf62;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 4px rgba(246, 207, 98, .9));
    animation: x-trail .9s ease-out forwards;
}
@keyframes x-trail {
    0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
    100% { opacity: 0; transform: translate(var(--dx), 26px) scale(.2) rotate(90deg); }
}

/* ---------- Guirnalda de pino bajo el menú ---------- */
.pt-garland {
    position: absolute; left: 14px; right: 14px; top: 100%; height: 40px; margin-top: -6px;
    pointer-events: none; overflow: visible; z-index: 2;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45));
}
.pt-garland > svg { display: block; overflow: visible; }
.xg-bulb { animation: x-twinkle 3s ease-in-out infinite; }
.xg-bulb--gold  { fill: #ffd66b; filter: drop-shadow(0 0 5px rgba(255, 214, 107, .95)); }
.xg-bulb--red   { fill: #ff4a57; filter: drop-shadow(0 0 5px rgba(255, 74, 87, .95)); }
.xg-bulb--green { fill: #4fd38a; filter: drop-shadow(0 0 5px rgba(79, 211, 138, .9)); }
.xg-ball { transform-box: fill-box; transform-origin: 50% 0; animation: x-sway 4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes x-twinkle { 0%, 100% { opacity: 1; } 45% { opacity: .3; } 55% { opacity: .35; } }
@keyframes x-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@media (max-width: 760px) { .pt-garland { left: 8px; right: 8px; } }

/* ---------- Gorro de Papá Noel ---------- */
.x-hat-host { position: relative; }
.logo a.x-hat-host, a.pt-footer__logo.x-hat-host { display: inline-flex; width: fit-content; }
.pt-hat {
    position: absolute; pointer-events: none; z-index: 2;
    /* La vela roja más alta del logo está al ~58-63 % del ancho, arriba del todo */
    left: 52.5%; top: -17%; width: 16.5%;
    transform: rotate(14deg); transform-origin: 30% 90%;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .55));
    transition: transform .6s var(--ease-spring, ease);
}
.x-hat-host:hover > .pt-hat { transform: rotate(2deg) translateY(-3px); }
.pt-hat--orbit { left: 50%; top: 2%; width: 30%; }
.pt-hat--wa { left: -16%; top: -46%; width: 74%; transform: rotate(-22deg); z-index: 3; }
.whatsapp-float-btn.x-hat-host { overflow: visible !important; }

/* ---------- Nieve acumulada ---------- */
.x-cap {
    position: absolute; top: -8px; height: 15px; z-index: 3; pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)) drop-shadow(0 0 6px rgba(255, 250, 240, .18));
}
.x-cap svg { display: block; width: 100%; height: 100%; }
.x-cap--in { top: -3px; }
.x-cap--btn { top: -6px; height: 10px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.x-cap--btn.x-cap--in { top: -2px; height: 8px; }

/* ---------- Acebo en esquinas ---------- */
.x-holly {
    position: absolute; width: 46px; height: auto; z-index: 4; pointer-events: none;
    top: -16px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
}
.x-holly--r { right: 14px; transform: rotate(14deg); }
.x-holly--l { left: 14px; transform: rotate(-14deg) scaleX(-1); }
.x-holly--in { top: 2px; width: 40px; }
.x-holly--pill { position: static; width: 22px; margin: -4px 0 -4px -2px; transform: none; filter: drop-shadow(0 0 6px rgba(200, 48, 59, .55)); }
body.pt-xmas .pt-pill .pt-live { display: none; }

/* ---------- Etiquetas y títulos ---------- */
.x-flake { width: 13px; height: 13px; flex: none; color: #fffaf0; opacity: .9; animation: x-spin 12s linear infinite; }
@keyframes x-spin { to { transform: rotate(360deg); } }

.x-divider { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 0; max-width: 260px; }
.x-divider i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 177, 42, .55)); }
.x-divider i:last-child { background: linear-gradient(90deg, rgba(232, 177, 42, .55), transparent); }
.x-divider span { width: 14px; display: block; transform-origin: 50% 0; animation: x-sway 4.5s ease-in-out infinite; }
.x-divider span.big { width: 19px; animation-delay: -1.5s; }
.x-divider span:last-of-type { animation-delay: -3s; }
.x-divider svg { display: block; width: 100%; height: auto; }
.plan-section-title + .x-divider { margin-bottom: 18px; }

.x-sparkle-host { position: relative; }
.x-star {
    position: absolute; width: 12px; height: 12px; pointer-events: none;
    background: #fff4cf;
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    filter: drop-shadow(0 0 6px rgba(255, 220, 140, 1));
    animation: x-star 2.6s ease-in-out infinite; opacity: 0;
}
@keyframes x-star {
    0%, 100% { opacity: 0; transform: scale(.3) rotate(0); }
    50% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* ---------- Bolas colgando a los lados del hero ---------- */
.x-hang { position: absolute; top: 0; z-index: 1; display: none; gap: 22px; pointer-events: none; }
.x-hang--l { left: max(14px, 1.6vw); }
.x-hang--r { right: max(14px, 1.6vw); }
@media (min-width: 1440px) { .x-hang { display: flex; } }
.x-hang__b {
    position: relative; display: block; width: calc(38px * var(--s, 1));
    padding-top: var(--len, 80px); transform-origin: 50% 0;
    animation: x-sway 5s ease-in-out infinite;
}
.x-hang__b::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: calc(var(--len, 80px) + 4px);
    background: linear-gradient(180deg, transparent, rgba(232, 177, 42, .7));
}
.x-hang__b svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }

/* ---------- Botones dorados ---------- */
body.pt-xmas .pt-btn--gold { transition: box-shadow .4s, transform .35s var(--ease, ease); }
body.pt-xmas .pt-btn--gold:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 0 1px rgba(246, 207, 98, .6), 0 18px 46px -12px rgba(232, 177, 42, .85), 0 0 0 4px rgba(200, 48, 59, .28); }
/* Ojo: los botones dorados NO pueden tener overflow visible: su brillo (::after) espera fuera,
   a la izquierda, y se vería como un rectángulo gris suelto. La nieve va por dentro (x-cap--in). */

/* Tarjetas: halo rojo suave al pasar el ratón */
body.pt-xmas .feature-card:hover, body.pt-xmas .value-card:hover, body.pt-xmas .plan-card:hover,
body.pt-xmas .ptb-card:hover, body.pt-xmas .pf-step:hover, body.pt-xmas .panel:hover {
    box-shadow: 0 0 0 1px rgba(200, 48, 59, .35), 0 30px 60px -30px rgba(200, 48, 59, .35);
}

/* ---------- Pie: felicitación ---------- */
.x-greet { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 0 22px; text-align: center; }
.x-greet p { margin: 0; font-size: 15px; color: var(--text-2, #b7afa0); letter-spacing: .01em; white-space: nowrap; }
.x-greet em {
    font-family: var(--f-serif, 'Instrument Serif', serif); font-style: italic; font-size: 1.35em;
    background: linear-gradient(100deg, #f9dc85, #e8b12a 40%, #fff0c2 55%, #e8b12a 70%, #b98219);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.x-greet__lights { display: flex; gap: 9px; }
.x-greet__lights i { width: 6px; height: 9px; border-radius: 50% 50% 45% 45%; animation: x-twinkle 2.4s ease-in-out infinite; }
.x-greet__lights i:nth-child(3n+1) { background: #ffd66b; box-shadow: 0 0 8px #ffd66b; }
.x-greet__lights i:nth-child(3n+2) { background: #ff4a57; box-shadow: 0 0 8px #ff4a57; animation-delay: -.8s; }
.x-greet__lights i:nth-child(3n)   { background: #4fd38a; box-shadow: 0 0 8px #4fd38a; animation-delay: -1.6s; }
html:not([lang="en"]) .x-en, html[lang="en"] .x-es { display: none; }
@media (max-width: 760px) {
    .x-greet { gap: 10px; } .x-greet p { font-size: 13px; white-space: normal; }
    .x-greet__lights i:nth-child(n+5) { display: none; }
}

/* ---------- Pantalla de carga (portada) ---------- */
.show-intro .pt-intro--xmas {
    background:
        radial-gradient(520px 380px at 50% 46%, rgba(232, 177, 42, .16), transparent 70%),
        radial-gradient(420px 420px at 22% 70%, rgba(200, 48, 59, .16), transparent 70%),
        radial-gradient(420px 420px at 80% 28%, rgba(47, 122, 79, .16), transparent 70%),
        #0b0a08;
    overflow: hidden;
}
.xi-glow {
    position: absolute; left: 50%; top: 46%; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 214, 107, .22), transparent);
    animation: xi-pulse 1.6s ease-in-out infinite alternate;
}
@keyframes xi-pulse { from { transform: scale(.85); opacity: .6; } to { transform: scale(1.1); opacity: 1; } }

/* Nieve en CSS puro: se ve desde el primer instante, sin esperar al JS */
.xi-snow {
    position: absolute; inset: -240px 0 0; pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(1.5px 1.5px at 90px 120px, #fff8e8, transparent),
        radial-gradient(2px 2px at 160px 60px, #fff, transparent), radial-gradient(1.5px 1.5px at 60px 180px, #f6cf62, transparent),
        radial-gradient(2.5px 2.5px at 200px 200px, #fff, transparent), radial-gradient(1.5px 1.5px at 130px 10px, #fff, transparent),
        radial-gradient(2px 2px at 250px 140px, #fff, transparent), radial-gradient(1.5px 1.5px at 310px 260px, #fff8e8, transparent),
        radial-gradient(3px 3px at 40px 280px, #fff, transparent), radial-gradient(1.5px 1.5px at 280px 30px, #f6cf62, transparent),
        radial-gradient(2px 2px at 170px 310px, #fff, transparent), radial-gradient(1.5px 1.5px at 110px 230px, #fff, transparent);
    background-size: 330px 330px;
    animation: xi-snow 2.4s linear infinite; opacity: .85;
}
.xi-snow--2 { background-size: 470px 470px; filter: blur(.6px); opacity: .55; animation-duration: 3.6s; transform: scale(1.6); }
@keyframes xi-snow { to { background-position: 30px 330px; } }
.xi-snow--2 { animation-name: xi-snow2; }
@keyframes xi-snow2 { to { background-position: -40px 470px; } }

.pt-intro--xmas .pt-intro__inner { position: relative; z-index: 1; gap: 20px; }
.xi-logo { position: relative; }
/* Arco de luces alrededor del logo: se encienden una a una y luego parpadean */
.xi-lights { position: absolute; left: 50%; top: 58%; width: 0; height: 0; transform: scaleX(1.32); }
.xi-lights i {
    position: absolute; left: -3.5px; top: -5px; width: 7px; height: 10px; border-radius: 50% 50% 45% 45%;
    transform: rotate(calc(-84deg + var(--k) * 12deg)) translateY(-112px) scale(0);
    animation: xi-on .35s var(--ease-spring, ease) forwards, x-twinkle 1.4s ease-in-out infinite;
    animation-delay: calc(.08s + var(--k) * .05s), calc(.9s + var(--k) * .11s);
}
.xi-lights i:nth-child(3n+1) { background: #ffd66b; box-shadow: 0 0 10px 2px rgba(255, 214, 107, .9); }
.xi-lights i:nth-child(3n+2) { background: #ff4a57; box-shadow: 0 0 10px 2px rgba(255, 74, 87, .9); }
.xi-lights i:nth-child(3n)   { background: #4fd38a; box-shadow: 0 0 10px 2px rgba(79, 211, 138, .85); }
@keyframes xi-on { to { transform: rotate(calc(-84deg + var(--k) * 12deg)) translateY(-112px) scale(1); } }

/* Gorro: cae sobre la vela roja cuando el logo ya se ha dibujado */
.xi-hat {
    position: absolute; left: 52.5%; top: -17%; width: 16.5%; transform-origin: 30% 90%;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6));
    opacity: 0; transform: translateY(-60px) rotate(-30deg);
    animation: xi-hat .6s var(--ease-spring, ease) 1.05s forwards;
}
@keyframes xi-hat { to { opacity: 1; transform: translateY(0) rotate(14deg); } }

/* Línea de carga de bastón de caramelo */
.pt-intro--xmas .pt-intro__line { height: 4px; border-radius: 4px; }
.pt-intro--xmas .pt-intro__line span {
    background: repeating-linear-gradient(-45deg, #c8303b 0 6px, #fffaf0 6px 12px);
    box-shadow: 0 0 12px rgba(200, 48, 59, .7);
}
.xi-greet {
    margin: 0; font-size: 20px; color: #f4efe4; letter-spacing: .02em;
    opacity: 0; transform: translateY(8px); animation: xi-greet .6s var(--ease, ease) .85s forwards;
}
.xi-greet em {
    font-family: var(--f-serif, 'Instrument Serif', serif); font-style: italic; font-size: 1.5em;
    background: linear-gradient(100deg, #f9dc85, #e8b12a 40%, #fff0c2 55%, #e8b12a 70%, #b98219);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes xi-greet { to { opacity: 1; transform: none; } }

/* ---------- Dashboard y admin ---------- */
body.pt-xmas--dash .panel h3::before {
    width: 10px; height: 10px; border-radius: 50%; transform: none;
    background: radial-gradient(circle at 35% 35%, #ff8a8f, #c8303b 55%, #5e0b12);
    box-shadow: 0 0 0 3px rgba(200, 48, 59, .15), 0 0 12px rgba(255, 74, 87, .7);
}

@media (prefers-reduced-motion: reduce) {
    .xg-bulb, .xg-ball, .x-flake, .x-divider span, .x-star, .x-hang__b, .x-greet__lights i { animation: none !important; }
    .x-star { opacity: .8; transform: none; }
    .pt-snow, .x-trail { display: none; }
}
