/* Top promo bar — all pages */
.trpro-promo-bar {
  display: block;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 99990;
  color: #fff !important;
  text-decoration: none !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  background: linear-gradient(90deg, #0d47a1 0%, #1976d2 35%, #42a5f5 50%, #1976d2 65%, #0d47a1 100%);
  background-size: 220% 100%;
  animation: trpro-promo-bg 7s ease-in-out infinite;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.trpro-promo-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: trpro-promo-shine 5s ease-in-out infinite;
  pointer-events: none;
}

body.admin-bar .trpro-promo-bar {
  top: 32px;
}

.trpro-promo-bar:hover {
  color: #fff !important;
}

.trpro-promo-bar__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  box-sizing: border-box;
}

.trpro-promo-bar__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-width: 100%;
  text-align: center;
}

/* Rotating phrases — stacked in one grid cell */
.trpro-promo-bar__rotator {
  display: inline-grid;
  grid-template: 1fr / 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.trpro-promo-bar__phrase {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 0.5s ease;
  white-space: nowrap;
  pointer-events: none;
}

.trpro-promo-bar__phrase.is-active {
  opacity: 1;
}

.trpro-promo-bar__hl {
  display: inline-block;
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  animation: trpro-promo-hl 2.8s ease-in-out infinite;
}

/* Авторизованный free — ссылка в дашборд */
.trpro-promo-bar--user .trpro-promo-bar__hl--dash {
  background: rgba(255, 255, 255, 0.95);
  color: #1565c0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  animation: trpro-promo-hl-dash 2.8s ease-in-out infinite;
}

@keyframes trpro-promo-hl-dash {
  0%,
  100% {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.55);
  }
}

@media (max-width: 640px) {
  .trpro-promo-bar__inner {
    min-height: 36px;
    padding: 8px 10px;
  }

  .trpro-promo-bar {
    font-size: 12px;
  }

  .trpro-promo-bar__segment {
    gap: 4px 6px;
  }

  .trpro-promo-bar__phrase {
    white-space: normal;
    line-height: 1.35;
    max-width: min(220px, 52vw);
  }

  .trpro-promo-bar__hl {
    padding: 2px 8px;
    font-size: 11px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .trpro-promo-bar {
    top: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trpro-promo-bar,
  .trpro-promo-bar::before,
  .trpro-promo-bar__hl {
    animation: none;
  }

  .trpro-promo-bar {
    background: #1565c0;
    background-size: auto;
  }

  .trpro-promo-bar__phrase {
    display: none;
  }

  .trpro-promo-bar__phrase.is-active {
    display: block;
    opacity: 1;
  }
}

@keyframes trpro-promo-bg {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes trpro-promo-shine {
  0%,
  72%,
  100% {
    transform: translateX(-120%);
  }
  88% {
    transform: translateX(120%);
  }
}

@keyframes trpro-promo-hl {
  0%,
  100% {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  50% {
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.28);
  }
}
