/* Cíclica Nomura — identidade visual da MARCA Grupo Nomura (marcas/grupo-nomura), self-hosted.
   Este arquivo é público (servido a todas as lojas): nunca importar CSS/tokens de outro
   produto interno nem citar nome de outro produto aqui — ver CLAUDE.md do repo. */

@font-face {
  font-family: "Neue Montreal";
  src: url("fonts/NeueMontreal-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Neue Montreal";
  src: url("fonts/NeueMontreal-Medium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Telegraf";
  src: url("fonts/Telegraf-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* paleta oficial 2026 — marcas/grupo-nomura/cores/cores-grupo-nomura-2026.md */
  --azul-escuro: #011621;
  --branco-gelo: #fcffff;
  --laranja: #ff5400;
  --azul-claro: #0066ff;
  --cinza-100: #f0f0f0;
  --cinza-300: #d9d9d9;
  --verde-acido: #deec00;

  --bg: var(--azul-escuro);
  --bg-card: #0d222f;
  --bg-card-hover: #123044;
  --ink: var(--branco-gelo);
  --ink-dim: #7f97a1;
  --linha: #1a3444;
  --verde: #2ecc71;
  --ambar: #f5a623;
  --vermelho: #e74c3c;
  --raio: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Neue Montreal", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior-y: contain;
}

h1, h2 { font-family: "Telegraf", "Neue Montreal", sans-serif; font-weight: 400; }
.btn, .produto-nome, #cabecalho-titulo { font-weight: 500; } /* nunca acima de 600 (regra da casa) */

#bipe-input {
  position: fixed;
  top: -100px;
  left: -100px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

h1 { font-size: 1.3rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.sub { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 16px; }

#cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--linha);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
#cabecalho-titulo { font-weight: 700; color: var(--laranja); }
#cabecalho-loja { color: var(--ink-dim); font-size: 0.9rem; }

#app { padding: 16px; padding-bottom: 96px; max-width: 640px; margin: 0 auto; }

.tela.escondida { display: none; }

label { display: block; font-size: 0.85rem; color: var(--ink-dim); margin-bottom: 6px; }

input[type="text"], input[type="search"] {
  width: 100%;
  padding: 14px;
  border-radius: var(--raio);
  border: 1px solid var(--linha);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 16px;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--raio);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primario { background: var(--laranja); color: #fff; }
.btn-primario:disabled { background: var(--linha); color: var(--ink-dim); cursor: not-allowed; }
.btn-secundario { background: var(--bg-card); color: var(--ink); border: 1px solid var(--linha); }
.btn-perigo { background: transparent; color: var(--vermelho); border: 1px solid var(--vermelho); }
.btn-flutuante {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 608px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.btn-voltar {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.95rem;
  padding: 0 0 12px;
  cursor: pointer;
}

/* ---- flash de bipe ---- */
#flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
}
#flash-overlay.flash-verde { background: var(--verde); animation: flash-anim .25s ease-out; }
#flash-overlay.flash-ambar { background: var(--ambar); animation: flash-anim .25s ease-out; }
#flash-overlay.flash-vermelho { background: var(--vermelho); animation: flash-anim .25s ease-out; }
@keyframes flash-anim {
  0% { opacity: .55; }
  100% { opacity: 0; }
}

/* ---- toasts ---- */
#toast-container {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--verde);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  animation: toast-entra .15s ease-out;
}
.toast-alerta { background: var(--ambar); color: #1a1200; }
.toast-erro { background: var(--vermelho); }
.toast-saindo { opacity: 0; transition: opacity .4s; }
@keyframes toast-entra {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---- lista de produtos ---- */
.lista-cabecalho { display: flex; justify-content: space-between; align-items: baseline; }
.salvo-indicador { font-size: 0.8rem; color: var(--verde); opacity: 0; transition: opacity .3s; }
.salvo-indicador.salvo-visivel { opacity: 1; }

#lista-produtos-grid { display: flex; flex-direction: column; gap: 10px; }
.produto-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--raio);
  background: var(--bg-card);
  border: 1px solid var(--linha);
  text-align: left;
  cursor: pointer;
}
.produto-card:active, .produto-card:hover { background: var(--bg-card-hover); }
.produto-card img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.produto-info { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.produto-nome { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.produto-article { font-size: 0.78rem; color: var(--ink-dim); }
.produto-qtd {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  color: var(--ink-dim);
  font-size: 1.1rem;
}
.produto-qtd-ativa { color: var(--verde); }

/* ---- contando_produto ---- */
#contando-cabecalho { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
#contando-cabecalho img { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #fff; }
#contando-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.tamanho-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 8px;
  border-radius: var(--raio);
  background: var(--bg-card);
  border: 1px solid var(--linha);
  cursor: pointer;
}
.tamanho-tile-ativa { border-color: var(--verde); background: color-mix(in srgb, var(--verde) 14%, var(--bg-card)); }
.tamanho-numero { font-size: 1.1rem; font-weight: 700; }
.tamanho-qtd { font-size: 1.4rem; font-weight: 800; color: var(--verde); }
.tamanho-tile:not(.tamanho-tile-ativa) .tamanho-qtd { color: var(--ink-dim); }

/* ---- modais ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
}
.modal.escondida { display: none; }
.modal-caixa {
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 640px;
}
@media (min-width: 480px) {
  .modal { align-items: center; }
  .modal-caixa { border-radius: var(--raio); }
}
.modal-botoes { display: flex; gap: 10px; margin-top: 16px; }
.modal-botoes .btn { flex: 1; }

.qtd-controles { display: flex; align-items: center; gap: 12px; }
.btn-qtd {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--linha);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}
#qtd-input {
  flex: 1;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0;
}

/* ---- revisão ---- */
#revisao-lista { display: flex; flex-direction: column; gap: 8px; }
.revisao-linha {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--linha);
}
.revisao-linha span { color: var(--ink-dim); font-size: 0.85rem; }
.revisao-zero {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ambar) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ambar) 40%, transparent);
  cursor: pointer;
}
.revisao-zero input { margin-top: 2px; }
.revisao-zero span { color: var(--ink); font-size: 0.85rem; }
