:root {
  --bg: #16110e;
  --bg2: #211914;
  --card: #2a201a;
  --linha: #3d2f26;
  --txt: #f6eee6;
  --mudo: #b8a596;
  --amarelo: #ffb627;
  --vermelho: #e4572e;
  --verde: #3fb67b;
  --raio: 16px;
  --display: "Archivo Black", Impact, sans-serif;
  --corpo: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 16px/1.45 var(--corpo); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amarelo); }
[hidden] { display: none !important; }
.mudo { color: var(--mudo); }
.pequeno { font-size: .85rem; }
.erro { color: #ff8a6b; min-height: 1em; margin: .3rem 0; font-size: .9rem; }

/* ---------- topo ---------- */
.topo { position: sticky; top: 0; z-index: 20; background: rgba(22,17,14,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linha); padding-top: env(safe-area-inset-top); }
.topo-in { max-width: 1100px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--txt); }
.marca img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--amarelo); }
.marca-txt { font-family: var(--display); text-transform: uppercase; line-height: .95; font-size: 1rem; letter-spacing: .02em; }
.topo-acoes { display: flex; gap: .5rem; }
.btn-fantasma { display: inline-flex; align-items: center; gap: .4rem; background: transparent; border: 1px solid var(--linha); border-radius: 999px; padding: .45rem .9rem; cursor: pointer; text-decoration: none; color: var(--txt); font-weight: 500; }
.btn-fantasma:hover { border-color: var(--amarelo); }

/* ---------- hero ---------- */
.hero { background:
  radial-gradient(circle at 85% 20%, rgba(255,182,39,.25), transparent 45%),
  radial-gradient(circle at 10% 90%, rgba(228,87,46,.25), transparent 40%), var(--bg2);
  border-bottom: 1px solid var(--linha); }
.hero-in { max-width: 1100px; margin: 0 auto; padding: 2.2rem 1rem 2rem; }
.hero h1 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.8rem, 6vw, 3.2rem); line-height: 1; margin: .6rem 0; }
.hero h1 em { font-style: normal; color: var(--amarelo); }
.hero-info { color: var(--mudo); margin: 0; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; background: rgba(63,182,123,.15); color: var(--verde); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.fechado { background: rgba(228,87,46,.15); color: var(--vermelho); }

/* ---------- abas de categoria ---------- */
.abas { position: sticky; top: calc(67px + env(safe-area-inset-top)); z-index: 15; background: var(--bg); border-bottom: 1px solid var(--linha); display: flex; gap: .4rem; overflow-x: auto; padding: .6rem max(1rem, calc((100vw - 1100px)/2 + 1rem)); scrollbar-width: none; }
.abas::-webkit-scrollbar { display: none; }
.abas a { flex: none; text-decoration: none; color: var(--mudo); border: 1px solid var(--linha); border-radius: 999px; padding: .35rem .9rem; font-weight: 500; white-space: nowrap; }
.abas a.ativo, .abas a:hover { color: var(--bg); background: var(--amarelo); border-color: var(--amarelo); }

/* ---------- cardápio ---------- */
.cardapio { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 7rem; }
.secao h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 1.5rem; margin: 1.6rem 0 .8rem; display: flex; align-items: center; gap: .6rem; }
.secao.promo h2 { color: var(--amarelo); }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.item { display: flex; gap: .9rem; background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio); padding: .8rem; cursor: pointer; text-align: left; width: 100%; transition: transform .12s, border-color .12s; }
.item:hover { border-color: var(--amarelo); transform: translateY(-2px); }
.item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.item p { margin: 0; color: var(--mudo); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .preco { margin-top: auto; padding-top: .5rem; font-weight: 700; font-size: 1.1rem; color: var(--amarelo); display: flex; align-items: center; gap: .5rem; }
.item-img { width: 96px; height: 96px; flex: none; border-radius: 12px; object-fit: cover; background: var(--bg2); }
.item-img.vazio { display: grid; place-items: center; font-size: 2.4rem; }
.selo { background: var(--vermelho); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .05em; padding: .15rem .5rem; border-radius: 6px; text-transform: uppercase; }
.vazio-msg { text-align: center; color: var(--mudo); padding: 3rem 1rem; }

/* ---------- barra da sacola ---------- */
.barra-carrinho { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(1rem + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 2rem)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--amarelo); color: var(--bg); border: 0; border-radius: 14px; padding: .95rem 1.1rem; font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.bc-qtd { background: var(--bg); color: var(--amarelo); border-radius: 8px; min-width: 28px; padding: .1rem .45rem; text-align: center; }

/* ---------- botões & formulários ---------- */
.btn { background: var(--amarelo); color: var(--bg); border: 0; border-radius: 12px; padding: .85rem 1.2rem; font-weight: 700; cursor: pointer; width: 100%; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sec { background: transparent; color: var(--txt); border: 1px solid var(--linha); border-radius: 10px; padding: .55rem .9rem; cursor: pointer; font-weight: 500; }
.btn-sec:hover { border-color: var(--amarelo); }
.btn-perigo { color: #ff8a6b; }
.link { background: none; border: 0; color: var(--amarelo); cursor: pointer; padding: 0; text-decoration: underline; }
label { display: block; font-size: .88rem; color: var(--mudo); margin-bottom: .75rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea { display: block; width: 100%; margin-top: .3rem; background: var(--bg); border: 1px solid var(--linha); border-radius: 10px; padding: .7rem .8rem; color: var(--txt); font-size: 1rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--amarelo); outline-offset: -1px; }
textarea { resize: vertical; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .7rem; }
.tres { display: grid; grid-template-columns: 2fr 1fr; gap: 0 .7rem; }
fieldset { border: 1px solid var(--linha); border-radius: 12px; padding: .8rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; font-weight: 700; }
.opcoes { display: grid; gap: .45rem; }
.opcao { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--linha); border-radius: 10px; padding: .65rem .8rem; cursor: pointer; color: var(--txt); margin: 0; font-size: .95rem; }
.opcao:has(input:checked) { border-color: var(--amarelo); background: rgba(255,182,39,.08); }
.opcao input { accent-color: var(--amarelo); width: 18px; height: 18px; }

/* chave liga/desliga */
.chave { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; color: var(--txt); font-size: .95rem; }
.chave input { display: none; }
.chave span { width: 44px; height: 24px; border-radius: 999px; background: var(--linha); position: relative; transition: .15s; flex: none; }
.chave span::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .15s; }
.chave input:checked + span { background: var(--verde); }
.chave input:checked + span::after { left: 23px; }

/* ---------- modal ---------- */
.fundo { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; }
.modal { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--bg2); border: 1px solid var(--linha); border-radius: 20px; padding: 1.3rem; }
@media (max-width: 600px) {
  .modal { top: auto; bottom: 0; transform: translateX(-50%); width: 100%; border-radius: 20px 20px 0 0; max-height: 92dvh; padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); }
}
.modal-x { position: absolute; right: .8rem; top: .6rem; background: none; border: 0; font-size: 2rem; color: var(--mudo); cursor: pointer; line-height: 1; z-index: 2; }
.modal h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; margin: 0 2rem 1rem 0; font-size: 1.4rem; }
.modal-img { width: calc(100% + 2.6rem); margin: -1.3rem -1.3rem 1rem; height: 220px; object-fit: cover; border-radius: 20px 20px 0 0; }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 12px; }
.qtd button { background: none; border: 0; width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; color: var(--amarelo); }
.qtd span { min-width: 30px; text-align: center; font-weight: 700; }
.linha-acao { display: flex; gap: .8rem; align-items: center; margin-top: 1rem; }
.linha-acao .btn { flex: 1; }

.adicional { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .4rem 0; border-bottom: 1px solid var(--linha); }
.adicional:last-child { border-bottom: 0; }
.adicional .qtd button { width: 36px; height: 36px; }
/* sacola */
.sacola-item { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--linha); }
.sacola-item .si-txt { flex: 1; }
.sacola-item .si-obs { color: var(--mudo); font-size: .85rem; font-style: italic; }
.sacola-item .qtd button { width: 34px; height: 34px; }
.totais { margin: 1rem 0; }
.totais div { display: flex; justify-content: space-between; padding: .2rem 0; color: var(--mudo); }
.totais .total { color: var(--txt); font-weight: 700; font-size: 1.2rem; border-top: 1px solid var(--linha); margin-top: .4rem; padding-top: .6rem; }
.aviso { background: rgba(255,182,39,.1); border: 1px solid rgba(255,182,39,.35); border-radius: 10px; padding: .7rem .8rem; font-size: .9rem; margin-bottom: 1rem; }
.pix-box { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.pix-box code { flex: 1; background: var(--bg); padding: .5rem; border-radius: 8px; overflow-wrap: anywhere; }

/* toast */
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(1rem + env(safe-area-inset-top)); background: var(--txt); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100% - 2rem); }

.rodape { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 8rem; color: var(--mudo); display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9rem; }

/* ---------- painel admin ---------- */
.topo-admin { background: #0e0b09; }
.cartao { background: var(--card); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1.2rem; }
.adm-login { max-width: 420px; margin: 3rem auto; }
.adm-login h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; margin-top: 0; }
.adm-abas { max-width: 1100px; margin: 1rem auto 0; padding: 0 1rem; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.adm-abas::-webkit-scrollbar { display: none; }
.adm-abas button { flex: none; }
.adm-abas button { background: none; border: 1px solid var(--linha); border-radius: 999px; padding: .5rem 1.1rem; cursor: pointer; font-weight: 700; }
.adm-abas button.ativo { background: var(--amarelo); color: var(--bg); border-color: var(--amarelo); }
.pill { background: var(--vermelho); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; margin-left: .2rem; }
.adm-painel { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.impressao-box { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.impressao-box p { margin: .2rem 0 0; max-width: 520px; }
.imp-controles { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.imp-controles select { width: auto; margin: 0; }
.adm-barra { display: flex; gap: .7rem; margin-bottom: 1rem; align-items: center; }
.adm-barra input { margin: 0; }
.adm-barra .btn { width: auto; white-space: nowrap; }
.grade-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.linha-toda { grid-column: 1 / -1; }
.grade-form .chave { margin-bottom: 1rem; }

.pedido { background: var(--card); border: 1px solid var(--linha); border-left: 5px solid var(--linha); border-radius: 14px; padding: 1rem; margin-bottom: .8rem; }
.pedido.novo { border-left-color: var(--vermelho); }
.pedido.preparo { border-left-color: var(--amarelo); }
.pedido.saiu { border-left-color: #4ea8de; }
.pedido.concluido { border-left-color: var(--verde); opacity: .75; }
.pedido.cancelado { opacity: .45; }
.ped-topo { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.ped-topo b { font-size: 1.15rem; }
.ped-corpo { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: .7rem 0; font-size: .93rem; }
.ped-corpo ul { margin: 0; padding-left: 1.1rem; }
.ped-acoes { display: flex; flex-wrap: wrap; gap: .5rem; }
.ped-acoes select { width: auto; margin: 0; padding: .45rem .6rem; }
.alerta-preco { color: #ff8a6b; font-weight: 700; font-size: .88rem; }

.prod-linha { display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--linha); border-radius: 14px; padding: .7rem; margin-bottom: .6rem; }
.prod-linha.inativo { opacity: .5; }
.prod-linha .item-img { width: 64px; height: 64px; font-size: 1.6rem; }
.prod-linha .pl-txt { flex: 1; min-width: 0; }
.prod-linha .pl-txt b { display: block; }
.pl-acoes { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.cat-titulo { font-family: var(--display); font-weight: 400; text-transform: uppercase; color: var(--mudo); margin: 1.4rem 0 .6rem; font-size: 1rem; }
.previa-img { width: 100%; height: 160px; object-fit: cover; border-radius: 12px; margin-top: .4rem; background: var(--bg); }

@media (max-width: 640px) {
  .prod-linha { flex-wrap: wrap; }
  .prod-linha .pl-txt { flex: 1 1 calc(100% - 90px); }
  .pl-acoes { width: 100%; justify-content: stretch; }
  .pl-acoes button { flex: 1; }
  .ped-corpo, .grade-form, .duas { grid-template-columns: 1fr; }
  .grade { grid-template-columns: 1fr; }
  .marca-txt { font-size: .9rem; }
  #btnContaTxt { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- impressão (cupom térmico) ---------- */
#areaImpressao { display: none; }
@media print {
  @page { margin: 0; size: var(--papel, 80mm) auto; }
  body { background: #fff !important; color: #000 !important; }
  body > *:not(#areaImpressao) { display: none !important; }
  #areaImpressao { display: block !important; }
  .cupom { width: var(--papel, 80mm); padding: 3mm 4mm; font: 12px/1.35 "Courier New", monospace; color: #000; }
  .cupom.p58 { font-size: 10.5px; }
  .cupom hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
  .c-centro { text-align: center; }
  .c-grande { font-size: 1.3em; font-weight: 700; }
  .c-num { font-size: 1.6em; font-weight: 700; margin: 1mm 0; }
  .c-tipo { font-weight: 700; border: 1px solid #000; margin-top: 1mm; }
  .c-item { display: flex; justify-content: space-between; gap: 2mm; }
  .c-obs { padding-left: 3mm; font-style: italic; }
  .c-aviso { font-weight: 700; }
  .c-fim { margin-top: 3mm; }
}
