/* ============ Новий рік (1 грудня — 15 січня). Усе прив'язане до .is-newyear — клас знімається 16 січня ============
   Анімації лише transform / opacity (відеокарта), без скриптів. prefers-reduced-motion — сніг вимкнено. */
.ny-ribbon, .ny-snow { display: none; }
.is-newyear {
  --ny-night: #0d2140;
  --ny-blue: #1c3f73;
  --ny-ice: #cfe6ff;
  --ny-gold: #ffd45e;
}

/* --- стрічка над шапкою: ніч, ялинка, гірлянда знизу */
.is-newyear .ny-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 40px; padding: 8px 16px 26px; color: #eef5ff; font-size: 14px; text-align: center;
  background:
    radial-gradient(1.5px 1.5px at 8% 30%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 22% 65%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 41% 22%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 63% 58%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 79% 28%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 93% 62%, rgba(255, 255, 255, 0.6), transparent),
    linear-gradient(90deg, var(--ny-night), var(--ny-blue) 50%, var(--ny-night));
  position: relative; overflow: hidden;
}
.is-newyear .ny-ribbon__tree { width: 22px; height: 28px; flex: 0 0 auto; }
.is-newyear .ny-star { transform-origin: 16px 4px; animation: ny-star 2.6s ease-in-out infinite; }
.is-newyear .ny-ribbon__link { color: var(--ny-gold); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 1px solid rgba(255, 212, 94, 0.5); }
.is-newyear .ny-ribbon__link:hover { color: #fff0b8; }
@keyframes ny-star { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.65; transform: scale(0.82); } }

/* --- гірлянда: кожна лампочка висить на своєму провисі дроту */
.is-newyear .ny-garland {
  position: absolute; left: 0; right: 0; bottom: 0; height: 24px;
  display: flex; overflow: hidden; pointer-events: none;
}
.is-newyear .ny-bulb {
  position: relative; flex: 0 0 56px; height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 24'%3E%3Cpath d='M0 2 Q28 16 56 2' fill='none' stroke='%23071426' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat 0 0 / 56px 24px;
}
.is-newyear .ny-bulb::before { /* цоколь */
  content: ""; position: absolute; left: 25px; top: 7px; width: 6px; height: 4px; border-radius: 1px; background: #3b4a5c;
}
.is-newyear .ny-bulb::after { /* скло */
  content: ""; position: absolute; left: 24px; top: 10px; width: 8px; height: 12px; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--c); box-shadow: 0 0 6px 2px var(--c);
  animation: ny-twinkle 2.4s ease-in-out infinite;
}
.is-newyear .ny-bulb:nth-child(4n+1) { --c: #ff4d5e; }
.is-newyear .ny-bulb:nth-child(4n+2) { --c: #ffd45e; }
.is-newyear .ny-bulb:nth-child(4n+3) { --c: #4fd17f; }
.is-newyear .ny-bulb:nth-child(4n+4) { --c: #5fb8ff; }
.is-newyear .ny-bulb:nth-child(3n+2)::after { animation-delay: -0.8s; }
.is-newyear .ny-bulb:nth-child(3n+3)::after { animation-delay: -1.6s; }
.is-newyear .ny-bulb:nth-child(5n)::after { animation-duration: 3.1s; }
@keyframes ny-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* --- сніг: 18 сніжинок, що повільно падають і погойдуються */
.is-newyear .ny-snow { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.is-newyear .ny-flake {
  position: absolute; top: -24px; width: 14px; height: 14px; opacity: 0.8;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb9e3' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7M9.5 3.8L12 6l2.5-2.2M9.5 20.2L12 18l2.5 2.2M3.6 10.5l3.2-.9-.8-3.2M20.4 13.5l-3.2.9.8 3.2M3.6 13.5l3.2.9-.8 3.2M20.4 10.5l-3.2-.9.8-3.2'/%3E%3C/svg%3E") no-repeat center / contain;
  will-change: transform;
  animation: ny-fall-a 14s linear infinite;
}
/* частина — просто м'які крупинки */
.is-newyear .ny-flake:nth-child(3n) { width: 7px; height: 7px; border-radius: 50%; background: #b9d6f2; box-shadow: 0 0 3px rgba(120, 165, 215, 0.6); }
.is-newyear .ny-flake:nth-child(even) { animation-name: ny-fall-b; }
.is-newyear .ny-flake:nth-child(1)  { left: 3%;  animation-duration: 13s; animation-delay: -2s; }
.is-newyear .ny-flake:nth-child(2)  { left: 9%;  animation-duration: 17s; animation-delay: -9s;  width: 10px; height: 10px; }
.is-newyear .ny-flake:nth-child(3)  { left: 15%; animation-duration: 12s; animation-delay: -5s; }
.is-newyear .ny-flake:nth-child(4)  { left: 21%; animation-duration: 19s; animation-delay: -14s; width: 18px; height: 18px; opacity: 0.6; }
.is-newyear .ny-flake:nth-child(5)  { left: 27%; animation-duration: 15s; animation-delay: -1s; }
.is-newyear .ny-flake:nth-child(6)  { left: 33%; animation-duration: 11s; animation-delay: -7s; }
.is-newyear .ny-flake:nth-child(7)  { left: 39%; animation-duration: 18s; animation-delay: -11s; width: 11px; height: 11px; }
.is-newyear .ny-flake:nth-child(8)  { left: 45%; animation-duration: 14s; animation-delay: -4s; }
.is-newyear .ny-flake:nth-child(9)  { left: 51%; animation-duration: 16s; animation-delay: -12s; }
.is-newyear .ny-flake:nth-child(10) { left: 57%; animation-duration: 20s; animation-delay: -6s;  width: 17px; height: 17px; opacity: 0.6; }
.is-newyear .ny-flake:nth-child(11) { left: 63%; animation-duration: 13s; animation-delay: -10s; }
.is-newyear .ny-flake:nth-child(12) { left: 69%; animation-duration: 15s; animation-delay: -3s; }
.is-newyear .ny-flake:nth-child(13) { left: 75%; animation-duration: 18s; animation-delay: -15s; width: 10px; height: 10px; }
.is-newyear .ny-flake:nth-child(14) { left: 81%; animation-duration: 12s; animation-delay: -8s; }
.is-newyear .ny-flake:nth-child(15) { left: 86%; animation-duration: 16s; animation-delay: -13s; }
.is-newyear .ny-flake:nth-child(16) { left: 91%; animation-duration: 14s; animation-delay: -5s;  width: 16px; height: 16px; opacity: 0.65; }
.is-newyear .ny-flake:nth-child(17) { left: 95%; animation-duration: 19s; animation-delay: -16s; }
.is-newyear .ny-flake:nth-child(18) { left: 98%; animation-duration: 13s; animation-delay: -9s; }
@keyframes ny-fall-a {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(30px, 55vh, 0) rotate(180deg); }
  100% { transform: translate3d(-10px, calc(100vh + 40px), 0) rotate(360deg); }
}
@keyframes ny-fall-b {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(-30px, 55vh, 0) rotate(-180deg); }
  100% { transform: translate3d(12px, calc(100vh + 40px), 0) rotate(-360deg); }
}

/* --- логотип: маленька ялинка над короною */
.is-newyear .logo a.il-logo { position: relative; }
.is-newyear .logo a.il-logo::before {
  content: ""; position: absolute; left: 20px; top: -4px; width: 13px; height: 16px; transform: rotate(-10deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 40'%3E%3Cpath d='M16 4 L25 16 H20.5 L28 26 H22 L30 36 H2 L10 26 H4 L11.5 16 H7 Z' fill='%232e9d5b'/%3E%3Crect x='13.5' y='36' width='5' height='4' fill='%238a5a33'/%3E%3Ccircle cx='16' cy='3' r='3' fill='%23ffd45e'/%3E%3Ccircle cx='13' cy='15' r='1.6' fill='%23ff4d5e'/%3E%3Ccircle cx='19' cy='24' r='1.6' fill='%235fb8ff'/%3E%3Ccircle cx='12' cy='31' r='1.6' fill='%23ffd45e'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* --- картки товарів: холодне зимове світіння */
.is-newyear .pcard--v2 { transition: box-shadow 0.25s ease, transform 0.25s ease; }
@media (hover: hover) {
  .is-newyear .pcard--v2:hover { box-shadow: 0 0 0 1px rgba(95, 184, 255, 0.45), 0 18px 40px -18px rgba(60, 130, 210, 0.5); }
}

/* --- низ сайту: сніжна шапка зверху і ялинка */
.is-newyear .block-group.footer { position: relative; overflow: hidden; }
.is-newyear .block-group.footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; pointer-events: none;
  background:
    radial-gradient(circle at 11px -2px, #fff 10px, transparent 10.5px) repeat-x 0 0 / 22px 12px,
    radial-gradient(circle at 4px -3px, #eaf4ff 7px, transparent 7.5px) repeat-x 9px 0 / 31px 12px;
}
.is-newyear .block-group.footer::after {
  content: ""; position: absolute; right: 5%; top: 26px; width: 72px; height: 90px; pointer-events: none; opacity: 0.9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 40'%3E%3Cpath d='M16 4 L25 16 H20.5 L28 26 H22 L30 36 H2 L10 26 H4 L11.5 16 H7 Z' fill='%232e9d5b'/%3E%3Cpath d='M16 4 L25 16 H20.5 L28 26 H22 L30 36 H16 Z' fill='%2323804a'/%3E%3Cpath d='M7 16 H11.5 L10 17.5 Z M4 26 H10 L8.5 27.5 Z M2 36 H30 L28 37 H4 Z M20.5 16 H25 L23 17.5 Z M22 26 H28 L26 27.5 Z' fill='%23ffffff' opacity='.85'/%3E%3Crect x='13.5' y='36' width='5' height='4' rx='1' fill='%238a5a33'/%3E%3Cpath d='M16 .6l1.2 2.5 2.7.3-2 1.9.5 2.7-2.4-1.3-2.4 1.3.5-2.7-2-1.9 2.7-.3z' fill='%23ffd45e'/%3E%3Ccircle cx='13' cy='14' r='1.4' fill='%23ff4d5e'/%3E%3Ccircle cx='19' cy='21' r='1.4' fill='%23ffd45e'/%3E%3Ccircle cx='11' cy='27' r='1.4' fill='%235fb8ff'/%3E%3Ccircle cx='21' cy='31' r='1.4' fill='%23ff4d5e'/%3E%3Ccircle cx='15' cy='32' r='1.2' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 14px rgba(255, 212, 94, 0.25));
}

@media (max-width: 768px) {
  .is-newyear .ny-ribbon { font-size: 13px; gap: 8px; min-height: 36px; padding: 6px 12px 24px; }
  .is-newyear .ny-ribbon__more { display: none; }
  .is-newyear .ny-flake:nth-child(n+11) { display: none; }
  .is-newyear .block-group.footer::after { width: 48px; height: 60px; opacity: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  .is-newyear .ny-snow { display: none; }
  .is-newyear .ny-bulb::after, .is-newyear .ny-star { animation: none; }
}
