/* Base comum (vitrine, pedido, painel, admin). Cores em tokens; a vitrine troca o acento pela cor da loja. */
:root {
  --tinta: #16201C;
  --tinta-2: #4A5751;
  --tinta-3: #6B7671;
  --linha: #E3DDD1;
  --linha-2: #EFEAE0;
  --fundo: #FAF8F4;
  --cartao: #FFFFFF;
  --acento: #2F6B52;
  --acento-texto: #FFFFFF;
  --acento-suave: #E6F0EB;
  --brasa: #E9893B;
  --brasa-escura: #A84F15;
  --ok: #1F7A4D;
  --ok-suave: #E3F3EA;
  --aviso: #8A5A00;
  --aviso-suave: #FFF3D6;
  --perigo: #B42318;
  --perigo-suave: #FDECEA;
  --raio: 14px;
  --raio-p: 10px;
  --sombra: 0 1px 2px rgba(22, 32, 28, .06), 0 8px 24px -12px rgba(22, 32, 28, .22);
  --f-texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-titulo: var(--f-texto);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body { margin: 0; font: 16px/1.5 var(--f-texto); color: var(--tinta); background: var(--fundo); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-titulo); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, a, input, select, textarea, label, summary { touch-action: manipulation; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; } /* 16px: iPhone nao da zoom no foco */
:focus-visible { outline: 3px solid var(--brasa); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* botoes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .6em 1.1em;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2;
  background: var(--acento); color: var(--acento-texto); transition: filter .15s, transform .1s; -webkit-user-select: none; user-select: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sec { background: var(--cartao); color: var(--tinta); border-color: var(--linha); }
.btn-perigo { background: var(--cartao); color: var(--perigo); border-color: #F1C4BF; }
.btn-liso { background: transparent; color: var(--tinta); border-color: transparent; padding-inline: .6em; }
.btn-cheio { width: 100%; }
.btn-p { min-height: 36px; padding: .35em .85em; font-size: .9rem; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* formulario */
.campo { display: grid; gap: .35rem; margin-bottom: 1rem; }
.campo > span, .campo legend { font-weight: 600; font-size: .92rem; }
.campo small, .dica { color: var(--tinta-3); font-size: .85rem; }
.entrada { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1px solid #CFC8BA; border-radius: var(--raio-p); background: #fff; }
.entrada:focus { border-color: var(--acento); outline: 3px solid color-mix(in srgb, var(--acento) 30%, transparent); outline-offset: 0; }
textarea.entrada { min-height: 84px; resize: vertical; }
.erro-campo { color: var(--perigo); font-size: .88rem; font-weight: 600; }
.linha { display: flex; gap: .75rem; flex-wrap: wrap; }
.linha > * { flex: 1 1 140px; }

.escolha { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border: 1px solid var(--linha); border-radius: var(--raio-p);
  background: #fff; cursor: pointer; min-height: 52px; }
.escolha:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); box-shadow: inset 0 0 0 1px var(--acento); }
.escolha input[type=radio], .escolha input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--acento); flex: none; margin: 0; }
.escolha .cresce { flex: 1; }
.escolha small { display: block; color: var(--tinta-3); }

.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1rem; }
.selo { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 700; padding: .2em .65em; border-radius: 999px;
  background: var(--linha-2); color: var(--tinta-2); white-space: nowrap; }
.selo-ok { background: var(--ok-suave); color: var(--ok); }
.selo-aviso { background: var(--aviso-suave); color: var(--aviso); }
.selo-perigo { background: var(--perigo-suave); color: var(--perigo); }
.ponto { width: .55em; height: .55em; border-radius: 50%; background: currentColor; display: inline-block; }

.aviso { padding: .8rem 1rem; border-radius: var(--raio-p); background: var(--aviso-suave); color: #5C3D00; font-size: .95rem; }
.aviso-erro { background: var(--perigo-suave); color: #7A1A12; }
.aviso-ok { background: var(--ok-suave); color: #14532F; }

/* dialogo: folha de baixo no celular, janela no centro no PC */
dialog.folha { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 20px 20px 0 0;
  background: var(--cartao); color: var(--tinta); box-shadow: 0 -8px 40px rgba(0, 0, 0, .2); overscroll-behavior: contain; }
dialog.folha::backdrop { background: rgba(16, 22, 19, .5); }
dialog.folha[open] { display: flex; flex-direction: column; animation: sobe .22s ease-out; }
.folha-topo { display: flex; align-items: center; gap: .5rem; padding: .75rem .75rem .5rem 1.1rem; border-bottom: 1px solid var(--linha-2); }
.folha-topo h2 { flex: 1; font-size: 1.1rem; }
.folha-corpo { overflow-y: auto; padding: 1rem 1.1rem; flex: 1; -webkit-overflow-scrolling: touch; }
.folha-pe { padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--linha-2); background: var(--cartao); }
.fechar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--linha-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.fechar svg { width: 20px; height: 20px; }
@media (min-width: 720px) {
  dialog.folha { margin: auto; border-radius: 20px; max-height: 88vh; }
  dialog.folha[open] { animation: aparece .18s ease-out; }
}
@keyframes sobe { from { transform: translateY(30px); opacity: .4; } }
@keyframes aparece { from { transform: scale(.97); opacity: 0; } }

.qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 999px; background: #fff; }
.qtd button { width: 44px; height: 44px; border: 0; background: none; font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--acento); border-radius: 50%; }
.qtd button[disabled] { color: var(--linha); cursor: default; }
.qtd output { min-width: 2ch; text-align: center; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: var(--tinta); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; box-shadow: var(--sombra);
  max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
