/* ============================================================
   ALVO FOOD — catálogo da loja
   A cor de destaque vem da configuração da loja (--cor).
   ============================================================ */
:root {
  --cor: #c2410c;
  --cor-texto: #ffffff;
  --cor-10: #fbeee8;
  --cor-20: #f5d7ca;
  --cor-escura: #8f300a;
  --fundo: #fdf8f6;
  --superficie: #ffffff;
  --tinta: #2b2225;
  --suave: #75696c;
  --linha: #ece3e0;
  --ok: #1f7a4d;
  --ok-fundo: #e3f4ea;
  --alerta: #9a5b00;
  --alerta-fundo: #fff3d6;
  --erro: #b42318;
  --erro-fundo: #fde8e6;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --raio: 14px;
  --raio-p: 10px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
*, *::before, *::after { box-sizing: inherit; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--tinta); background: var(--fundo); min-height: 100vh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cor); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Barra superior ---------- */
.topo { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linha); }
.topo-in { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topo-marca { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.topo-marca img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--linha); }
.topo-nome { font-family: var(--serif); font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-voltar { margin-right: auto; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--cor); padding: 6px 4px; }
.topo-acao { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--tinta); border: 1px solid var(--linha); background: var(--superficie); position: relative; }
.topo-acao svg { width: 18px; height: 18px; }
.contador { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cor); color: var(--cor-texto); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Capa da loja ---------- */
.capa { position: relative; max-width: 1040px; margin: 0 auto; }
.capa-banner { height: 190px; background: var(--cor-20) center/cover no-repeat; }
@media (min-width: 720px) { .capa-banner { height: 260px; border-radius: 0 0 var(--raio) var(--raio); } }
.capa-corpo { text-align: center; padding: 0 20px 8px; }
.selo { width: 112px; height: 112px; margin: -56px auto 12px; border-radius: 50%; background: var(--superficie); padding: 5px; box-shadow: 0 0 0 1px var(--linha), 0 10px 24px -12px rgba(43,34,37,.35); position: relative; }
.selo img, .selo span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.selo span { display: flex; align-items: center; justify-content: center; background: var(--cor); color: var(--cor-texto); font-family: var(--serif); font-size: 44px; font-weight: 600; }
.loja-nome { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; letter-spacing: -.01em; font-variation-settings: 'opsz' 72; }
.loja-msg { color: var(--suave); max-width: 46ch; margin: 8px auto 0; }
.loja-estado { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; font-weight: 600; }
.loja-estado::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.loja-estado.fechada::before { background: var(--suave); }
.loja-estado.fechada { color: var(--suave); }

/* ---------- Categorias ---------- */
.cats { position: sticky; top: 56px; z-index: 30; background: var(--fundo); border-bottom: 1px solid var(--linha); }
.cats-in { max-width: 1040px; margin: 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.cats-in::-webkit-scrollbar { display: none; }
.cat { flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--suave); }
.cat[aria-pressed="true"] { background: var(--tinta); color: #fff; }

/* ---------- Grade de produtos ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 120px; }
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 960px) { .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.produto { text-align: left; display: flex; flex-direction: column; background: var(--superficie); border-radius: var(--raio); overflow: hidden; border: 1px solid var(--linha); }
.produto:not([disabled]):active { transform: scale(.98); }
.produto-foto { aspect-ratio: 4/3; background: var(--cor-10); position: relative; overflow: hidden; }
.produto-foto img { width: 100%; height: 100%; object-fit: cover; }
.produto-foto .sem-foto { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 36px; color: var(--cor); }
.produto-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.produto-nome { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.25; }
.produto-desc { font-size: 13px; color: var(--suave); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.produto-preco { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 15px; }
.produto-preco s { color: var(--suave); font-weight: 400; font-size: 13px; margin-right: 4px; }
.produto-preco small { display: block; font-weight: 500; font-size: 12px; color: var(--suave); }
.etiqueta { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--cor-10); color: var(--cor-escura); }
.produto[disabled] { cursor: default; }
.produto[disabled] .produto-foto img { filter: grayscale(1) opacity(.6); }
.produto[disabled] .produto-foto::after { content: 'Esgotado'; position: absolute; left: 10px; top: 10px; background: var(--tinta); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.vazio { text-align: center; padding: 48px 16px; color: var(--suave); }
.vazio strong { display: block; font-family: var(--serif); font-size: 20px; color: var(--tinta); margin-bottom: 6px; }

/* ---------- Informações da loja ---------- */
.info { margin-top: 40px; display: grid; gap: 14px; }
@media (min-width: 720px) { .info { grid-template-columns: 1fr 1fr; } }
.info-bloco { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; }
.info-bloco h2 { font-family: var(--serif); font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.horas { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; font-size: 14px; }
.horas .hoje { font-weight: 700; }
.horas dd { color: var(--suave); }
.horas .hoje + dd { color: var(--tinta); font-weight: 600; }
.info p { font-size: 14px; color: var(--suave); }
.assinatura { text-align: center; font-size: 12px; color: var(--suave); margin-top: 32px; }

/* ---------- Barra do carrinho ---------- */
.barra-carrinho { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--fundo) 60%, transparent); }
.barra-carrinho button { max-width: 560px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: var(--raio); background: var(--cor); color: var(--cor-texto); font-weight: 700; box-shadow: 0 12px 28px -12px var(--cor); }

/* ---------- Folha (modal de baixo para cima) ---------- */
.folha-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(43,34,37,.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .folha-fundo { align-items: center; padding: 24px; } }
.folha { background: var(--superficie); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; position: relative; animation: sobe .22s ease-out; }
@media (min-width: 720px) { .folha { border-radius: 20px; } }
@keyframes sobe { from { transform: translateY(24px); } to { transform: none; } }
.folha-foto { aspect-ratio: 16/10; background: var(--cor-10); }
.folha-foto img { width: 100%; height: 100%; object-fit: cover; }
.folha-corpo { padding: 18px 20px 20px; }
.fechar { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.15); z-index: 2; }
.folha h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.2; }
.folha .desc { color: var(--suave); margin-top: 6px; white-space: pre-line; }
.grupo { margin-top: 20px; }
.grupo-titulo { font-weight: 700; font-size: 15px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.grupo-titulo small { font-weight: 500; color: var(--suave); font-size: 13px; }
.escolhas { display: grid; gap: 8px; }
.escolha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--linha); border-radius: var(--raio-p); text-align: left; width: 100%; background: var(--superficie); }
.escolha[aria-pressed="true"], .escolha[aria-checked="true"] { border-color: var(--cor); background: var(--cor-10); }
.escolha[disabled] { opacity: .45; cursor: not-allowed; }
.escolha strong { font-weight: 600; }
.escolha small { color: var(--suave); font-size: 13px; display: block; }
.escolha .valor { font-weight: 700; white-space: nowrap; }
.aviso { margin-top: 14px; padding: 10px 12px; border-radius: var(--raio-p); background: var(--alerta-fundo); color: var(--alerta); font-size: 14px; }
.aviso.info { background: var(--cor-10); color: var(--cor-escura); }
.aviso.erro { background: var(--erro-fundo); color: var(--erro); }
textarea.campo-texto, input.campo-texto, select.campo-texto { width: 100%; border: 1.5px solid var(--linha); border-radius: var(--raio-p); padding: 12px 14px; background: var(--superficie); font-size: 16px; }
textarea.campo-texto { min-height: 76px; resize: vertical; }
.campo-texto:focus { outline: none; border-color: var(--cor); }
.rodape-folha { position: sticky; bottom: 0; background: var(--superficie); padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linha); display: flex; gap: 12px; align-items: center; }
.qtd { display: inline-flex; align-items: center; border: 1.5px solid var(--linha); border-radius: 999px; }
.qtd button { width: 40px; height: 40px; font-size: 20px; font-weight: 600; color: var(--cor); }
.qtd button[disabled] { color: var(--linha); cursor: not-allowed; }
.qtd span { min-width: 24px; text-align: center; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: var(--raio); font-weight: 700; font-size: 16px; text-decoration: none; }
.btn-principal { background: var(--cor); color: var(--cor-texto); flex: 1; }
.btn-principal[disabled] { opacity: .5; cursor: not-allowed; }
.btn-secundario { border: 1.5px solid var(--linha); background: var(--superficie); color: var(--tinta); }
.btn-whats { background: #1f8f4e; color: #fff; }
.btn-bloco { width: 100%; }
.btn .gira { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Carrinho e finalização ---------- */
.pagina { max-width: 640px; margin: 0 auto; }
.pagina h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; margin-bottom: 16px; }
.secao { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-bottom: 14px; }
.secao h2 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin-bottom: 12px; }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linha); align-items: start; }
.item:first-of-type { border-top: 0; padding-top: 0; }
.item img, .item .sem-foto { width: 64px; height: 64px; border-radius: var(--raio-p); object-fit: cover; background: var(--cor-10); }
.item-nome { font-weight: 600; }
.item-det { font-size: 13px; color: var(--suave); }
.item-dir { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item .qtd button { width: 32px; height: 32px; font-size: 18px; }
.rotulo { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.rotulo:first-child { margin-top: 0; }
.alternar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--fundo); border-radius: var(--raio-p); border: 1px solid var(--linha); }
.alternar button { padding: 10px; border-radius: 8px; font-weight: 600; color: var(--suave); }
.alternar button[aria-pressed="true"] { background: var(--superficie); color: var(--tinta); box-shadow: 0 1px 3px rgba(43,34,37,.15); }
.dias { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.dia { flex-shrink: 0; width: 64px; padding: 8px 4px; border-radius: var(--raio-p); border: 1.5px solid var(--linha); text-align: center; background: var(--superficie); }
.dia small { display: block; font-size: 12px; color: var(--suave); }
.dia strong { display: block; font-size: 20px; font-family: var(--serif); font-weight: 600; }
.dia[aria-pressed="true"] { border-color: var(--cor); background: var(--cor-10); }
.dia[disabled] { opacity: .4; cursor: not-allowed; }
.horarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; }
.hora { padding: 10px 0; border-radius: var(--raio-p); border: 1.5px solid var(--linha); font-weight: 600; background: var(--superficie); }
.hora[aria-pressed="true"] { border-color: var(--cor); background: var(--cor); color: var(--cor-texto); }
.hora[disabled] { text-decoration: line-through; opacity: .4; cursor: not-allowed; }
.contas { display: grid; gap: 6px; font-size: 15px; }
.contas div { display: flex; justify-content: space-between; }
.contas .total { font-weight: 800; font-size: 18px; padding-top: 8px; border-top: 1px solid var(--linha); margin-top: 4px; }
.lembrar { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--suave); margin-top: 12px; }
.lembrar input { width: 18px; height: 18px; accent-color: var(--cor); }

/* ---------- Pedido enviado / Pix ---------- */
.enviado { text-align: center; padding-top: 8px; }
.enviado .marca-ok { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--ok-fundo); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.enviado .codigo { font-family: var(--serif); font-size: 34px; font-weight: 600; letter-spacing: .04em; }
.pix { text-align: center; }
.pix-qr { width: 220px; height: 220px; margin: 8px auto 12px; background: #fff; padding: 8px; border-radius: var(--raio-p); border: 1px solid var(--linha); }
.pix-qr svg, .pix-qr img { width: 100%; height: 100%; }
.pix-codigo { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; word-break: break-all; background: var(--fundo); border: 1px dashed var(--linha); border-radius: var(--raio-p); padding: 10px; text-align: left; max-height: 84px; overflow: auto; }
.acoes-coluna { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- Acompanhamento ---------- */
.linha-tempo { list-style: none; position: relative; margin-top: 4px; }
.linha-tempo li { position: relative; padding: 0 0 18px 34px; color: var(--suave); }
.linha-tempo li::before { content: ''; position: absolute; left: 7px; top: 22px; bottom: -2px; width: 2px; background: var(--linha); }
.linha-tempo li:last-child::before { display: none; }
.linha-tempo .ponto { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--linha); background: var(--superficie); }
.linha-tempo li.feito { color: var(--tinta); }
.linha-tempo li.feito .ponto { border-color: var(--cor); background: var(--cor); }
.linha-tempo li.feito::before { background: var(--cor); }
.linha-tempo li.atual strong { font-size: 17px; }
.linha-tempo li.atual .ponto { box-shadow: 0 0 0 5px var(--cor-20); }
.linha-tempo time { display: block; font-size: 13px; color: var(--suave); }
.estado-pedido { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--cor-10); color: var(--cor-escura); }
.estado-pedido.cancelado { background: var(--erro-fundo); color: var(--erro); }
.estado-pedido.entregue { background: var(--ok-fundo); color: var(--ok); }
.lista-pedidos .pedido-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--linha); text-decoration: none; }
.lista-pedidos .pedido-link:first-child { border-top: 0; }

/* ---------- Aviso rápido ---------- */
.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); animation: sobe .2s ease-out; }
.toast.erro { background: var(--erro); }

/* ---------- Calendário ---------- */
.cal { border: 1px solid var(--linha); border-radius: var(--raio); padding: 10px; background: var(--superficie); }
.cal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-topo strong { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.cal-seta { width: 40px; height: 40px; border-radius: 50%; font-size: 24px; line-height: 1; color: var(--cor); border: 1px solid var(--linha); }
.cal-seta[disabled] { color: var(--linha); cursor: not-allowed; }
.cal-semana, .cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-semana span { font-size: 12px; font-weight: 700; color: var(--suave); padding: 4px 0; }
.cal-dia { aspect-ratio: 1; max-height: 48px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.cal-dia:not([disabled]) { background: var(--cor-10); color: var(--tinta); }
.cal-dia[disabled] { color: var(--linha); cursor: not-allowed; }
.cal-dia.hoje { text-decoration: underline; text-underline-offset: 3px; }
.cal-dia[aria-pressed="true"] { background: var(--cor); color: var(--cor-texto); }
.cal-escolhido { margin-top: 10px; font-weight: 700; }

/* ---------- Montar quantidades ---------- */
.montar { border-radius: var(--raio-p); background: var(--alerta-fundo); color: var(--alerta); padding: 10px 12px; margin-bottom: 8px; }
.montar.completo { background: var(--ok-fundo); color: var(--ok); }
.montar-texto { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.montar-barra { height: 6px; border-radius: 6px; background: rgba(0,0,0,.08); margin-top: 8px; overflow: hidden; }
.montar-barra span { display: block; height: 100%; background: currentColor; transition: width .15s; }
.opcoes-qtd { display: grid; gap: 6px; }
.opcao-qtd { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--linha); border-radius: var(--raio-p); }
.opcao-qtd.ativa { border-color: var(--cor); background: var(--cor-10); }
.opcao-qtd small { display: block; font-size: 12px; color: var(--suave); }
.opcao-qtd .qtd button { width: 36px; height: 36px; }
.opcao-qtd .qtd span { min-width: 34px; }
