/* ══════════════════════════════════════════════════════════
   Faixa de avaliações — passa sozinha, da direita para a esquerda

   A animação é CSS puro sobre uma lista duplicada: quando o trilho
   chega a -50% ele já está mostrando a cópia, então o corte é
   invisível e o loop nunca acumula erro. Timer em JS ficaria à
   deriva depois de alguns minutos e trava com a aba em segundo plano.

   Extraído de pages/package.html pra poder ser usado em mais de
   uma página (hoje: home e produto) sem duplicar o código.
   ══════════════════════════════════════════════════════════ */

.av-faixa {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgb(255 255 255 / .07);
}

.av-faixa-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.av-faixa-titulo {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.av-faixa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: .8125rem;
  font-weight: 700;
  color: hsl(var(--primary));
  transition: gap .2s ease;
}

.av-faixa-link svg { width: 14px; height: 14px; }
.av-faixa-link:hover { gap: 10px; }

/* As bordas somem em degradê para o card não "nascer" cortado.
   overflow-x:auto (em vez de hidden) é o que permite arrastar com o
   mouse pra navegar manualmente - o scrollbar fica escondido, mas o
   scroll nativo continua funcionando. Quem move sozinho é o JS,
   mexendo no scrollLeft, não mais uma animação CSS - fica fácil
   pausar no hover e deixar o visitante assumir o controle arrastando. */
.av-esteira {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.av-esteira::-webkit-scrollbar { display: none; }

.av-esteira.is-arrastando {
  cursor: grabbing;
  scroll-snap-type: none;
}

.av-trilho {
  display: flex;
  gap: 14px;
  width: max-content;
  user-select: none;
}

/* Só desliga o clique nos cards depois que o arrasto já é de
   verdade (passou do limiar) - desligar já no mousedown impedia o
   navegador de soltar o "click" no botão, e um clique normal no
   print nunca mais abria nada. */
.av-esteira.is-movendo .av-trilho * { pointer-events: none; }

/* Mesmo fundo e borda dos outros cards da loja, pra faixa não ter
   um cinza próprio. */
.av-item {
  flex: 0 0 auto;
  width: 300px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(12, 14, 20, 0.9);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

.av-cab {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.av-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: hsl(var(--primary));   /* opaco, senão a arte vaza atrás */
  color: rgb(var(--background));
  font-size: 15px;
  font-weight: 800;
}

.av-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

.av-nome {
  margin: 0;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.av-estrelas { display: flex; gap: 2px; margin-top: 3px; }
.av-estrelas svg { width: 13px; height: 13px; fill: #f5c451; color: #f5c451; }
.av-estrelas svg[data-vazia="true"] { fill: none; color: rgb(255 255 255 / .25); }

.av-texto {
  margin: 0 0 12px;
  font-size: .8125rem;
  line-height: 1.55;
  color: rgb(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Print do comprovante. Sem proporção fixa: os prints vêm de PC
   (deitados) e de celular (em pé) — forçar 16/9 cortaria mais de
   metade dos verticais. Altura travada para todos os cards da
   esteira ficarem do mesmo tamanho. */
.av-prova {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 132px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(6, 8, 12, 0.95);   /* um tom abaixo do card, para o print destacar */
  cursor: zoom-in;
  transition: border-color .2s ease;
}

.av-prova:hover { border-color: hsl(var(--primary) / .6); }

.av-prova:focus-visible {
  outline: 2px solid hsl(var(--primary) / .7);
  outline-offset: 2px;
}

.av-prova img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Card sem print fica com a mesma altura, senão a esteira balança. */
.av-prova--vazio {
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
}

@media (max-width: 640px) {
  .av-item { width: 260px; }
}

/* ── Print em tela cheia ───────────────────────────────── */

.av-visor {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / .88);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.av-visor.aberto { display: flex; }

/* O card (nome + texto + print) tem cursor normal - só o fundo
   escuro ao redor é que fecha no clique (cursor zoom-out). */
.av-visor-card {
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgb(255 255 255 / .14);
  background: rgb(var(--background));
  box-shadow: 0 30px 80px rgb(0 0 0 / .7);
  cursor: default;
}

.av-visor-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.av-visor-nome {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.av-visor-texto {
  margin: 0 0 16px;
  font-size: .875rem;
  line-height: 1.55;
  color: rgb(var(--muted-foreground));
}

.av-visor-img {
  display: block;
  width: 100%;
  max-height: 60vh;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(6, 8, 12, 0.95);
}

.av-visor-fechar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 50%;
  background: rgb(255 255 255 / .06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}

.av-visor-fechar:hover { background: hsl(var(--primary) / .25); }

@media (max-width: 640px) {
  .av-visor { padding: 12px; }
  .av-visor-card { padding: 16px; }
}
