/* ==========================================================================
   Festive season add-on (Christmas / New Year)
   Loaded only while components/festive.php says the season is on.
   Every graphic is an inline SVG - no extra requests. Selectors start with
   "html body" so they win over css/style.css whatever the load order.
   ========================================================================== */

:root {
  --festive-holly: #1d4a36;
  --festive-holly-deep: #153827;
  --festive-berry: #a8262e;
  --festive-gold: #e8c27a;
  --festive-snow: #ffffff;
}

/* ---------- 1. Greeting ribbon (above the sticky header, scrolls away) ---------- */
html body .festive-bar {
  position: relative;
  z-index: 1001;
  background: var(--festive-holly);
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.4px);
  background-size: 14px 14px;
  color: #f6efe0;
  font-size: 1.4rem;
  line-height: 1.4;
}

html body .festive-bar[hidden] {
  display: none;
}

html body .festive-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  max-width: var(--container-max-width);
  min-height: 4rem;
  margin: 0 auto;
  padding: 0.6rem 4.8rem 0.6rem 2rem;
  position: relative;
}

html body .festive-bar__holly {
  width: 2.6rem;
  height: auto;
  flex: none;
}

html body .festive-bar__text {
  margin: 0;
  font-weight: 500;
}

html body .festive-bar__short {
  display: none;
}

html body .festive-bar__count {
  flex: none;
  padding: 0.2rem 1rem;
  border: 0.1rem solid rgba(232, 194, 122, 0.55);
  border-radius: var(--radius-pill, 999px);
  color: var(--festive-gold);
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

html body .festive-bar__link {
  flex: none;
  color: var(--festive-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
  white-space: nowrap;
}

html body .festive-bar__link:hover {
  color: #fff;
}

html body .festive-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  min-height: 32px;
  padding: 0 0.8rem;
  background: transparent;
  border-radius: var(--radius-pill, 999px);
  color: rgba(246, 239, 224, 0.85);
  font-size: 1.3rem;
  cursor: pointer;
}

html body .festive-bar__btn[hidden] {
  display: none;
}

html body .festive-bar__btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

html body .festive-bar__btn:focus-visible,
html body .festive-bar__link:focus-visible {
  outline: 0.2rem solid var(--festive-gold);
  outline-offset: 0.2rem;
}

html body .festive-bar__btn i {
  font-size: 1.6rem;
}

html body .festive-bar__snow[aria-pressed="false"] i {
  opacity: 0.5;
}

html body .festive-bar__close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  justify-content: center;
  padding: 0;
}

/* ---------- 2. Santa hat on the logo monogram ---------- */
html body .header .flex .logo {
  position: relative;
}

html body .header .flex .logo::before {
  content: '';
  position: absolute;
  z-index: 2;
  left: -5%;
  top: -38%;
  width: 24%;
  aspect-ratio: 64 / 50;
  pointer-events: none;
  transform: rotate(-16deg);
  transform-origin: 30% 80%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 50'%3E%3Cpath d='M9 36C12 21 24 6 41 6c9 0 15 6 16 15-4-4-9-5-13-2 2 5 4 11 5 17Z' fill='%23b3242c'/%3E%3Cpath d='M41 6c9 0 15 6 16 15-4-4-9-5-13-2-1-6-2-10-3-13Z' fill='%23d63d44'/%3E%3Cpath d='M30 12c-6 5-10 14-12 24h-6c3-12 9-20 18-24Z' fill='%238c1a21' opacity='.55'/%3E%3Crect x='4' y='33' width='50' height='12' rx='6' fill='%23fff'/%3E%3Cpath d='M10 37h40' stroke='%23e9e1d2' stroke-width='2.4' stroke-linecap='round' stroke-dasharray='.1 6'/%3E%3Ccircle cx='56' cy='24' r='6.5' fill='%23fff'/%3E%3Ccircle cx='54' cy='22' r='2' fill='%23f1ebe0'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(60, 45, 20, 0.25));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* A small tip of the hat when the logo is pointed at - answers the visitor, never runs on its own */
html body .header .flex .logo:hover::before {
  transform: rotate(-24deg) translateY(-6%);
}

/* ---------- 3. Fairy lights along the bottom of the header ---------- */
html body .header::before,
html body .header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 14px;
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: 112px 14px;
}

/* wire + bulbs */
html body .header::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 14'%3E%3Cpath d='M0 1Q14 7 28 1T56 1T84 1T112 1' fill='none' stroke='%237a6a4c' stroke-width='.8' opacity='.6'/%3E%3Cg%3E%3Crect x='12.6' y='3.4' width='2.8' height='2' rx='.5' fill='%237a6a4c'/%3E%3Cellipse cx='14' cy='8.6' rx='2.6' ry='3.6' fill='%23c7313a'/%3E%3Crect x='40.6' y='3.4' width='2.8' height='2' rx='.5' fill='%237a6a4c'/%3E%3Cellipse cx='42' cy='8.6' rx='2.6' ry='3.6' fill='%23e3b04f'/%3E%3Crect x='68.6' y='3.4' width='2.8' height='2' rx='.5' fill='%237a6a4c'/%3E%3Cellipse cx='70' cy='8.6' rx='2.6' ry='3.6' fill='%232f8a5b'/%3E%3Crect x='96.6' y='3.4' width='2.8' height='2' rx='.5' fill='%237a6a4c'/%3E%3Cellipse cx='98' cy='8.6' rx='2.6' ry='3.6' fill='%23f4e3b5'/%3E%3C/g%3E%3C/svg%3E");
}

/* glow halos on alternate bulbs - only opacity animates (cheap, GPU) */
html body .header::after {
  bottom: -14px;
  height: 20px;
  background-size: 112px 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 20'%3E%3Cdefs%3E%3CradialGradient id='r'%3E%3Cstop offset='0' stop-color='%23ff6b6b' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23ff6b6b' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%2363d48f' stop-opacity='.5'/%3E%3Cstop offset='1' stop-color='%2363d48f' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='14' cy='11.6' r='8' fill='url(%23r)'/%3E%3Ccircle cx='70' cy='11.6' r='8' fill='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.25;
  animation: festive-twinkle 2.8s ease-in-out infinite alternate;
}

@keyframes festive-twinkle {
  to {
    opacity: 1;
  }
}

/* ---------- 4. Section headings: gold rule with a small snowflake ---------- */
html body .heading::after {
  width: 10rem;
  height: 1.4rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 14'%3E%3Cg stroke='%23cb9238' stroke-linecap='round'%3E%3Cpath d='M2 7h36M62 7h36' stroke-width='2'/%3E%3Cg stroke-width='1.6'%3E%3Cpath d='M50 1v12M44.8 4l10.4 6M44.8 10l10.4-6'/%3E%3Cpath d='M48.2 2.4 50 3.8l1.8-1.4M48.2 11.6 50 10.2l1.8 1.4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  border-radius: 0;
}

/* ---------- 5. Snowdrift resting on the top of the footer ---------- */
html body .footer {
  position: relative;
}

html body .footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 26px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 26' preserveAspectRatio='none'%3E%3Cpath d='M0 0h240v8c-8 7-18 9-26 4-9 10-24 9-31 1-8 6-18 6-24-1-10 11-27 10-34 0-7 5-17 5-23-2-9 8-22 8-29 0-8 6-19 5-25-3-9 9-25 9-32 0C8 13 4 12 0 8Z' fill='%23e8e1d3'/%3E%3Cpath d='M0 0h240v5c-8 6-18 8-26 3-9 9-24 8-31 1-8 5-18 5-24-1-10 10-27 9-34 0-7 4-17 4-23-2-9 7-22 7-29 0-8 5-19 4-25-3-9 8-25 8-32 0C8 10 4 9 0 5Z' fill='%23faf7f1'/%3E%3C/svg%3E") top left / 240px 26px repeat-x;
}

html body .festive-greeting {
  margin: 0;
  padding: 2.2rem 2rem 0;
  border-top: 0.1rem solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: var(--festive-gold);
  font-size: 1.5rem;
  font-weight: 500;
  text-transform: none;
}

html body .festive-greeting + .credit {
  border-top: 0;
}

/* ---------- 6. Falling snow (canvas from js/festive.js) ---------- */
.festive-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 900; /* under header (1000), bottom nav (950), floating buttons (940) and dialogs */
  pointer-events: none;
}

/* ---------- Small screens ---------- */
@media (max-width: 768px) {
  html body .festive-bar {
    font-size: 1.3rem;
  }

  html body .festive-bar__inner {
    justify-content: flex-start;
    gap: 0.8rem;
    min-height: 3.8rem;
    padding: 0.4rem 4.4rem 0.4rem 1.4rem;
  }

  html body .festive-bar__long,
  html body .festive-bar__count {
    display: none;
  }

  html body .festive-bar__short {
    display: inline;
  }

  html body .festive-bar__text {
    flex: 1 1 auto;
    min-width: 0;
  }

  html body .festive-bar__snow span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  html body .festive-bar__snow {
    width: 32px;
    justify-content: center;
    padding: 0;
  }

  html body .festive-bar__close {
    right: 0.6rem;
  }
}

@media (max-width: 420px) {
  html body .festive-bar__link {
    display: none;
  }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  /* no snow, so no snow button - decided by CSS before the first paint, so nothing shifts */
  html body .festive-bar__snow {
    display: none;
  }

  html body .header::after {
    animation: none;
    opacity: 0.6;
  }

  html body .header .flex .logo::before {
    transition: none;
  }
}

/* ==========================================================================
   CHRISTMAS EDITION - site-wide skin
   ========================================================================== */

/* Add to cart becomes a Christmas-red call to action */
html body .btn[name="add_to_cart"]:not(:disabled) {
  background: linear-gradient(180deg, #c3313a, #a0232b);
  color: #fff;
  border-color: transparent;
}

html body .btn[name="add_to_cart"]:not(:disabled):hover {
  background: #8a1a21;
  color: #fff;
}

/* prices in cranberry */
html body .home-products .slide .flex .price,
html body .products .box-container .box .flex .price,
html body .qv-card-price {
  color: #a8262e;
}

/* product page: sticky phone bar button matches */
html body .qv-sticky-btn:not(:disabled) {
  background: linear-gradient(180deg, #c3313a, #a0232b);
  color: #fff;
}

/* active menu marks in red */
html body .header .flex .navbar a.active::after,
html body .bottom-nav a.active::after {
  background: #a8262e;
}

/* every product card is wrapped like a gift: red ribbon across the top + bow */
html body .home-products .slide,
html body .products .box-container .box {
  position: relative;
}

html body .home-products .slide::after,
html body .products .box-container .box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.8rem;
  z-index: 2;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 20'%3E%3Cpath d='M22 6C17-1 7-1 7 5c0 5 8 5 15 1Z' fill='%23c3313a'/%3E%3Cpath d='M22 6c5-7 15-7 15-1 0 5-8 5-15 1Z' fill='%23c3313a'/%3E%3Cpath d='M22 6C18 2 11 1 10 4' fill='none' stroke='%238e1b22' stroke-width='1.2'/%3E%3Cpath d='M22 6c4-4 11-5 12-2' fill='none' stroke='%238e1b22' stroke-width='1.2'/%3E%3Cpath d='M20 7l-5 12 4-1 2 2 1-12Zm4 0 5 12-4-1-2 2-1-12Z' fill='%23a8262e'/%3E%3Ccircle cx='22' cy='6.5' r='3.2' fill='%23e3b04f'/%3E%3C/svg%3E") 50% 0 / 4.4rem 2rem no-repeat,
    linear-gradient(#a8262e, #a8262e) 0 0 / 100% 0.35rem no-repeat;
}

/* ---------- Order placed: confetti canvas ---------- */
.festive-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10050;
  pointer-events: none;
}

