@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --vermelho: #e5122a;
  --vermelho-escuro: #b80d20;
  --vermelho-suave: #ffe3e6;
  --branco: #ffffff;
  --cinza-100: #f7f7fa;
  --cinza-300: #e6e6ec;
  --cinza-500: #9797a3;
  --cinza-800: #2c2c34;
  --sombra: 0 14px 32px rgba(20, 10, 15, .12);
  --sombra-foco: 0 18px 40px rgba(229, 18, 42, .30);
  --r: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--cinza-100);
  color: var(--cinza-800);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* --------------------------------------------------------------- conteudo */
/* margem de segurança: nas máquinas o gabinete cobre um pouco a borda do monitor */
.conteudo { height: 100vh; padding: max(1.6rem, 3.5vh) max(1.8rem, 4vw); }

.grade {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1rem;
}

.produto {
  position: relative;
  background: var(--branco);
  border-radius: var(--r);
  box-shadow: var(--sombra);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
  min-height: 0;
}
.produto:hover { transform: translateY(-3px); box-shadow: var(--sombra-foco); border-color: var(--vermelho-suave); }
.produto:active { transform: translateY(-1px) scale(.99); }

.produto.selecionado {
  border-color: var(--vermelho);
  animation: piscar-selecionado 1.8s ease-in-out infinite;
}
@keyframes piscar-selecionado {
  0%, 100% { box-shadow: var(--sombra); border-color: var(--vermelho-suave); }
  50% { box-shadow: 0 0 0 6px rgba(229, 18, 42, .22), var(--sombra-foco); border-color: var(--vermelho); }
}
@media (prefers-reduced-motion: reduce) {
  .produto.selecionado { animation: none; border-color: var(--vermelho); box-shadow: var(--sombra-foco); }
}

/* modo vitrine: destaque rápido que passeia pelos produtos até alguém tocar */
.produto.destaque-vitrine {
  border-color: var(--vermelho);
  box-shadow: 0 0 0 4px rgba(229, 18, 42, .18), var(--sombra-foco);
  transform: translateY(-2px);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.imagem {
  flex: 1 1 auto;
  min-height: 0;
  background: linear-gradient(160deg, var(--vermelho-suave), #ffd0d6);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--vermelho-escuro);
  overflow: hidden;
}
.imagem img { width: 100%; height: 100%; object-fit: cover; display: block; }

.info {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .7rem .9rem;
  border-top: 1px solid var(--cinza-300);
}
.nome { font-weight: 700; font-size: .95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preco { flex: 0 0 auto; font-weight: 800; font-size: 1.05rem; color: var(--vermelho-escuro); white-space: nowrap; }

.tag-esgotado {
  position: absolute; top: .6rem; right: .6rem;
  font-size: .65rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--branco); background: var(--cinza-800);
  padding: 0.25rem 0.6rem; border-radius: 999px;
}

.produto.esgotado { opacity: .6; cursor: not-allowed; }
.produto.esgotado:hover { transform: none; box-shadow: var(--sombra); border-color: transparent; }

/* -------------------------------------------------------- painel de compra */
.painel-compra { position: fixed; inset: 0; z-index: 40; }
.painel-compra.oculto { display: none; }
.fundo-painel { position: absolute; inset: 0; background: rgba(20,10,15,.45); }

.cartao-painel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--branco);
  box-shadow: -20px 0 40px rgba(0,0,0,.15);
  padding: 2rem 1.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.passo { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; margin: auto 0; }
.passo.oculto { display: none; }

.fechar {
  position: absolute; top: -1.2rem; right: -1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: none; background: var(--cinza-100); color: var(--cinza-800);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.fechar:hover { background: var(--cinza-300); }

.anel-grande { width: 6rem; height: 6rem; border-radius: 50%; padding: 4px; background: conic-gradient(from 220deg, var(--vermelho), #ff7a8a, var(--vermelho)); margin-bottom: .4rem; }
.icone-grande { width: 100%; height: 100%; border-radius: 50%; background: var(--vermelho-suave); color: var(--vermelho-escuro); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2.2rem; overflow: hidden; }
.icone-grande img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.passo h2 { font-size: 1.15rem; }
.preco-grande { font-size: 1.7rem; font-weight: 800; color: var(--vermelho-escuro); }
.dica-passo { color: var(--cinza-500); font-size: .88rem; }

button.botao-pix {
  width: 100%;
  border: none; border-radius: 999px;
  background: var(--vermelho); color: var(--branco);
  font-weight: 700; font-size: 1rem;
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(229, 18, 42, .30);
  transition: transform .12s ease, background .15s ease;
  margin-top: .4rem;
}
button.botao-pix:hover { background: var(--vermelho-escuro); }
button.botao-pix:active { transform: scale(.97); }

button.secundario {
  border: 1px solid var(--cinza-300); border-radius: 999px;
  background: var(--branco); color: var(--cinza-800);
  font-weight: 600; font-size: .92rem;
  padding: 0.7rem 1.3rem; cursor: pointer;
  margin-top: .6rem;
}
button.secundario:hover { background: var(--cinza-100); }

.selo-teste {
  background: var(--cinza-800); color: var(--branco);
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: 0.3rem 0.9rem; border-radius: 999px;
}

.produto-nome { font-weight: 700; font-size: 1.05rem; }
.produto-preco { font-size: 1.4rem; font-weight: 800; color: var(--vermelho-escuro); }

.moldura-qr {
  background: var(--branco); border: 2px solid var(--cinza-300);
  border-radius: 16px; padding: 0.7rem;
}
.qr-fake {
  width: 190px; height: 190px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 3px;
}
.qr-fake i { background: var(--cinza-800); border-radius: 1px; }
.qr-fake i.off { background: transparent; }

.aviso { color: var(--cinza-500); font-weight: 600; font-size: .92rem; }
.aviso .pontos::after { content: '…'; }

.selo-ok {
  width: 4.4rem; height: 4.4rem; border-radius: 50%;
  background: #e8f8ee; color: #2f9e5f;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800;
  margin-bottom: .3rem;
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 2rem;
  transform: translate(-50%, 20px);
  background: var(--cinza-800); color: var(--branco);
  padding: 0.75rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.mostrar { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 700px) {
  html, body { height: auto; overflow: auto; }
  .conteudo { height: auto; padding: .8rem; }
  .grade { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; gap: .7rem; }
  .produto { aspect-ratio: 3 / 4; }
  .imagem { font-size: 2.2rem; }
  .nome { font-size: .85rem; }
  .preco { font-size: .92rem; }
  .cartao-painel { max-width: 100%; padding: 1.6rem 1.3rem; }
}
