/* Boteco Placa Preta — identidade base do Gale
   Cores, tipografia e formas conforme o protótipo aprovado (passagem, seção 8). */

:root {
  /* Cores */
  --fundo: #0A0A0A;             /* fundo da página */
  --superficie: #141414;        /* cards, barras */
  --superficie-alta: #1E1E1E;   /* campos, chips */
  --borda: #2A2A2A;
  --borda-forte: #3A3A3A;
  --texto: #EDE6D6;
  --texto-sec: #B9B19C;
  --texto-ter: #9A9380;
  --acento: #F25C1C;            /* laranja brasa */
  --acento-texto: #1A0A00;      /* texto em cima do laranja */
  --acento-fundo: #2A1A12;
  --acento-escuro: #C14310;
  --sucesso: #7FC283;
  --sucesso-fundo: #16301A;
  --atencao: #E6B84D;
  --atencao-fundo: #3A2D0E;
  --erro: #E58A8A;
  --erro-borda: #C95757;
  --foto: #1F1A15;

  /* Formas */
  --raio-campo: 12px;           /* botões e campos */
  --raio-card: 16px;            /* cards */
  --abas-h: 74px;               /* barra de abas do cliente */

  /* Nomes antigos, ainda usados em algumas páginas */
  --bg: var(--fundo);
  --bg-elev: var(--superficie);
  --bg-elev-2: var(--superficie-alta);
  --texto-dim: var(--texto-sec);
  --texto-mais-dim: var(--texto-ter);
  --radius: var(--raio-card);
  --radius-sm: var(--raio-campo);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  /* Inter quando disponível no aparelho; a CSP não permite carregar fonte de fora. */
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }

a { color: var(--acento); }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; margin: 0 0 12px; line-height: 1.1; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.acento, h1 em { color: var(--acento); font-style: italic; }

.wrapper { max-width: 520px; margin: 0 auto; padding: 20px 20px 40px; }

/* ───────── Topo ───────── */
header.topo {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
  position: sticky; top: 0; z-index: 10;
}
header.topo .foto {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--foto); display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
header.topo .foto img { width: 100%; height: 100%; object-fit: cover; }
header.topo .marca { flex: 1; min-width: 0; }
header.topo .nome { font-weight: 800; font-size: 1rem; line-height: 1.1; }
header.topo .assinatura { color: var(--texto-ter); font-size: 0.75rem; margin-top: 2px; }
header.topo .meta { margin-left: auto; color: var(--texto-sec); font-size: 0.85rem; }

.pilula-mesa {
  background: var(--acento); color: var(--acento-texto);
  font-size: 0.8125rem; font-weight: 800;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.botao-voltar {
  width: 44px; height: 44px; border-radius: 999px; flex-shrink: 0;
  background: var(--superficie-alta); color: var(--texto);
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}

/* ───────── Cards, campos, botões ───────── */
.card {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-card);
  padding: 16px;
  margin-bottom: 12px;
}

label { display: block; margin-top: 14px; font-size: 0.8125rem; color: var(--texto-sec); }
label .req { color: var(--acento); }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; min-height: 52px; padding: 0 14px;
  background: var(--superficie-alta);
  border: 1px solid var(--borda);
  border-radius: var(--raio-campo);
  color: var(--texto);
  font-size: 1rem;
  margin-top: 6px;
  font-family: inherit;
}
input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}
input[aria-invalid="true"] { border-color: var(--erro-borda); }
.dica { display: block; font-size: 0.75rem; color: var(--texto-ter); margin-top: 6px; }

.check {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 16px; font-size: 0.875rem; line-height: 1.4; color: var(--texto-sec);
  min-height: 24px;
}
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--acento); flex-shrink: 0; }

.botao {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 56px;
  padding: 0 20px;
  background: var(--acento);
  color: var(--acento-texto);
  border: none; border-radius: 14px;
  font-size: 1rem; font-weight: 800;
  cursor: pointer; margin-top: 16px;
  font-family: inherit; text-decoration: none; text-align: center;
}
.botao:hover { background: var(--acento-escuro); color: var(--texto); }
.botao:disabled, .botao[disabled] {
  background: var(--borda); color: var(--texto-sec); cursor: not-allowed; font-size: 0.9375rem; font-weight: 700;
}
.botao.secundario { background: var(--superficie-alta); color: var(--texto); }
.botao.secundario:hover { background: var(--borda); color: var(--texto); }
.botao.perigo { background: transparent; border: 2px solid #5A2323; color: var(--erro); }
.botao.contorno-atencao {
  min-height: 48px; background: transparent; border: 2px solid var(--atencao); color: var(--atencao);
  border-radius: var(--raio-campo); font-size: 0.9375rem; margin-top: 14px;
}
.link-botao {
  display: flex; align-items: center; justify-content: center; min-height: 50px;
  color: var(--texto-sec); font-size: 0.9375rem; font-weight: 700; text-decoration: none;
  background: none; border: none; width: 100%;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--borda); color: var(--texto);
}
.badge.sucesso { background: var(--sucesso-fundo); color: var(--sucesso); }
.badge.atencao { background: var(--atencao-fundo); color: var(--atencao); }
.badge.erro    { background: #3A1818; color: var(--erro); }
.badge.acento  { background: var(--acento-fundo); color: var(--acento); font-style: normal; }

.mensagem { padding: 12px 14px; border-radius: var(--raio-campo); margin: 12px 0; font-size: 0.9375rem; }
.mensagem.erro { background: #2A1414; color: var(--erro); border: 1px solid var(--erro-borda); }
.mensagem.sucesso { background: var(--sucesso-fundo); color: var(--sucesso); font-weight: 700; }

.footer-simples { color: var(--texto-ter); font-size: 0.75rem; text-align: center; padding: 24px 0; }
.footer-simples a { color: var(--texto-ter); }

/* ───────── Telas do cliente (celular, 390 px de referência) ───────── */
body.cliente .wrapper { padding-bottom: calc(var(--abas-h) + 32px + env(safe-area-inset-bottom)); }
body.cliente.com-total .wrapper { padding-bottom: calc(var(--abas-h) + 120px + env(safe-area-inset-bottom)); }

.saudacao { font-size: 0.875rem; color: var(--texto-sec); margin-bottom: 2px; }
.subtitulo { margin: 10px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--texto-sec); }

/* Barra de abas fixa embaixo */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex;
  height: calc(var(--abas-h) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--superficie);
  border-top: 1px solid var(--borda);
}
.abas a {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--texto-sec); font-size: 0.75rem; font-weight: 600; text-decoration: none;
}
.abas a.ativa { color: var(--acento); font-weight: 700; }
.abas .selo {
  position: absolute; top: 2px; left: calc(50% + 6px);
  background: var(--acento); color: var(--acento-texto);
  font-size: 0.6875rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}

/* Cardápio */
.chips { display: flex; gap: 8px; margin-top: 18px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  height: 44px; padding: 0 16px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--borda); background: var(--superficie);
  color: var(--texto-sec); font-size: 0.875rem; font-weight: 600;
}
.chip[aria-pressed="true"] {
  border-color: var(--acento); background: var(--acento); color: var(--acento-texto); font-weight: 800;
}

.lista-produtos { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.produto {
  display: flex; align-items: center; gap: 14px;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: 18px;
  padding: 10px; color: inherit; text-decoration: none;
}
.produto .foto {
  width: 88px; height: 88px; flex-shrink: 0; border-radius: 14px;
  background: var(--foto); overflow: hidden;
}
.produto .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.produto .info { flex: 1; min-width: 0; }
.produto .nome { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.produto .desc { font-size: 0.8125rem; line-height: 1.35; color: var(--texto-sec); margin-top: 3px; }
.produto .preco { font-size: 1rem; font-weight: 800; color: var(--acento); margin-top: 8px; }
.produto .mais {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 999px;
  background: var(--acento); color: var(--acento-texto);
  display: flex; align-items: center; justify-content: center;
}

/* Item */
.item-foto {
  position: relative; height: 250px; background: var(--foto); overflow: hidden;
}
.item-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-foto .botao-voltar { position: absolute; top: 16px; left: 16px; background: var(--fundo); }
.item-foto .pilula-mesa { position: absolute; top: 16px; right: 16px; }
.item-folha {
  position: relative; margin-top: -28px; min-height: calc(100dvh - 222px);
  background: var(--superficie); border-radius: 28px 28px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
  max-width: 520px; margin-left: auto; margin-right: auto;
}
.item-folha h1 { margin: 10px 0 0; font-size: 1.625rem; }
.item-folha .desc { margin: 6px 0 0; font-size: 0.875rem; line-height: 1.4; color: var(--texto-sec); }
.rotulo { font-size: 0.8125rem; font-weight: 700; color: var(--texto-sec); letter-spacing: 0.04em; text-transform: uppercase; }
.opcoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.opcao {
  height: 56px; border-radius: 14px; border: 2px solid var(--borda);
  background: var(--superficie-alta); color: var(--texto);
  font-size: 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.opcao svg { display: none; }
.opcao[aria-pressed="true"] { border-color: var(--acento); background: var(--acento-fundo); color: var(--acento); font-weight: 800; }
.opcao[aria-pressed="true"] svg { display: block; }
.item-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.item-total .valor { font-size: 1.625rem; font-weight: 800; color: var(--acento); line-height: 1.1; }
.mini-rotulo { font-size: 0.75rem; color: var(--texto-ter); }
.item-folha .fim { margin-top: auto; }
.item-folha .fim .botao { min-height: 58px; margin-top: 0; }

/* Quantidade (− n +) */
.stepper {
  display: flex; align-items: center; gap: 10px;
  background: var(--superficie-alta); border-radius: 999px; padding: 4px 6px;
}
.stepper button {
  width: 44px; height: 44px; border-radius: 999px; border: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--borda); color: var(--texto);
}
.stepper button.mais { background: var(--acento); color: var(--acento-texto); }
.stepper .n { min-width: 20px; text-align: center; font-size: 1.0625rem; font-weight: 800; }

/* Carrinho */
.linhas-carrinho { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.linha-carrinho {
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-card);
  padding: 14px; display: flex; align-items: center; gap: 12px;
}
.linha-carrinho .info { flex: 1; min-width: 0; }
.linha-carrinho .nome { font-size: 0.9375rem; font-weight: 700; line-height: 1.2; }
.linha-carrinho .extras { font-size: 0.8125rem; color: var(--acento); font-weight: 600; margin-top: 3px; }
.linha-carrinho .subtotal { font-size: 0.875rem; font-weight: 800; margin-top: 4px; }
.vazio { margin-top: 24px; text-align: center; color: var(--texto-sec); font-size: 0.9375rem; line-height: 1.5; }
.vazio a { font-weight: 700; text-decoration: none; }
.aviso-tracejado {
  margin-top: 14px; background: var(--superficie); border: 1px dashed var(--borda-forte);
  border-radius: 14px; padding: 12px 14px; font-size: 0.8125rem; line-height: 1.45; color: var(--texto-sec);
}
.barra-total {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--abas-h) + env(safe-area-inset-bottom));
  padding: 12px 20px; background: var(--superficie); border-top: 1px solid var(--borda);
  display: flex; align-items: center; gap: 14px;
}
.barra-total .total { flex: 1; }
.barra-total .valor { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.barra-total .botao { width: auto; margin: 0; padding: 0 36px; }

/* Comanda */
.pedido-card {
  margin-top: 10px; background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio-card); padding: 14px;
}
.pedido-card:first-child { margin-top: 16px; }
.pedido-card.cancelado { opacity: 0.55; }
.pedido-card .cabeca { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pedido-card .quando { font-size: 0.8125rem; color: var(--texto-ter); }
.pedido-card .item {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 10px;
}
.pedido-card .item + .item { padding-top: 10px; border-top: 1px dashed var(--borda); }
.pedido-card .item .nome { font-size: 0.9375rem; font-weight: 700; }
.pedido-card .item .extras { font-size: 0.8125rem; color: var(--texto-sec); margin-top: 2px; }
.pedido-card .item .preco { font-size: 0.875rem; font-weight: 700; color: var(--acento); white-space: nowrap; }
.total-linha { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; }
.total-linha .rot { font-size: 1rem; font-weight: 700; color: var(--texto-sec); }
.total-linha .valor { font-size: 1.75rem; font-weight: 800; color: var(--acento); }
.apoio { margin-top: 8px; text-align: center; font-size: 0.8125rem; color: var(--texto-ter); }

/* Encerrar comanda */
.resumo-comanda {
  margin-top: 16px; background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio-card); padding: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.resumo-comanda .dono { font-size: 0.9375rem; font-weight: 800; }
.resumo-comanda .valor { font-size: 1.875rem; font-weight: 800; color: var(--acento); line-height: 1.1; margin-top: 2px; }
.resumo-comanda .lado { font-size: 0.8125rem; color: var(--texto-sec); text-align: right; line-height: 1.4; }
.nota { margin: 10px 2px 0; font-size: 0.8125rem; line-height: 1.45; color: var(--texto-ter); }
.passos { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.passo { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; line-height: 1.4; }
.passo .num {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  background: var(--acento-fundo); color: var(--acento);
  display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 800;
}
.aviso-atencao {
  margin-top: 22px; background: var(--atencao-fundo); color: var(--atencao);
  border-radius: var(--raio-card); padding: 18px;
}
.aviso-atencao .titulo { font-size: 1.0625rem; font-weight: 800; }
.aviso-atencao .texto { font-size: 0.875rem; line-height: 1.45; margin-top: 6px; }
.aviso-atencao .rodape { font-size: 0.8125rem; line-height: 1.4; margin-top: 8px; text-align: center; }
.aviso-atencao a { color: inherit; font-weight: 800; }
.aviso-sucesso {
  margin-top: 18px; background: var(--sucesso-fundo); color: var(--sucesso);
  border-radius: var(--raio-card); padding: 18px;
}
.aviso-sucesso .titulo { font-size: 1.0625rem; font-weight: 800; }
.aviso-sucesso .texto { font-size: 0.875rem; line-height: 1.45; margin-top: 6px; }
