/* Chapa Quente: carrinho, gaveta do pedido e a simulação do WhatsApp da lanchonete. */

/* botões quebram linha se a letra do celular estiver grande, em vez de sair da tela */
.btn { white-space: normal; text-align: center; line-height: 1.15; padding-top: 8px; padding-bottom: 8px; max-width: 100%; }
.btn-nav { white-space: nowrap; flex: none; gap: 8px; }
.btn-linha { background: transparent; color: var(--text-primary); border: 1.5px solid var(--linha-forte); box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .btn-linha:hover { background: #F5EDE314; } }
.btn svg { width: 20px; height: 20px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html:has(dialog[open]) { overflow: hidden; }

/* contador no botão do topo */
.sacola-qtd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ambar); color: var(--canvas); font: 700 12px/1 var(--texto); }
.sacola-qtd[hidden] { display: none; }

/* + em cada item do cardápio */
.grupo li { align-items: center; }
.li-dir { flex: none; display: flex; align-items: center; gap: 10px; }
.add { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 8px 20px -10px #D9381Aaa; transition: transform 160ms var(--suave), background-color 200ms; }
.add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.add:active { transform: scale(.9); }
.add.ok { background: var(--ambar); color: var(--canvas); }
@media (hover: hover) and (pointer: fine) { .add:hover { background: var(--accent-hover); } }
@media (max-width: 420px) { .li-dir { flex-direction: column-reverse; align-items: flex-end; gap: 8px; } }

/* combo: o botão aparece depois de esquentar a chapa */
.combo-add { margin-top: 28px; visibility: hidden; opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--suave), transform 600ms var(--suave), visibility 0s 600ms; }
.amanhecer.feito .combo-add { visibility: visible; opacity: 1; transform: none; transition: opacity 600ms var(--suave) 900ms, transform 600ms var(--suave) 900ms, visibility 0s 900ms; }

/* barra do pedido, acima da faixa da demonstração */
.sacola-barra { position: fixed; z-index: 85; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(520px, calc(100% - 24px)); }
.sacola-barra[hidden] { display: none; }
.sacola-barra button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px 8px 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px/1.2 var(--texto); cursor: pointer; box-shadow: 0 16px 40px -12px #000, 0 0 0 1px #FF8A6A55 inset; text-align: left; }
.sb-total { font-weight: 700; }
.sb-qtd { opacity: .9; }
.sb-ver { margin-left: auto; padding: 12px 18px; border-radius: 999px; background: #fff; color: var(--accent); font-weight: 700; white-space: nowrap; }
.sacola-barra.pulsa { animation: pulsa 500ms var(--suave); }
@keyframes pulsa { 40% { transform: translateX(-50%) scale(1.04); } }

/* janelas */
dialog { padding: 0; border: 0; color: var(--text-primary); background: var(--canvas); max-width: 100%; max-height: 100%; }
dialog::backdrop { background: rgb(6 4 3 / .72); backdrop-filter: blur(4px); }
.fechar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linha-forte); background: var(--panel); color: var(--text-primary); cursor: pointer; }
.fechar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* gaveta do pedido: lateral no computador, de baixo para cima no celular */
.sacola { margin: 0 0 0 auto; height: 100dvh; width: min(460px, 100%); border-left: 1px solid var(--linha); }
.sacola[open] { animation: entraLado 420ms var(--suave); }
@keyframes entraLado { from { transform: translateX(40px); opacity: 0; } }
.sac-in { display: flex; flex-direction: column; height: 100%; }
.sac-cab { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--linha); }
.sac-cab h2 { font-size: 2rem; }
.sac-corpo { flex: 1; overflow: auto; padding: 8px 20px 20px; overscroll-behavior: contain; }
.sac-lista { list-style: none; }
.sac-lista li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--linha-forte); }
.sl-nome b { display: block; font-weight: 700; }
.sl-nome span { color: var(--text-secondary); font-size: .9rem; }
.sl-qtd { display: flex; align-items: center; gap: 4px; grid-row: span 2; }
.sl-qtd button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linha-forte); background: var(--panel-2); color: var(--text-primary); cursor: pointer; }
.sl-qtd button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sl-qtd output { min-width: 26px; text-align: center; font: 700 16px/1 var(--texto); }
.sac-lista em { font: 400 14px/1 var(--mono); font-style: normal; color: var(--ambar); }
.sac-vazio { display: none; padding: 28px 0; color: var(--text-secondary); }
.sacola.vazia .sac-vazio { display: block; }
.sacola.vazia .sac-dados, .sacola.vazia .sac-pe { display: none; }
.sac-dados { display: grid; gap: 16px; margin-top: 22px; }
.sac-receber { border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sac-receber legend { margin-bottom: 10px; font-weight: 700; }
.sac-receber label { position: relative; cursor: pointer; }
.sac-receber input { position: absolute; opacity: 0; }
.sac-receber span { display: flex; flex-direction: column; justify-content: center; min-height: 58px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--linha-forte); background: var(--panel); font-weight: 600; line-height: 1.25; }
.sac-receber small { color: var(--text-secondary); font-weight: 400; }
.sac-receber input:checked + span { border-color: var(--ambar); background: #F2A33C1A; }
.sac-receber input:focus-visible + span { outline: 2px solid var(--ambar); outline-offset: 2px; }
.campo { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; }
.campo small { color: var(--text-secondary); font-weight: 400; }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--linha-forte); background: var(--panel); color: var(--text-primary); font: 400 16px/1.3 var(--texto); }
.campo textarea { resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--ambar); }
.sacola.retirada .campo-end, .sacola.retirada .c-taxa { display: none; }
.sac-pe { padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linha); background: var(--panel); }
.sac-contas div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text-secondary); }
.sac-contas .c-tot { color: var(--text-primary); font-weight: 700; font-size: 1.15rem; padding-top: 8px; }
.sac-contas dd { font-family: var(--mono); }
.sac-pe .fazer { width: 100%; margin-top: 14px; }
.sac-pe .fazer:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 760px) {
  .sacola { margin: auto 0 0; width: 100%; height: auto; max-height: 92dvh; border-left: 0; border-radius: 24px 24px 0 0; }
  .sacola[open] { animation: entraBaixo 420ms var(--suave); }
  .sac-in { height: auto; max-height: 92dvh; }
}
@keyframes entraBaixo { from { transform: translateY(60px); opacity: 0; } }

/* simulação do WhatsApp */
.zap { width: min(980px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; border-radius: 28px; border: 1px solid var(--linha); }
.zap[open] { animation: entraZap 450ms var(--suave); }
@keyframes entraZap { from { transform: translateY(20px) scale(.98); opacity: 0; } }
.zap-in { position: relative; display: grid; grid-template-columns: 340px 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; padding: clamp(24px, 4vw, 44px); max-height: calc(100dvh - 32px); overflow: auto; }
.zap-x { position: absolute; right: 16px; top: 16px; z-index: 2; }
.zap-lado .rotulo { margin-bottom: 14px; }
.zap-lado h2 { font-size: clamp(2.2rem, 4vw, 3.2rem); margin-bottom: 16px; }
.zap-lado p:not(.rotulo) { color: var(--text-secondary); font-size: 1.05rem; max-width: 42ch; }
.zap-lado .zap-nota { margin-top: 14px; font-size: .9rem; }
.zap-acoes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.zap-quero { background: #25D366; color: #06331b; box-shadow: 0 12px 30px -12px #25D366aa; }
.zap-quero svg { fill: currentColor; stroke: none; }
@media (hover: hover) and (pointer: fine) { .zap-quero:hover { background: #3AE07A; } }

.zap-cel { display: flex; flex-direction: column; width: 100%; height: 620px; border-radius: 38px; border: 10px solid #050505; background: #EFEAE2; overflow: hidden; box-shadow: 0 30px 70px -20px #000, 0 0 0 1px #F5EDE322; color: #111B21; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.zc-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 18px 2px; background: #008069; color: #fff; font-size: 12px; font-weight: 600; }
.zc-bat { width: 22px; height: 10px; border: 1.5px solid #fff; border-radius: 3px; position: relative; }
.zc-bat::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: #fff; border-radius: 1px; }
.zc-topo { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px 6px; background: #008069; color: #fff; }
.zc-topo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.zc-av { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #DFE5E7; color: #54656F; font-weight: 700; flex: none; }
.zc-quem { display: grid; line-height: 1.2; min-width: 0; }
.zc-nome { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zc-on { font-size: 12.5px; opacity: .85; }
.zc-chat { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 10px 14px; background-color: #EFEAE2; background-image: radial-gradient(#D9D2C7 1px, transparent 1.2px); background-size: 18px 18px; }
.zc-dia { align-self: center; padding: 5px 12px; border-radius: 8px; background: #fff; color: #54656F; font-size: 12px; box-shadow: 0 1px 1px #0B141A1F; text-transform: uppercase; }
.zc-msg { position: relative; max-width: 92%; padding: 8px 10px 20px; border-radius: 0 10px 10px 10px; background: #fff; box-shadow: 0 1px 1px #0B141A26; font-size: 14px; line-height: 1.42; animation: chega 320ms var(--suave); }
.zc-msg::before { content: ""; position: absolute; left: -8px; top: 0; border: 8px solid transparent; border-top-color: #fff; border-right-color: #fff; border-width: 0 8px 10px 0; }
.zc-msg[hidden], .zc-digitando[hidden] { display: none; }
.zc-txt b { font-weight: 700; }
.zc-h { position: absolute; right: 10px; bottom: 5px; font-size: 11px; color: #667781; }
@keyframes chega { from { transform: translateY(8px); opacity: 0; } }
.zc-digitando { display: flex; gap: 4px; padding: 12px 14px; border-radius: 0 10px 10px 10px; background: #fff; box-shadow: 0 1px 1px #0B141A26; }
.zc-digitando i { width: 7px; height: 7px; border-radius: 50%; background: #8696A0; animation: pula 1s infinite ease-in-out; }
.zc-digitando i:nth-child(2) { animation-delay: .15s; } .zc-digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes pula { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.zc-base { display: flex; align-items: center; gap: 8px; padding: 8px; background: #EFEAE2; }
.zc-campo { flex: 1; padding: 11px 16px; border-radius: 999px; background: #fff; color: #8696A0; font-size: 14px; }
.zc-mic { width: 42px; height: 42px; border-radius: 50%; background: #00A884; flex: none; }

@media (max-width: 760px) {
  .zap { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .zap-in { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 64px 16px 0; height: 100dvh; max-height: 100dvh; }
  .zap-x { position: fixed; right: 12px; top: 12px; }
  .zap-cel { width: min(340px, 100%); height: min(520px, 62dvh); margin: 0 auto; flex: none; }
  .zap-lado h2 { font-size: 2.1rem; }
  .zap-acoes { position: sticky; bottom: 0; margin: 20px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--canvas) 70%, transparent); }
  .zap-acoes .btn { flex: 1 1 100%; }
}
