/* ------------------------------------------------------------------
   Чёрная пятница: слой украшения cheltsov.ru
   27.11 19:00 — 11.12. Палитра: уголь, неоновый циан, фиолет, лайм.
   Слой не перехватывает указатель, кроме док-панели, жетона-CTA
   и диалога.
   ------------------------------------------------------------------ */

.bf-layer {
  position: fixed;
  inset: 0;
  z-index: 2147482900;
  pointer-events: none;
  contain: layout style;

  --bf-ink: #f5ecd9;
  --bf-muted: #b3c5de;
  --bf-cyan: #37e6ff;
  --bf-violet: #8b5cff;
  --bf-lime: #c6ff3d;
  --bf-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.bf-layer *,
.bf-layer *::before,
.bf-layer *::after {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------- док */

.bf-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(0);
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 10px 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(55, 230, 255, 0.5);
  background:
    radial-gradient(120% 180% at 6% 0%, rgba(55, 230, 255, 0.2), transparent 60%),
    radial-gradient(120% 180% at 96% 120%, rgba(139, 92, 255, 0.24), transparent 62%),
    linear-gradient(90deg, #08070d, #0d1220 55%, #0a0910);
  box-shadow:
    0 18px 44px -18px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 0 34px -14px rgba(55, 230, 255, 0.7);
  pointer-events: auto;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--bf-ink);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}

/* Голографическая развёртка вместо пыли. */
.bf-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(55, 230, 255, 0.16) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.35;
  pointer-events: none;
}

/* Неоновая кромка сверху. */
.bf-dock::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bf-cyan), var(--bf-violet), transparent);
  opacity: 0.75;
  pointer-events: none;
}

.bf-dock--closed {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.bf-dock__token {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(55, 230, 255, 0.75));
}

.bf-dock__token svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bf-dock__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.bf-dock__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
}

.bf-dock__sub {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bf-muted);
  line-height: 1;
}

.bf-dock__timer {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(55, 230, 255, 0.22);
}

.bf-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 30px;
}

.bf-unit__num {
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--bf-cyan);
  text-shadow: 0 0 14px rgba(55, 230, 255, 0.6);
}

.bf-unit__cap {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bf-muted);
  line-height: 1;
}

.bf-unit--sec .bf-unit__num {
  color: var(--bf-lime);
  text-shadow: 0 0 14px rgba(198, 255, 61, 0.5);
}

.bf-dock__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--bf-cyan);
  color: #07131a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(55, 230, 255, 0.9);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bf-dock__cta:hover {
  background: #6ceeff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(55, 230, 255, 0.95);
}

.bf-dock__cta:focus-visible,
.bf-dock__close:focus-visible,
.bf-chip:focus-visible,
.bf-panel__close:focus-visible {
  outline: 2px solid var(--bf-lime);
  outline-offset: 2px;
}

.bf-dock__close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 236, 217, 0.08);
  color: #cbbfae;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bf-dock__close:hover {
  background: rgba(55, 230, 255, 0.16);
  color: var(--bf-ink);
}

/* ---------------------------------------- жетон-CTA с голограммой */

.bf-chip {
  position: fixed;
  right: 22px;
  bottom: 88px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(8, 9, 16, 0.94) 0 72%,
    rgba(8, 9, 16, 0.6) 84%,
    transparent 96%
  );
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0 14px rgba(55, 230, 255, 0.45));
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  transform: translateY(14px) scale(0.9);
}

.bf-chip--in {
  opacity: 1;
  transform: none;
}

.bf-chip:hover {
  transform: translateY(-3px) scale(1.04);
}

.bf-chip > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bf-chip__halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(55, 230, 255, 0.38),
    rgba(139, 92, 255, 0.2) 46%,
    transparent 70%
  );
  animation: bf-halo 3.4s ease-in-out infinite;
  pointer-events: none;
}

.bf-chip__phrase {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 3px 7px;
  border: 1px solid rgba(55, 230, 255, 0.42);
  border-radius: 6px;
  background: rgba(8, 10, 18, 0.88);
  color: var(--bf-cyan);
  font-family: var(--bf-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.bf-chip__hint {
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 11px;
  border: 1px solid rgba(55, 230, 255, 0.4);
  border-radius: 10px;
  background: #0b101b;
  color: var(--bf-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bf-chip:hover .bf-chip__hint,
.bf-chip:focus-visible .bf-chip__hint {
  opacity: 1;
}

/* ------------------------------------------- прогресс акции (кольцо) */

.bf-progress {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 84px;
  height: 84px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: drop-shadow(0 0 10px rgba(55, 230, 255, 0.3));
}

.bf-progress svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bf-progress--in {
  opacity: 0.94;
}

.bf-progress__pct {
  font-family: var(--bf-mono);
  font-size: 15px;
  font-weight: 700;
  fill: var(--bf-ink);
}

.bf-progress__cap {
  font-family: var(--bf-mono);
  font-size: 7.4px;
  font-weight: 700;
  letter-spacing: 0.1em;
  fill: var(--bf-muted);
}

/* -------------------------------------- фон: неоновые сущности в полёте */

.bf-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bf-item {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  opacity: 0;
  transform-origin: 50% 50%;
}

.bf-item svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 2px rgba(8, 9, 16, 0.35)) drop-shadow(0 0 7px rgba(139, 92, 255, 0.55));
}

.bf-orbit__rings {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: bf-spin 16s linear infinite;
}

.bf-item--matrix text:nth-of-type(2) {
  animation: bf-flicker 2.8s steps(2, end) infinite;
}

/* ----------------------------------------------------------- диалог */

.bf-panel[hidden] {
  display: none;
}

.bf-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
  z-index: 2147482950;
  background: rgba(5, 7, 12, 0.72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s ease;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.bf-panel--open {
  opacity: 1;
}

.bf-panel__card {
  position: relative;
  width: min(600px, 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(55, 230, 255, 0.34);
  background:
    radial-gradient(140% 90% at 50% -10%, rgba(55, 230, 255, 0.16), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(139, 92, 255, 0.2), transparent 60%),
    #0d0b14;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px -24px rgba(55, 230, 255, 0.6);
  color: var(--bf-ink);
  transform: translateY(18px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.bf-panel--open .bf-panel__card {
  transform: none;
}

.bf-panel__head {
  position: relative;
  padding: 22px 24px 16px;
  border-bottom: 1px dashed rgba(55, 230, 255, 0.2);
}

.bf-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--bf-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bf-cyan);
}

.bf-panel__eyebrow::before,
.bf-panel__eyebrow::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.bf-panel__title {
  margin: 0;
  font-family: var(--bf-mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--bf-ink);
}

.bf-panel__title em {
  font-style: normal;
  color: var(--bf-lime);
}

.bf-panel__sub {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--bf-muted);
  max-width: 44ch;
}

.bf-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 236, 217, 0.08);
  color: #cbbfae;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bf-panel__close:hover {
  background: rgba(55, 230, 255, 0.16);
  color: var(--bf-ink);
}

.bf-panel__body {
  padding: 8px 12px 4px;
  overflow: auto;
  overscroll-behavior: contain;
}

.bf-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 12px;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.bf-item-row + .bf-item-row {
  border-top: 1px solid rgba(55, 230, 255, 0.08);
}

.bf-item-row:hover {
  background: rgba(55, 230, 255, 0.05);
}

.bf-item-row__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.32;
}

.bf-item-row__meta {
  margin-top: 4px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--bf-muted);
}

.bf-item-row__prices {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.bf-item-row__was {
  font-size: 13px;
  color: var(--bf-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(139, 92, 255, 0.9);
  text-decoration-thickness: 1.5px;
}

.bf-item-row__now {
  font-size: 18px;
  font-weight: 800;
  color: var(--bf-lime);
}

.bf-item-row__off {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(198, 255, 61, 0.5);
  border-radius: 999px;
  background: rgba(198, 255, 61, 0.14);
  color: var(--bf-lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: 2px;
}

.bf-panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 24px 20px;
  border-top: 1px dashed rgba(55, 230, 255, 0.2);
  background: linear-gradient(0deg, rgba(55, 230, 255, 0.07), transparent);
}

.bf-panel__timer {
  display: flex;
  gap: 8px;
}

.bf-panel__timer .bf-unit__num {
  font-size: 24px;
}

.bf-panel__note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--bf-muted);
  max-width: 24ch;
}

.bf-panel__note b {
  color: var(--bf-ink);
}

/* --------------------------------------------------- узкие экраны */

@media (max-width: 860px) {
  .bf-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "pk title close"
      "timer timer cta";
    align-items: center;
    gap: 8px 10px;
    height: auto;
    padding: 9px 10px 9px 14px;
    border-radius: 16px;
  }

  .bf-dock--closed {
    transform: translateY(130%);
  }

  .bf-dock__token { grid-area: pk; width: 24px; height: 24px; }
  .bf-dock__label { grid-area: title; }
  .bf-dock__close { grid-area: close; justify-self: end; width: 28px; height: 28px; }
  .bf-dock__timer {
    grid-area: timer;
    padding-left: 0;
    border-left: 0;
    justify-content: flex-start;
    gap: 12px;
  }
  .bf-dock__cta { grid-area: cta; justify-self: end; height: 34px; padding: 0 14px; }
  .bf-unit { min-width: 26px; }
  .bf-unit__num { font-size: 17px; }

  .bf-progress { display: none; }

  .bf-chip {
    right: 14px;
    bottom: 112px;
    width: 54px;
    height: 54px;
  }

  .bf-chip__phrase { font-size: 8px; }
  .bf-chip__hint { display: none; }

  .bf-panel__card { max-height: 92vh; border-radius: 14px; }
  .bf-panel__title { font-size: 22px; }
  .bf-panel__head, .bf-panel__foot { padding-left: 18px; padding-right: 18px; }

  .bf-item-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bf-item-row__prices { justify-self: start; }
}

@media (max-width: 420px) {
  .bf-dock__title {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .bf-dock__sub {
    display: none;
  }

  .bf-unit {
    min-width: 26px;
  }

  .bf-unit__num {
    font-size: 18px;
  }

  .bf-dock__cta {
    font-size: 12px;
    height: 32px;
  }
}

/* --------------------------------------------------------- анимации */

@keyframes bf-spin {
  to { transform: rotate(360deg); }
}

@keyframes bf-flicker {
  0%, 100% { opacity: 0.9; }
  45% { opacity: 0.25; }
  55% { opacity: 0.75; }
}

@keyframes bf-halo {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50%      { transform: scale(1.12); opacity: 0.95; }
}

/* --------------------------------------------------- меньше движения */

@media (prefers-reduced-motion: reduce) {
  .bf-chip__halo,
  .bf-orbit__rings,
  .bf-item--matrix text:nth-of-type(2) {
    animation: none;
  }

  .bf-dock,
  .bf-panel,
  .bf-panel__card,
  .bf-chip,
  .bf-progress {
    transition-duration: 0.01ms;
  }
}

a.bf-item-row,
a.bf-item-row:hover {
  color: inherit;
  text-decoration: none;
}
