:root {
  --laranja: #ffb35c;
  --laranja-forte: #f59a2e;
  --laranja-suave: #fff1df;
  --preto: #111111;
  --texto: #1c1c1c;
  --cinza: #6a655f;
  --linha: #e8e2da;
  --linha-forte: #d6cec4;
  --fundo: #f6f4f1;
  --cartao: #ffffff;
  --vermelho: #a3201f;
  --verde: #1f6b35;
  --logo-fundo: #f7f7f7;
  --raio: 18px;
  --sombra: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px rgba(17, 17, 17, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topo ---------- */
.topo {
  background: var(--preto);
  color: #fff;
  border-bottom: 3px solid var(--laranja);
}
.topo-dentro {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-cartao {
  flex: 0 0 auto;
  width: 132px;
  background: var(--logo-fundo);
  border-radius: 16px;
  overflow: hidden;
}
.logo-cartao img {
  display: block;
  width: 100%;
  aspect-ratio: 1080 / 720;
  object-fit: cover;
  object-position: center 54%;
}
.logo-texto {
  display: none;
  padding: 18px 10px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--vermelho);
}
.logo-cartao.sem-imagem img { display: none; }
.logo-cartao.sem-imagem .logo-texto { display: block; }
.topo h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.topo .sub { margin: 4px 0 0; color: #b9b4ae; font-size: .88rem; }
.topo .rotulo {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--laranja);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Conteúdo ---------- */
main { max-width: 680px; margin: 0 auto; padding: 20px 16px 120px; }

.bloco {
  background: var(--cartao);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 20px;
  margin: 0 0 16px;
}
.bloco > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.bloco > h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--laranja);
  flex: 0 0 auto;
}
h3 { margin: 18px 0 4px; font-size: 1rem; font-weight: 700; }
.nota { color: var(--cinza); font-size: .9rem; margin: 4px 0 10px; }
.nota strong { color: var(--texto); }
.aviso-dia {
  background: var(--laranja-suave);
  border-left: 4px solid var(--laranja-forte);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-weight: 700;
}
.carregando { text-align: center; padding: 48px 0; color: var(--cinza); font-weight: 600; }

/* ---------- Botões ---------- */
.botao, button { font: inherit; cursor: pointer; }
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--laranja);
  background: var(--laranja);
  color: var(--preto);
  font-weight: 800;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.botao:hover { background: var(--laranja-forte); border-color: var(--laranja-forte); }
.botao.secundario { background: #fff; border-color: var(--preto); }
.botao.secundario:hover { background: var(--laranja-suave); }
.botao.grande { width: 100%; font-size: 1.05rem; min-height: 54px; margin-top: 6px; }
.botao.largo { width: 100%; }
.botao.perigo { background: #fff; color: var(--vermelho); border-color: #e6c4c3; }
.botao.perigo:hover { background: #fbeeee; }

:focus-visible {
  outline: 3px solid var(--preto);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--laranja);
}

/* ---------- Contadores (+ / -) ---------- */
.linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linha);
}
.linha:last-child, .linha:has(+ .oculto) { border-bottom: 0; }
.linha .nome { flex: 1; font-weight: 600; }
.linha .preco { display: block; color: var(--cinza); font-size: .86rem; font-weight: 500; }
.contador { display: flex; align-items: center; gap: 4px; }
.contador button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--linha-forte);
  background: #fff;
  color: var(--preto);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.contador button[data-dir="1"] { background: var(--preto); border-color: var(--preto); color: #fff; }
.contador button[aria-disabled="true"],
.contador button[data-dir="1"][aria-disabled="true"] {
  background: #f1ede8; border-color: #f1ede8; color: #b3aca3; cursor: not-allowed;
}
.contador output { min-width: 3.2ch; text-align: center; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.situacao {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .92rem;
  background: var(--laranja-suave);
}
.situacao.ok { background: #e6f3e9; color: var(--verde); }
.situacao.erro { background: #fbeaea; color: var(--vermelho); }

.opcao-festa {
  margin: 12px 0;
  padding: 4px 16px 12px;
  border: 1px solid var(--linha);
  border-radius: 14px;
  background: #fcfbf9;
}
.opcao-festa h4 { margin: 12px 0 6px; font-size: .95rem; font-weight: 800; }
.regras { margin: 0 0 6px; padding-left: 18px; color: var(--cinza); font-size: .9rem; }
.regras li { margin: 2px 0; }
.regras strong { color: var(--texto); }

.produto-cliente { padding: 2px 0 6px; border-bottom: 1px solid var(--linha); }
.produto-cliente:last-child { border-bottom: 0; }
.produto-cliente h3 { margin-top: 12px; }

/* ---------- Formulário ---------- */
label { font-weight: 700; display: block; margin: 14px 0 6px; font-size: .94rem; }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=time], textarea, select {
  width: 100%;
  font: inherit;
  padding: 11px 14px;
  border: 1.5px solid var(--linha-forte);
  border-radius: 12px;
  background: #fff;
  color: var(--texto);
}
input:focus, textarea:focus, select:focus { border-color: var(--preto); }
textarea { min-height: 84px; resize: vertical; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; font-size: .94rem; }
.opcoes-radio { display: grid; gap: 8px; }
.opcoes-radio label, .marcar {
  display: flex; align-items: center; gap: 12px;
  margin: 0; padding: 12px 14px;
  border: 1.5px solid var(--linha-forte); border-radius: 12px;
  background: #fff; font-weight: 600; cursor: pointer;
}
.opcoes-radio input, .marcar input { width: 20px; height: 20px; accent-color: var(--preto); flex: 0 0 auto; }
.opcoes-radio label:has(input:checked) { border-color: var(--preto); background: var(--laranja-suave); }
.marcar:has(input:checked) { border-color: var(--preto); }
.oculto { display: none !important; }

.caixa-retirada {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--laranja-suave);
  border: 1px solid #f2d6b0;
}
.caixa-retirada p { margin: 0 0 10px; }

.dia-indicador { color: var(--laranja-forte); font-weight: 800; }
.grade-hora { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grade-hora label { margin-top: 0; font-weight: 600; color: var(--cinza); }
select:disabled { background: #f1ede8; color: #9b948b; }

/* ---------- Resumo ---------- */
.resumo-lista { margin: 0; padding: 0; list-style: none; }
.resumo-lista li { padding: 8px 0; border-bottom: 1px dashed var(--linha); }
.resumo-lista small { color: var(--cinza); }
.total { font-size: 1.2rem; font-weight: 800; margin: 14px 0 4px; }
.erros {
  border: 1.5px solid #e6c4c3;
  background: #fbeeee;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.erros h2 { margin: 0 0 6px; font-size: 1rem; color: var(--vermelho); }
.erros ul { margin: 0; padding-left: 20px; }
.erros a { color: var(--vermelho); }

/* ---------- Pix ---------- */
.caixa-pix {
  margin: 16px 0;
  padding: 16px;
  border-radius: 14px;
  background: var(--laranja-suave);
  border: 1px solid #f2d6b0;
}
.caixa-pix h3 { margin-top: 0; }
.dados-pix { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 14px; }
.dados-pix dt { color: var(--cinza); font-size: .88rem; }
.dados-pix dd { margin: 0; font-weight: 700; word-break: break-all; }
#chave-pix { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; }

/* ---------- Barra fixa do total ---------- */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--preto); color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
}
.barra-dentro { max-width: 680px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.barra strong { color: var(--laranja); font-size: 1.15rem; }

.rodape { text-align: center; color: var(--cinza); font-size: .85rem; padding: 4px 16px 32px; }

/* ---------- Abas do painel ---------- */
.abas {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 12px;
  margin: -6px 0 6px;
  background: var(--fundo);
  scrollbar-width: thin;
}
.aba {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--linha-forte);
  background: #fff;
  color: var(--texto);
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
}
.aba:hover { border-color: var(--preto); }
.aba[aria-selected="true"] { background: var(--preto); border-color: var(--preto); color: #fff; }

.so-leitor {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Alto contraste do Windows */
@media (forced-colors: active) {
  .botao, .contador button, .opcoes-radio label, .bloco, .marcar, .aba, .caixa-pix { border: 2px solid ButtonText; }
  .opcoes-radio label:has(input:checked), .aba[aria-selected="true"] { outline: 3px solid Highlight; }
  .bloco > h2::before { background: CanvasText; }
}
