/* ==========================================================================
   STICKY DE URGÊNCIA — Zencial
   Barra fixa no rodapé com contador REAL (data configurável no JS).

   Desktop: barra compacta, uma linha, alta legibilidade.
   Mobile : bloco mais alto e mais forte, mas deliberadamente contido —
            não passa de ~30% da altura da tela, para os cupons continuarem
            visíveis atrás dele.
   ========================================================================== */

:root {
  --st-fundo:      #0d0616;
  --st-fundo-2:    #1c0d33;
  --st-violeta:    #7c4dff;
  --st-violeta-2:  #9d6bff;
  --st-lavanda:    #c9b0ff;
  --st-texto:      #f4f0ff;
  --st-suave:      #b0a0cc;
  --st-borda:      rgba(201, 176, 255, 0.20);
  --st-z:          900;   /* abaixo do modal de cupom (1000) e da roleta (1100) */
}

.st-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--st-z);
  color: var(--st-texto);
  background:
    radial-gradient(80% 180% at 50% 100%, rgba(124, 77, 255, 0.30) 0%, rgba(124, 77, 255, 0) 65%),
    linear-gradient(180deg, var(--st-fundo-2) 0%, var(--st-fundo) 100%);
  border-top: 1px solid var(--st-borda);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.45);
  /* safe-area do iPhone: o botão nunca fica sob a barra de gestos */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.st-bar.visivel { transform: translateY(0); }

/* fio de luz no topo, igual ao cartão da roleta */
.st-bar::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--st-lavanda), transparent);
  opacity: 0.6;
}

.st-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

/* ===== Bloco de texto + contador ===== */
.st-info { display: flex; align-items: center; gap: 16px; min-width: 0; }

.st-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--st-suave);
  line-height: 1.35;
}
.st-label strong { display: block; color: var(--st-lavanda); }

.st-contador {
  font-family: 'Hanken Grotesk', 'Inter', monospace;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(157, 107, 255, 0.55);
  white-space: nowrap;
}
.st-legenda {
  font-size: 12px;
  color: var(--st-suave);
  line-height: 1.35;
}
.st-legenda strong { color: var(--st-texto); font-weight: 700; }

/* ===== CTA ===== */
.st-cta {
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  padding: 15px 28px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--st-violeta-2), var(--st-violeta) 55%, #5a2fd6);
  box-shadow: 0 8px 22px rgba(124, 77, 255, 0.42);
  transition: transform 0.18s ease, filter 0.18s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.st-cta:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.st-cta:focus-visible { outline: 2px solid var(--st-lavanda); outline-offset: 3px; }
.st-cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Estado encerrado ===== */
.st-bar.encerrada .st-contador {
  font-size: 19px;
  letter-spacing: 1.6px;
  color: var(--st-suave);
  text-shadow: none;
}
.st-bar.encerrada .st-label strong { color: var(--st-suave); }

/* ==========================================================================
   CONFLITO DE CAMADAS
   Enquanto a roleta ou o modal de cupom estiverem abertos, o sticky sai da
   frente — nada de guerra de overlays.
   ========================================================================== */
body.rl-aberta .st-bar,
body.modal-cupom-aberto .st-bar {
  transform: translateY(110%);
  pointer-events: none;
}

/* ==========================================================================
   MOBILE — layout próprio, empilhado.
   Forte visualmente, mas limitado em altura para não comer a lista.
   ========================================================================== */
@media (max-width: 640px) {
  .st-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 11px 16px 12px;
    text-align: center;
  }
  .st-info {
    flex-direction: column;
    gap: 3px;
    align-items: center;
  }
  .st-label { font-size: 9.5px; letter-spacing: 1.3px; }
  .st-label strong { display: inline; }
  .st-contador { font-size: 34px; letter-spacing: 2px; }
  .st-legenda  { font-size: 11px; }
  .st-cta {
    width: 100%;
    padding: 15px 18px;
    font-size: 14px;
    border-radius: 12px;
  }
  .st-bar.encerrada .st-contador { font-size: 17px; }
}

/* telas curtas: comprime ainda mais para sobrar lista visível */
@media (max-width: 640px) and (max-height: 700px) {
  .st-inner    { padding: 8px 14px 10px; gap: 7px; }
  .st-contador { font-size: 28px; }
  .st-cta      { padding: 13px 16px; }
  .st-legenda  { display: none; }   /* o contador já comunica a urgência */
}

/* espaço no fim da página para o sticky não cobrir o rodapé */
body.st-ativo .footer { padding-bottom: 104px; }
@media (max-width: 640px) {
  body.st-ativo .footer { padding-bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-bar, .st-cta { transition: none; }
}
