/* Sugerir produto. Cor, raio e fonte só por variável de tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background-color: var(--fundo); background-image: var(--textura-container);
  color: var(--texto); font-family: var(--fonte); font-weight: var(--peso-normal);
  line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--laranja); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pagina {
  max-width: 440px; min-height: 100dvh; margin-inline: auto;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background-color: var(--fundo);
}
@media (min-width: 480px) { .pagina { border-inline: 1px solid var(--borda); } }

.topo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.topo img { width: 40px; height: 40px; }
.topo strong { font-weight: var(--peso-marca); letter-spacing: 0.01em; }
h1 { margin: 0 0 0.4rem; font-size: 1.6rem; line-height: 1.15; font-weight: var(--peso-marca); }
h2 { margin: 1.75rem 0 0.75rem; font-size: 1.05rem; font-weight: var(--peso-forte); }
.sub { margin: 0 0 1.25rem; color: var(--texto-2); }

.selo {
  width: fit-content; margin: 2.5rem auto 0; padding: 0.35rem 0.85rem; white-space: nowrap;
  border: 1px solid var(--laranja); border-radius: var(--raio-pilula);
  background: var(--fundo); color: var(--laranja);
  font-size: 0.75rem; font-weight: var(--peso-forte); letter-spacing: 0.06em; text-transform: uppercase;
}

.campo {
  width: 100%; min-height: 3.5rem; padding: 0 1rem;
  background: var(--superficie); border: 2px solid var(--borda); border-radius: var(--raio-m);
  font-size: 1rem;
}
.campo:focus { border-color: var(--laranja); outline: none; }
.campo::placeholder { color: var(--texto-3); }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0 1.25rem; border: 2px solid transparent; border-radius: var(--raio-pilula);
  font-weight: var(--peso-forte); font-size: 1rem; text-decoration: none; text-align: center;
  transition: background var(--rapido) var(--curva), transform var(--rapido) var(--curva);
}
.botao:active { transform: scale(0.98); }
.botao--primario { background: var(--laranja); color: var(--texto-sobre-laranja); }
.botao--primario:hover { background: var(--laranja-forte); }
.botao--secundario { background: transparent; border-color: var(--borda); color: var(--texto); }
.botao--secundario:hover { border-color: var(--texto-3); }
.botao--grande { width: 100%; min-height: 3.5rem; font-size: 1.1rem; }
.botao[disabled] { opacity: 0.45; cursor: not-allowed; }
.botao svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.acoes { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.75rem; }

.estado { margin: 0.75rem 0; color: var(--texto-2); min-height: 1.4em; }
.estado--erro { color: var(--erro); }
#abrir-manual { margin-top: 0.75rem; }

.lista { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.item {
  display: grid; grid-template-columns: 56px 1fr; gap: 0.75rem; align-items: center; width: 100%;
  padding: 0.65rem; text-align: left; min-height: 44px;
  background: var(--superficie); border: 2px solid var(--borda); border-radius: var(--raio-m);
}
button.item:hover { border-color: var(--texto-3); }
.item--recusado { opacity: 0.5; }
.foto { width: 56px; height: 56px; border-radius: var(--raio-p); background: var(--superficie-2); object-fit: contain; }
.foto--vazia { display: grid; place-items: center; color: var(--texto-3); font-weight: var(--peso-marca); }
.item__nome { display: block; font-weight: var(--peso-forte); overflow-wrap: anywhere; }
.item__meta { display: block; color: var(--texto-2); font-size: 0.875rem; overflow-wrap: anywhere; }
.codigo { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.875rem; color: var(--texto-2); }
.selos { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.selos span, .etiqueta {
  padding: 0.1rem 0.55rem; border: 1px solid var(--borda); border-radius: var(--raio-pilula);
  font-size: 0.75rem; color: var(--texto-2);
}
.etiqueta--teste { background: var(--verde); border-color: var(--verde); color: var(--texto-sobre-verde); font-weight: var(--peso-forte); }

.cartao { padding: 1rem; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-m); }
.cartao .item { border: 0; padding: 0; background: none; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border: 2px solid var(--borda); border-radius: var(--raio-pilula); background: var(--superficie);
}
.chip input:checked + span { background: var(--laranja); border-color: var(--laranja); color: var(--texto-sobre-laranja); font-weight: var(--peso-forte); }
.chip input:focus-visible + span { outline: 3px solid var(--branco); outline-offset: 2px; }
legend { padding: 0; margin-bottom: 0.6rem; font-weight: var(--peso-forte); }
.bloco { margin-top: 1.25rem; }

.ok { margin: 0; font-size: 1.5rem; font-weight: var(--peso-marca); color: var(--verde); }
.pedidos { display: grid; grid-template-columns: 56px 1fr; gap: 0.5rem 0.75rem; align-items: center; padding: 0.65rem; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-m); }
.pedidos .botao { grid-column: 2; justify-self: start; min-height: 44px; padding: 0 1.1rem; font-size: 0.9rem; }
.ok:focus { outline: none; }

/* painel */
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.numero { padding: 0.75rem 0.5rem; text-align: center; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-m); }
.numero strong { display: block; font-size: 1.75rem; line-height: 1.1; font-weight: var(--peso-marca); color: var(--laranja); }
.numero span { font-size: 0.75rem; color: var(--texto-2); }
.linha { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.85rem; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-m); }
.linha--recusado { opacity: 0.5; }
.linha .etiqueta { align-self: flex-start; }
.linha p { margin: 0; }
.linha .item { padding: 0; border: 0; background: none; }
.linha__qtd { margin: 0; font-weight: var(--peso-forte); }
.linha__acoes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linha__acoes .botao { flex: 1 1 auto; font-size: 0.9rem; }
.copiar { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.copiar button { min-height: 44px; padding: 0 0.85rem; background: transparent; border: 1px solid var(--borda); border-radius: var(--raio-pilula); font-size: 0.8rem; }

/* câmera */
.camera { position: fixed; inset: 0; z-index: 10; background: var(--fundo); display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.camera video { flex: 1; min-height: 0; width: 100%; object-fit: cover; }
.camera .botao { margin: 1rem; }

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