/* Capa de temporada. No redefine la paleta, la tipografía ni los fondos originales. */
body.coacsa-christmas {
  --christmas-gold: #c5a469;
  --christmas-snow: #d9e4ed;
  isolation: isolate;
}

.coacsa-christmas .christmas-atmosphere,
.coacsa-christmas .christmas-snow,
.coacsa-christmas .christmas-garland,
.coacsa-christmas .christmas-corner,
.coacsa-christmas .christmas-sparkle {
  pointer-events: none;
  user-select: none;
}

.coacsa-christmas .christmas-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 0 15%, #c5a4690d, transparent 32%),
    radial-gradient(ellipse at 100% 80%, #29255907, transparent 30%);
}

.coacsa-christmas .christmas-corner {
  position: absolute;
  top: 90px;
  left: -38px;
  width: clamp(110px, 15vw, 215px);
  aspect-ratio: 1;
  background: url('../img/christmas-sprig.svg') center / contain no-repeat;
  opacity: .2;
  filter: drop-shadow(0 5px 6px #193f3c12);
}

.coacsa-christmas .christmas-corner--right {
  top: auto;
  left: auto;
  bottom: -30px;
  right: -35px;
  transform: rotate(180deg);
  opacity: .15;
}

/* El contexto local aisla la nieve dentro de la seccion (isolation),
   pero se pinta por encima del fondo propio de la seccion para que se
   note; JS excluye superficies con dialogos o elementos fijos. */
.coacsa-christmas .christmas-surface {
  position: relative;
  isolation: isolate;
}

.coacsa-christmas .christmas-snow {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  contain: strict;
}

.coacsa-christmas .christmas-atmosphere > .christmas-snow {
  --christmas-fall-distance: calc(100vh + 30px);
}

.coacsa-christmas .christmas-flake {
  position: absolute;
  top: -18px;
  left: var(--flake-x);
  width: var(--flake-size);
  height: var(--flake-size);
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cad9e6a6;
  box-shadow: 0 0 3px #d9e4ed55;
  opacity: var(--flake-opacity);
  animation: christmas-fall var(--flake-duration) var(--flake-delay) linear infinite;
}

.coacsa-christmas .christmas-flake:nth-child(5n) {
  border-radius: 1px;
  background: var(--christmas-snow);
  clip-path: polygon(42% 0,58% 0,58% 30%,80% 9%,91% 20%,70% 42%,100% 42%,100% 58%,70% 58%,91% 80%,80% 91%,58% 70%,58% 100%,42% 100%,42% 70%,20% 91%,9% 80%,30% 58%,0 58%,0 42%,30% 42%,9% 20%,20% 9%,42% 30%);
}

@keyframes christmas-fall {
  0% { transform: translate3d(0, -12px, 0) rotate(0deg); }
  45% { transform: translate3d(var(--flake-drift), calc(var(--christmas-fall-distance, 100vh) * .45), 0) rotate(80deg); }
  100% { transform: translate3d(0, var(--christmas-fall-distance, 100vh), 0) rotate(160deg); }
}

/* Guirnalda en los primeros 15 px: no invade el logotipo ni la navegación. */
.coacsa-christmas .christmas-garland {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  z-index: 1;
  overflow: hidden;
  background: url('../img/christmas-garland.svg') center top / 240px 23px repeat-x;
}

.coacsa-christmas .christmas-light {
  position: absolute;
  top: 7px;
  left: var(--light-x);
  width: 4px;
  height: 6px;
  border-radius: 45%;
  background: #fff0bd;
  box-shadow: 0 0 5px 2px #f3d39460, 0 0 12px 4px #f3d39420;
  animation: christmas-glow 4.8s var(--light-delay) ease-in-out infinite alternate;
}

@keyframes christmas-glow {
  from { opacity: .5; }
  to { opacity: 1; }
}

.coacsa-christmas .christmas-surface > .christmas-corner {
  top: 10px;
  left: auto;
  right: 0;
  width: clamp(105px, 12vw, 170px);
  transform: rotate(90deg);
  z-index: 1;
  opacity: .38;
}

.coacsa-christmas .christmas-sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--christmas-gold);
  clip-path: polygon(50% 0,61% 38%,100% 50%,61% 61%,50% 100%,38% 61%,0 50%,38% 38%);
  animation: christmas-glow 3.8s -1.4s ease-in-out infinite alternate;
  opacity: .6;
}

.coacsa-christmas .christmas-sparkle--one { top: 29%; left: 2%; }
.coacsa-christmas .christmas-sparkle--two { top: 67%; right: 2%; width: 9px; height: 9px; }

/* Detalles limitados a tarjetas públicas; el contenido siempre es visible. */
.coacsa-christmas .christmas-card {
  box-shadow: 0 -2px 0 -1px #fffffff0, 0 7px 24px #2925590a;
}

.coacsa-christmas .christmas-card-arrive {
  animation: christmas-arrive .6s ease-out both;
}

@keyframes christmas-arrive {
  from { opacity: .65; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .coacsa-christmas .christmas-card {
    transition: box-shadow .3s ease;
  }
  .coacsa-christmas .christmas-card:hover {
    box-shadow: 0 -2px 0 -1px #fff, 0 10px 30px #c5a46924;
  }
  .coacsa-christmas .christmas-cta:hover {
    box-shadow: 0 0 0 3px #c5a46926, 0 6px 20px #c5a46930;
  }
}

/* Izquierda: deja libres los accesos flotantes existentes a la derecha. */
.coacsa-christmas .christmas-control {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1030;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: calc(100vw - 28px);
  padding: 9px 14px;
  border: 1px solid #c5a46966;
  border-radius: 999px;
  background: #fffffffa;
  color: var(--azul-principal, #292559);
  box-shadow: 0 3px 18px #29255914;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.coacsa-christmas .christmas-control svg { width: 17px; height: 17px; flex: none; }
.coacsa-christmas .christmas-control[hidden] { display: none; }
.coacsa-christmas .christmas-control:focus-visible { outline: 3px solid var(--azul-principal, #292559); outline-offset: 3px; }
.coacsa-christmas .christmas-control:hover { border-color: var(--christmas-gold); }
.coacsa-christmas .christmas-control[aria-pressed="true"] { background: #f7f8fa; }

.coacsa-christmas .christmas-greeting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 30px 0 0;
  color: inherit;
  font-size: .9rem;
  line-height: 1.6;
  text-align: center;
}
.coacsa-christmas .christmas-greeting::before,
.coacsa-christmas .christmas-greeting::after { content: '✧'; color: #e4c98e; font-size: 1.3rem; }

.coacsa-christmas.christmas-paused :is(.christmas-flake, .christmas-light, .christmas-sparkle),
.coacsa-christmas.christmas-hidden :is(.christmas-flake, .christmas-light, .christmas-sparkle),
.coacsa-christmas .christmas-snow--sleeping .christmas-flake { animation-play-state: paused; }
.coacsa-christmas.christmas-paused .christmas-snow { visibility: hidden; }
.coacsa-christmas.christmas-paused .christmas-card-arrive { animation: none; }

@media (max-width: 767px) {
  .coacsa-christmas .christmas-corner { width: 115px; opacity: .12; }
  .coacsa-christmas .christmas-surface > .christmas-corner { width: 100px; opacity: .2; }
  .coacsa-christmas .christmas-garland { height: 12px; background-size: 200px 19px; }
  .coacsa-christmas .christmas-light { top: 5px; width: 3px; height: 4px; }
  .coacsa-christmas .christmas-control { padding: 9px 11px; }
  .coacsa-christmas .christmas-control-season { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .coacsa-christmas :is(.christmas-flake, .christmas-light, .christmas-sparkle, .christmas-card-arrive) { animation: none !important; }
  .coacsa-christmas .christmas-snow { display: none; }
  .coacsa-christmas .christmas-card { transition: none; }
}

@media print {
  .coacsa-christmas :is(.christmas-atmosphere, .christmas-snow, .christmas-corner, .christmas-garland, .christmas-control, .christmas-greeting) { display: none !important; }
  .coacsa-christmas .christmas-card-arrive { animation: none; }
  .coacsa-christmas .christmas-card { box-shadow: none; }
}
