@font-face {
  font-family: Lora;
  src: url('/lib/fonts/Lora-var.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

html:not(.is-build) body:has(.year-bar:not([hidden])) {
  --year-bar-gap: 16px;
  --year-bar-offset: env(safe-area-inset-bottom, 0px);
  --year-bar-top: calc(var(--year-bar-height, 0px) + var(--year-bar-gap) + var(--year-bar-offset));
  --year-bar-close-overhang: 26px;
  --year-bar-unstack-delay: .26s;
}

html:not(.is-build) body:has(.year-bar:not([hidden])):is(:has(.sticky-cta.on), .show-mobile-cta) {
  --year-bar-offset: max(var(--year-bar-sticky-height, 0px), env(safe-area-inset-bottom, 0px));
  --year-bar-unstack-delay: 0s;
}

.year-bar {
  height: calc(var(--year-bar-height, 0px) + 2 * var(--year-bar-gap, 16px));
  background: var(--fk-bg, var(--bg));
}

.year-bar[hidden],
html.is-build .year-bar {
  display: none;
}

.year-bar__frame {
  position: fixed;
  z-index: 70;
  inset-inline: 0;
  bottom: calc(var(--year-bar-offset) + var(--year-bar-gap));
  width: min(880px, calc(100% - 2 * var(--fk-gutter, var(--gutter))));
  margin-inline: auto;
  pointer-events: none;
  clip-path: inset(-28px -16px -8px);
  /* Снимаем отступ после того, как нижняя полоса закончила уход. */
  transition: bottom 0s var(--year-bar-unstack-delay);
}

.year-bar__panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #2e1c12;
  color: #fdf6f0;
  font: 400 16px/1.5 Golos, sans-serif;
  box-shadow: 0 18px 40px rgba(46, 28, 18, .35), 0 2px 6px rgba(46, 28, 18, .2);
  pointer-events: auto;
  animation: year-bar-enter .55s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes year-bar-enter {
  from { transform: translateY(calc(100% + 24px)); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.year-bar__row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 16px;
}

.year-bar__fan {
  position: relative;
  flex: none;
  width: 88px;
  height: 58px;
}

.year-bar__cover {
  position: absolute;
  inset: 5px auto auto 0;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 2px;
  background: #eee url('./year-bar-covers.webp?v=20261203') 0 center / 400% 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .7s;
}

.year-bar__cover:nth-child(2) { background-position-x: 33.3333%; }
.year-bar__cover:nth-child(3) { background-position-x: 66.6667%; }
.year-bar__cover:nth-child(4) { background-position-x: 100%; }
.year-bar__cover[data-slot="0"] { transform: translateX(36px) rotate(5deg); z-index: 4; }
.year-bar__cover[data-slot="1"] { transform: translateX(18px) rotate(-5deg) scale(.94); z-index: 3; }
.year-bar__cover[data-slot="2"] { transform: rotate(-14deg) scale(.88); z-index: 2; }
.year-bar__cover[data-slot="3"] { transform: translateX(-10px) rotate(-20deg) scale(.82); opacity: 0; z-index: 1; }

.year-bar__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.year-bar__text h2 {
  margin: 0;
  font: 550 18px/1.2 Lora, Georgia, serif;
  color: inherit;
}

.year-bar__lines {
  display: grid;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(253, 246, 240, .78);
}

.year-bar__lines span {
  grid-area: 1 / 1;
  transform: translateY(0);
  transition: transform .45s ease, opacity .45s ease, visibility 0s;
}

.year-bar__lines span[aria-hidden="true"] {
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, .45s;
}

.year-bar__badge { display: none; }

.year-bar__offer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-start: 16px;
  border-inline-start: 1px solid rgba(253, 246, 240, .18);
  color: rgba(253, 246, 240, .85);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
}

.year-bar__offer b {
  font: 600 32px/1 Lora, Georgia, serif;
  color: #ffc95c;
}

.year-bar__cta {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 48px;
  padding-inline: 22px;
  overflow: hidden;
  border-radius: 12px;
  background-color: #ffc95c;
  color: #2e1c12;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.year-bar__cta:hover,
.year-bar__close:hover span {
  background-image: linear-gradient(var(--hover-layer), var(--hover-layer));
}

.year-bar__cta:active,
.year-bar__close:active span {
  background-image: linear-gradient(var(--press-layer), var(--press-layer));
}

.year-bar__cta::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
  animation: year-bar-shine 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes year-bar-shine {
  0%, 90% { left: -60%; }
  100% { left: 130%; }
}

.year-bar__close {
  position: absolute;
  top: calc(-1 * var(--year-bar-close-overhang));
  right: -16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2e1c12;
  cursor: pointer;
}

.year-bar__close span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  font: 400 22px/1 Golos, sans-serif;
}

/* Сохраняем доступ к существующим нижним контролам на обеих страницах. */
html:not(.is-build) body:has(.year-bar:not([hidden])) .cookie-consent {
  bottom: calc(var(--year-bar-top) + var(--year-bar-close-overhang));
}

@media (max-width: 1000px) {
  html:not(.is-build) body:has(.year-bar:not([hidden])) .feedback-trigger {
    bottom: calc(var(--year-bar-top) + var(--year-bar-close-overhang) + 14px);
  }
  html:not(.is-build) body.has-cookie-banner:has(.year-bar:not([hidden])) .feedback-trigger {
    bottom: calc(var(--year-bar-top) + var(--year-bar-close-overhang) + var(--cookie-h, 60px) + 14px);
  }
}

@media (max-width: 720px) {
  .year-bar__panel {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .year-bar__row { gap: 10px; }
  .year-bar__fan { width: 66px; height: 48px; }
  .year-bar__cover { top: 4px; width: 40px; }
  .year-bar__cover[data-slot="0"] { transform: translateX(26px) rotate(5deg); }
  .year-bar__cover[data-slot="1"] { transform: translateX(13px) rotate(-5deg) scale(.94); }
  .year-bar__text h2 { font-size: 16px; }
  .year-bar__cta { width: 100%; border-radius: 999px; }
  .year-bar__offer { display: none; }
  .year-bar__badge {
    display: block;
    justify-self: start;
    padding: 2px 8px;
    border-radius: 6px;
    background: #ffc95c;
    color: #2e1c12;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .year-bar__frame, .year-bar__cover, .year-bar__lines span { transition: none; }
  .year-bar__panel, .year-bar__cta::after { animation: none; }
}
