/* Новогодняя тема: всё под классом .theme-ny на <html>, его ставит js/ny.js (?ny=0 выключает).
   Без класса файл ничего не меняет. Цвета матовые: сайт без свечений и ореолов. */

.theme-ny {
  --color-ny-green: #2f4a37;
  --color-ny-snow: rgba(255, 255, 255, 0.95);
  --color-ny-snow-edge: rgba(107, 97, 87, 0.3);
}

/* Акценты в цвете */

.theme-ny .card__badge {
  background: var(--color-ny-green);
}

.ny-branches {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  pointer-events: none;
}

.ny-branches__corner {
  position: absolute;
  top: 0;
  width: clamp(150px, 22vw, 400px);
  aspect-ratio: 645 / 463;
  background: url("../img/gen/ny-branches.webp") no-repeat;
  background-size: calc(100% / 0.42) auto;
  animation: ny-branches 1s var(--ease-out) 0.6s both;
}

/* Внутренний край обрезанной картинки растворяется, иначе ветки обрываются ровной линией. */
.ny-branches__corner--left {
  left: 0;
  background-position: left top;
  mask-image: linear-gradient(to right, #000 62%, transparent 96%);
}

.ny-branches__corner--right {
  right: 0;
  background-position: right top;
  mask-image: linear-gradient(to left, #000 62%, transparent 96%);
}

@keyframes ny-branches {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* Снег */

.ny-snow {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-header) + 1);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 480px) {
  .ny-branches__corner {
    width: 32vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ny-branches__corner {
    animation: none;
  }
}

/* Гирлянда из веток полосой: под первым экраном и над каталогом. Без темы полоса не видна. */
.ny-strip {
  display: none;
}

.theme-ny .ny-strip {
  display: block;
  height: clamp(56px, 7vw, 104px);
  background: url("../img/gen/garland.webp") repeat-x center / auto 100%;
  pointer-events: none;
}

/* Маленькая ёлочка в кадке рядом с заголовком. */
.ny-tree {
  display: none;
}

.theme-ny .ny-tree {
  display: block;
  width: auto;
  height: 120px;
  pointer-events: none;
}

/* На телефоне над нижней навигацией выглядывает Дед Мороз, по краю навигации лежит снег. */
@media (max-width: 768px) {
  .theme-ny .tabbar::before,
  .theme-ny .tabbar::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .theme-ny .tabbar::before {
    bottom: calc(100% - 6px);
    left: 50%;
    z-index: 1;
    width: 92px;
    height: 47px;
    background: url("../img/gen/santa-peek.webp") no-repeat center bottom / contain;
    transform: translateX(-50%);
  }

  .theme-ny .tabbar::after {
    right: 0;
    bottom: calc(100% - 7px);
    left: 0;
    height: 15px;
    background: url("../img/gen/snow-cap.webp") repeat-x left bottom / auto 100%;
  }

  .theme-ny .ny-tree {
    height: 84px;
  }
}
