/* RepShop Christmas layer. Everything is scoped to html.rs-xmas, which
   xmas.js only sets between 1 Dec and 6 Jan, so the theme goes back to normal
   on its own after the season. To remove early: delete xmas.css / xmas.js and
   their two tags in layouts/master.njk. */

html.rs-xmas {
  --xm-red: 220, 38, 52;
  --xm-green: 34, 160, 90;
  --xm-gold: 255, 196, 80;
  --xm-frost: 214, 236, 255;
}

html.rs-xmas ::selection { background: rgba(var(--xm-red), .55); color: #fff; }

/* ── Falling snow (canvas from xmas.js) ───────────────────────────────── */
.rs-xm-snowfall {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 35; /* under the sticky navbar (40), modals and drawers */
  pointer-events: none;
}

/* Festive glow at the top of the page: red left, green right, very soft */
html.rs-xmas body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 60vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(45% 60% at 12% 0%, rgba(var(--xm-red), .13), transparent 70%),
    radial-gradient(45% 60% at 88% 0%, rgba(var(--xm-green), .11), transparent 70%);
}

/* ── Fairy lights hanging under the navbar ────────────────────────────── */
.rs-xm-lights {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -9px;
  height: 16px;
  pointer-events: none;
  z-index: 2;
}
.rs-xm-lights::before {
  /* the wire: a gentle repeating sag */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: radial-gradient(60px 10px at 30px -2px, transparent 7px, rgba(120, 130, 125, .45) 8px, transparent 9px) 0 0 / 60px 8px repeat-x;
}
.rs-xm-lights i {
  position: absolute;
  top: 5px;
  width: 6px;
  height: 9px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgb(var(--c));
  box-shadow: 0 0 6px 1px rgba(var(--c), .85), 0 0 16px 3px rgba(var(--c), .35);
  animation: rs-xm-twinkle 2.8s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes rs-xm-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; box-shadow: 0 0 3px rgba(var(--c), .5); }
}

/* ── Snow-capped buttons ──────────────────────────────────────────────── */
.rs-xm-rel { position: relative; }
.rs-xm-btn { isolation: isolate; }
.rs-xm-btn:hover,
.rs-xm-btn:focus-visible {
  /* glow only: the button and its icon stay where they are */
  box-shadow: 0 0 0 1px rgba(var(--xm-frost), .45), 0 0 22px -2px rgba(var(--xm-frost), .45), 0 0 34px -8px rgba(var(--xm-red), .55);
}
/* snow drift resting on the top edge */
.rs-xm-cap {
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 7px;
  pointer-events: none;
  z-index: 3;
  border-radius: 0 0 8px 8px;
  background:
    radial-gradient(7px 6px at 12% 0, #fff 92%, transparent),
    radial-gradient(9px 7px at 34% 0, #fff 92%, transparent),
    radial-gradient(6px 5px at 55% 0, #fff 92%, transparent),
    radial-gradient(10px 7px at 76% 0, #fff 92%, transparent),
    radial-gradient(7px 6px at 93% 0, #fff 92%, transparent),
    linear-gradient(#fff, #fff) 0 0 / 100% 2px no-repeat;
  filter: drop-shadow(0 1px 1px rgba(120, 150, 190, .45));
  opacity: .92;
}
/* flakes that drift down inside the button on hover */
.rs-xm-flakes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}
.rs-xm-flakes i {
  position: absolute;
  top: -6px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, .9);
  opacity: 0;
  animation: rs-xm-fall var(--t) linear infinite;
  animation-delay: var(--d);
  animation-play-state: paused;
  transition: opacity .3s ease;
}
.rs-xm-btn:hover .rs-xm-flakes i,
.rs-xm-btn:focus-visible .rs-xm-flakes i {
  opacity: .9;
  animation-play-state: running;
}
@keyframes rs-xm-fall {
  to { transform: translate3d(0, 64px, 0); }
}

/* ── Cards: frosty edge on hover ──────────────────────────────────────── */
/* !important: the base theme's card hover shadow is !important too */
html.rs-xmas .sa-product-card:hover,
html.rs-xmas .rs-home-cat-card:hover {
  box-shadow: 0 0 0 1px rgba(var(--xm-frost), .3), 0 12px 32px -8px rgba(0, 0, 0, .65), 0 0 30px -6px rgba(var(--xm-frost), .3) !important;
}

/* ── Footer: snow bank along its top edge ─────────────────────────────── */
html.rs-xmas .sa-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 14px;
  pointer-events: none;
  background:
    radial-gradient(22px 12px at 50% 100%, rgba(240, 246, 255, .9) 95%, transparent) 0 0 / 44px 14px repeat-x;
  opacity: .16;
}

[data-scheme="light"] .rs-xm-cap { filter: drop-shadow(0 1px 1px rgba(90, 110, 140, .6)); }
html.rs-xmas[data-scheme="light"] .sa-footer::before { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .rs-xm-snowfall, .rs-xm-flakes { display: none; }
  .rs-xm-lights i { animation: none; }
}
html.rs-lite .rs-xm-flakes { display: none; }

/* ── Top bar ──────────────────────────────────────────────────────────── */
/* candy-cane hairline instead of the platinum one */
html.rs-xmas .sa-navbar--pills > div:first-child > div::before {
  height: 2px;
  opacity: .85;
  background: repeating-linear-gradient(90deg, rgb(var(--xm-red)) 0 10px, #fff 10px 20px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
/* soft red / green glow under the bar */
html.rs-xmas .sa-navbar--pills > div:first-child > div {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 32px -14px rgba(0, 0, 0, .7),
    -60px 14px 40px -30px rgba(var(--xm-red), .45), 60px 14px 40px -30px rgba(var(--xm-green), .4);
}
/* snow drift along the top of the bar (span added by xmas.js) */
.rs-xm-cap--bar { left: 4%; right: 4%; height: 6px; opacity: .8; }

/* ── Product page ─────────────────────────────────────────────────────── */
/* snow on the buy box and the gallery frame */
.rs-xm-cap--card { left: 5%; right: 5%; height: 9px; z-index: 5; }
html.rs-xmas .sa-page-product .bloom-tr {
  box-shadow: 0 0 0 1px rgba(var(--xm-frost), .12), 0 24px 60px -30px rgba(var(--xm-red), .55);
}
/* picked variant: santa-red ring */
html.rs-xmas .sa-product-form .ring-accent-500\/30 {
  --tw-ring-color: rgba(var(--xm-red), .55);
  border-color: rgba(var(--xm-red), .7) !important;
  background: rgba(var(--xm-red), .08) !important;
}
/* active tab: red underline */
html.rs-xmas .sa-page-product [role="tab"][aria-selected="true"] {
  box-shadow: inset 0 -2px 0 rgb(var(--xm-red));
}
/* description: snowflake bullets, warm section titles */
html.rs-xmas .sa-page-product .editor ul > li::marker {
  content: '❄  ';
  color: rgb(var(--xm-frost));
  font-size: .8em;
}
html.rs-xmas .sa-page-product .editor .e-text-bold { color: #fff; }
html.rs-xmas .sa-page-product .editor p:has(> b, > strong) {
  margin-top: .9rem;
  padding-left: .6rem;
  border-left: 2px solid rgb(var(--xm-red));
}