/* Estilos próprios do Mercadinho (o resto vem de styles.css, copiado do ESTOQUE). */
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.linha input, .linha select { flex: 1 1 140px; min-height: 44px; font-size: 16px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-card); color: var(--text-primary); }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-card); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; }
.item.ok .nome { text-decoration: line-through; color: var(--text-muted); }
.item .nome { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item .sub-txt { display: block; font-size: 12px; color: var(--text-muted); }
.item input[type=checkbox] { width: 22px; height: 22px; }
#mapa-box { height: 60vh; min-height: 320px; border-radius: 12px; border: 1px solid var(--border); }
.vazio { color: var(--text-muted); padding: 16px 4px; }
.prod-box { display: flex; gap: 10px; align-items: center; padding: 8px 12px; margin-bottom: 10px; background: var(--surface-card); border: 1px solid var(--border); border-radius: 10px; }
.prod-box img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; }
.prod-box .sub-txt { display: block; font-size: 12px; color: var(--text-muted); }
h3.sec { font-size: 14px; margin: 18px 0 8px; color: var(--text-secondary); }
#m-mapa { height: 38vh; min-height: 220px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
button.item.mkt { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.item.mkt:hover { border-color: var(--brand); }
dialog.modal-mercado { width: min(640px, calc(100vw - 16px)); }
.cheio { width: 100%; min-height: 44px; font-size: 16px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-card); color: var(--text-primary); }
.evo { align-items: flex-start; }
.evo-linha { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; border-top: 1px dashed var(--border); }
.evo-linha:first-of-type { margin-top: 6px; }
.sobe { color: var(--critical); } .desce { color: var(--good-text); }

/* ===== Visual de aplicativo ===== */
body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
.app-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: env(safe-area-inset-top) 14px 0; background: var(--surface-1); box-shadow: 0 1px 0 var(--border); }
.app-bar h1 { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; }
.app-bar .page-title { margin: 0 auto 0 8px; font-size: 13px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
body.app main { padding: 12px 12px 24px; max-width: 640px; }
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around; align-items: center; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface-1); border-top: 1px solid var(--border); }
#tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--text-muted); font-size: 11px; font-weight: 500; padding: 4px 0; min-height: 50px; cursor: pointer; }
#tabbar .tab .ic { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .75; }
#tabbar .tab.ativa { color: var(--text-primary); font-weight: 700; }
#tabbar .tab.ativa .ic { filter: none; opacity: 1; }
#tabbar .tab.fab { flex: 0 0 56px; height: 56px; min-height: 56px; margin: -22px 6px 0; border-radius: 50%; background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-2); justify-content: center; }
#tabbar .tab.fab .ic { font-size: 30px; filter: none; opacity: 1; font-weight: 300; }
#toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 22px; background: var(--text-primary); color: var(--surface-1); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-2); }
.sub.seg { margin-bottom: 12px; }
.centro { justify-content: center; }
.rodape.coluna { flex-direction: column; }
button.acao.grande { width: 100%; min-height: 48px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--text-primary); font-weight: 700; font-size: inherit; cursor: pointer; text-align: left; }
.btn.mini { min-height: 32px; padding: 2px 10px; }
.vazio-tela { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 32px 12px; color: var(--text-secondary); }

/* feed e cartões */
.feed { display: grid; gap: 10px; }
.post { background: var(--surface-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-1); }
.post-topo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-quem { flex: 1; min-width: 0; display: grid; }
.post-quem .sub-txt { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; display: grid; place-items: center; cursor: pointer; }
.avatar.grande { width: 56px; height: 56px; font-size: 24px; cursor: default; }
.post-corpo { display: flex; gap: 12px; align-items: center; }
.post-corpo img, .post-img { flex: none; width: 72px; height: 72px; border-radius: 10px; object-fit: contain; background: #fff; }
.vazio-img { display: grid; place-items: center; font-size: 30px; background: var(--surface-2); }
.post-info { display: grid; gap: 2px; min-width: 0; }
.post-prod { overflow-wrap: anywhere; font-size: 14px; }
.post-preco { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); }
.post-nota { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; }
.post-acoes { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.btn.acao-soc { min-height: 38px; padding: 4px 14px; border-radius: 19px; font-size: 13px; }
.btn.acao-soc.on { background: var(--accent-soft); border-color: var(--brand); font-weight: 700; }
.coment { padding: 8px 0; border-bottom: 1px solid var(--border); }
.coment p { margin: 2px 0 0; overflow-wrap: anywhere; }
.coment .link { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.lista-com { max-height: 45vh; overflow-y: auto; margin-bottom: 10px; }
.perfil-topo { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.perfil-topo b { font-size: 18px; }
.perfil-topo .sub-txt { display: block; font-size: 12.5px; color: var(--text-muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stats div { display: grid; text-align: center; padding: 10px 4px; background: var(--surface-card); border: 1px solid var(--border); border-radius: 12px; }
.stats b { font-size: 18px; }
.stats span { font-size: 11px; color: var(--text-muted); }
textarea.cheio { width: 100%; font-size: 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-card); color: var(--text-primary); font-family: inherit; }
dialog.modal { width: min(560px, calc(100vw - 16px)); }

/* maiúsculas, QTD/VALOR, foto, admin */
.maiusculo { text-transform: uppercase; }
.rot { display: block; margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); }
.chk { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; font-size: 13px; color: var(--text-secondary); }
.chk input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.btn.largo { width: 100%; justify-content: flex-start; }
.linha select { flex: 0 0 96px; min-height: 44px; font-size: 16px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-card); color: var(--text-primary); }
.post-preco small { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.caixa-foto { margin-bottom: 14px; padding: 12px; background: var(--surface-card); border: 1px solid var(--border); border-radius: 12px; }
.aviso-banido { padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; background: color-mix(in srgb, var(--critical) 16%, transparent); border: 1px solid var(--critical); font-size: 13px; }
.stats.grade2 { grid-template-columns: repeat(3, 1fr); }
.item.adm { gap: 10px; }
.item.adm.col { flex-direction: column; align-items: stretch; }
.adm-motivo { margin: 4px 0; font-style: italic; }
.adm-conteudo { margin: 4px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); overflow-wrap: anywhere; }
.tag-ban { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--critical); color: #fff; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }

/* escolher mercado: cadastro pelo nome + localização; mensagens de erro visíveis */
.novo-merc { display: grid; gap: 8px; margin: 10px 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.novo-merc .rot { margin: 0; }
.msg.erro { color: var(--critical); font-weight: 600; min-height: 0; margin: 0; }
.msg.erro:empty { display: none; }

/* lista de compras: QTD com PCT / CX / UND */
.qtd-linha { flex-wrap: nowrap; align-items: stretch; }
.stepper { display: flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-card); }
.stepper .btn { border: 0; border-radius: 0; min-width: 44px; font-size: 20px; font-weight: 700; }
.stepper input { width: 56px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; text-align: center; font-size: 18px; font-weight: 700; background: var(--surface-card); color: var(--text-primary); }
.un-botoes { flex: 1; margin: 0; }
.un-botoes button { min-height: 44px; font-weight: 700; letter-spacing: .04em; }
.item .nome.maiusculo { font-weight: 600; font-size: 14px; }
.qtd-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 4px; border-radius: 16px; background: var(--accent-soft); }
.qtd-badge b { min-width: 52px; text-align: center; font-size: 13px; }
.mini-q { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--surface-card); color: var(--text-primary); font-size: 16px; font-weight: 700; cursor: pointer; }
.item.ok .qtd-badge { opacity: .55; }
#lista .msg, #lista .sub-txt, #lista .btn, #lista .vazio { text-transform: uppercase; }

/* lista ligada aos preços */
.resumo-lista { margin: 4px 0 12px; padding: 12px; background: var(--surface-card); border: 1px solid var(--brand); border-radius: 12px; }
.resumo-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-secondary); }
.resumo-topo b { font-size: 22px; letter-spacing: -.01em; color: var(--brand); }
.resumo-lista .rot { margin: 10px 0 4px; }
.preco-linha { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.preco-linha b { color: var(--brand); }
.preco-linha.sem { opacity: .7; }
#lista .resumo-lista, #lista .preco-linha, #lista .evo-linha { text-transform: uppercase; }

/* listas compartilhadas */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; min-height: 40px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-card); color: var(--text-secondary); font-size: 13px; font-weight: 700; letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.chip.ativa { background: var(--accent-soft); border-color: var(--brand); color: var(--text-primary); }
.chip.nova { border-style: dashed; color: var(--brand); }
.qr-box { width: min(260px, 70vw); margin: 4px auto 10px; padding: 8px; background: #fff; border-radius: 12px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.tag-dono { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--brand); color: var(--on-brand); }
.btn.perigo { border-color: var(--critical); color: var(--critical); }
#lista .chip, #lista .tag-dono, #lista .qr-box + p { text-transform: uppercase; }

/* preço por kg/L/un e comparação */
.preco-kg { display: inline-block; align-self: flex-start; margin-top: 3px; padding: 2px 9px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--text-primary); }
.sub-txt.emb { font-weight: 700; letter-spacing: .03em; }
.comp { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 6px; background: var(--surface-card); border: 1px solid var(--border); border-radius: 12px; }
.comp.melhor { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface-card)); }
.comp-info { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.comp-preco { flex: none; display: grid; justify-items: end; line-height: 1.15; }
.comp-preco b { font-size: 18px; letter-spacing: -.01em; }
.comp-preco span { font-size: 11px; color: var(--text-muted); font-weight: 700; margin-top: -2px; }
.comp-preco em { font-style: normal; font-size: 10.5px; font-weight: 800; margin-top: 2px; color: var(--good-text); }
.comp-preco em.mais { color: var(--critical); }
.opcoes { display: grid; gap: 3px; margin-top: 4px; }
.opcao { display: block; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); font-size: 11.5px; font-weight: 500; color: var(--text-secondary); overflow-wrap: anywhere; }
.opcao.melhor { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--text-primary); }
.opcao .kg { color: var(--brand); }
#lista .opcao, #lista .preco-kg { text-transform: uppercase; }
