/* Faixa "PIX pagos ao vivo" no header do afiliado */
.app-header:has(> .pix-ticker:not([hidden])) > .header-actions {
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.pix-ticker {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(27, 13, 51, .82), rgba(27, 13, 51, .82)) padding-box,
    linear-gradient(90deg, rgba(139, 92, 246, .75), rgba(236, 72, 153, .75)) border-box;
  box-shadow: 0 0 18px rgba(168, 85, 247, .12), inset 0 0 12px rgba(124, 58, 237, .12);
  overflow: hidden;
  position: relative;
  font-family: Inter, system-ui, sans-serif;
}
.pix-ticker[hidden] { display: none !important; }

.pix-ticker-live {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(76, 29, 149, .85), rgba(124, 58, 237, .55));
  border-right: 1px solid rgba(168, 85, 247, .45);
  color: #f3e8ff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}
.pix-ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: pixTickerPulse 1.4s ease-out infinite;
}

.pix-ticker-view {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.pix-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  animation: pixTickerMove var(--pix-ticker-dur, 40s) linear infinite;
  will-change: transform;
}
.pix-ticker:hover .pix-ticker-track { animation-play-state: paused; }

.pix-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 16px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 12px;
  color: #d8c8f0;
}
.pix-ticker-check { width: 16px; height: 16px; flex-shrink: 0; }
.pix-ticker-check circle { fill: rgba(34, 197, 94, .16); stroke: #22c55e; stroke-width: 2; }
.pix-ticker-check path { fill: none; stroke: #22c55e; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pix-ticker-bolt { width: 15px; height: 15px; fill: #fbbf24; flex-shrink: 0; filter: drop-shadow(0 0 4px rgba(251, 191, 36, .55)); }
.pix-ticker-id {
  color: #f3e8ff;
  font-weight: 700;
  font-family: 'Space Grotesk', ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .02em;
}
.pix-ticker-me {
  color: #fbbf24;
  font-weight: 800;
  letter-spacing: .06em;
  text-shadow: 0 0 8px rgba(251, 191, 36, .55);
}
.pix-ticker-item.is-me { background: rgba(251, 191, 36, .08); }
.pix-ticker-sep { color: #c026d3; font-size: 9px; text-shadow: 0 0 6px rgba(192, 38, 211, .6); }
.pix-ticker-val { color: #22c55e; font-weight: 800; }
.pix-ticker-ok { color: #ece6fb; }
.pix-ticker-time { color: #8b78b0; font-size: 11px; }
.pix-ticker-item.is-new { animation: pixTickerNew 2s ease-out 1; }

/* Carregando */
.pix-ticker.is-loading .pix-ticker-track {
  width: 100%;
  animation: none;
}
.pix-ticker.is-loading .pix-ticker-track::before {
  content: '';
  display: block;
  width: 100%;
  height: 12px;
  margin: 0 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(168, 85, 247, .08) 0%, rgba(236, 72, 153, .22) 50%, rgba(168, 85, 247, .08) 100%);
  background-size: 200% 100%;
  animation: pixTickerShimmer 1.3s linear infinite;
}

/* Vazio e estático */
.pix-ticker.is-empty .pix-ticker-track,
.pix-ticker.is-static .pix-ticker-track {
  animation: none !important;
  transform: none !important;
}
.pix-ticker.is-empty .pix-ticker-item { color: #f3e8ff; font-weight: 600; }
.pix-ticker.is-static .pix-ticker-item { animation: pixTickerFade .4s ease-out; }

/* Linha própria abaixo do header (tablet/mobile) */
.pix-ticker.is-row {
  flex: none;
  width: calc(100% - 1.3rem);
  margin: .5rem .65rem 0;
  height: 36px;
}
.pix-ticker.is-row .pix-ticker-live { padding: 0 10px; font-size: 10px; }

@keyframes pixTickerMove { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes pixTickerPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); opacity: 1; }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); opacity: .55; }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); opacity: 1; }
}
@keyframes pixTickerNew {
  0%, 50% { background: rgba(34, 197, 94, .30); box-shadow: 0 0 14px rgba(34, 197, 94, .55); }
  25%, 75% { background: rgba(34, 197, 94, .14); box-shadow: 0 0 6px rgba(34, 197, 94, .25); }
  100% { background: transparent; box-shadow: none; }
}
@keyframes pixTickerShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pixTickerFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .pix-ticker-track { animation: none !important; }
  .pix-ticker-dot, .pix-ticker-item.is-new, .pix-ticker.is-loading .pix-ticker-track::before { animation: none; }
}
