:root {
  --azul: #273C8F;
  --azul-escuro: #1B2A66;
  --azul-logo: #323E92;
  --laranja: #F58124;
  --fundo: #F5F3EF;
  --branco: #FFFFFF;
  --texto: #1A1F33;
  --suave: #5A6078;
  --linha: #E3DED5;
  --verde: #1FA855;
  --raio: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--fundo); color: var(--texto); font-size: 16px; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
#app { max-width: 560px; margin: 0 auto; min-height: 100%; background: var(--fundo); position: relative; padding-bottom: 84px; }

/* topo */
.topo { background: var(--azul-logo); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 16px 14px; position: sticky; top: 0; z-index: 5; }
.topo .linha1 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topo img.logo { height: 44px; width: auto; }
.topo h1 { font-size: 20px; margin: 0; font-weight: 700; }
.topo .ola { font-size: 13px; color: #C9D2F0; text-align: right; }
.busca { margin-top: 12px; display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 10px 12px; }
.busca input { border: 0; outline: 0; flex: 1; font-size: 16px; background: transparent; color: var(--texto); }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 16px; padding: 4px 0; }

/* chips de linha */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--linha); font-weight: 600; font-size: 14px; color: var(--suave); }
.chip.ativo { background: var(--azul); border-color: var(--azul); color: #fff; }

/* grade de produtos */
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px 16px; }
.card { background: #fff; border-radius: var(--raio); overflow: hidden; text-align: left; box-shadow: 0 2px 10px rgba(27,42,102,.06); display: flex; flex-direction: column; }
.card .foto { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; }
.card .foto img { width: 100%; height: 100%; object-fit: cover; }
.card .info { padding: 10px 12px 12px; }
.card .nome { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--azul-escuro); }
.card .sub { font-size: 12px; color: var(--suave); margin-top: 4px; }
.titulo-sec { padding: 18px 16px 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--laranja); text-transform: uppercase; }
.vazio { padding: 48px 24px; text-align: center; color: var(--suave); }

/* produto */
.galeria { background: #fff; position: relative; }
.galeria .trilho { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.galeria .trilho::-webkit-scrollbar { display: none; }
.galeria .trilho img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: center; }
.galeria .pontos { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.galeria .pontos span { width: 7px; height: 7px; border-radius: 50%; background: rgba(27,42,102,.25); }
.galeria .pontos span.on { background: var(--azul); }
.detalhe { padding: 16px; }
.detalhe h2 { margin: 0; font-size: 22px; color: var(--azul-escuro); line-height: 1.2; }
.detalhe .linha-prod { font-size: 13px; color: var(--laranja); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.rotulo { font-size: 13px; font-weight: 700; color: var(--suave); margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.cores { display: flex; flex-wrap: wrap; gap: 8px; }
.cor { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--linha); font-weight: 600; font-size: 14px; }
.cor.ativo { border-color: var(--azul); color: var(--azul); background: #EEF1FB; }
.itens { background: #fff; border-radius: var(--raio); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--linha); }
.item:first-child { border-top: 0; }
.item .dados { flex: 1; min-width: 0; }
.item .tam { font-weight: 700; color: var(--azul-escuro); }
.item .meta { font-size: 13px; color: var(--suave); margin-top: 2px; }
.qtd { display: flex; align-items: center; border: 1.5px solid var(--linha); border-radius: 12px; overflow: hidden; background: #fff; }
.qtd button { width: 38px; height: 40px; font-size: 20px; font-weight: 600; color: var(--azul); }
.qtd input { width: 46px; height: 40px; border: 0; text-align: center; font-weight: 700; font-size: 16px; outline: 0; -moz-appearance: textfield; }
.qtd input::-webkit-outer-spin-button, .qtd input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.barra-acao { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -4px 20px rgba(27,42,102,.1); }
.barra-acao .dentro { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn { flex: 1; padding: 15px 18px; border-radius: 14px; font-weight: 700; font-size: 16px; background: var(--azul); color: #fff; text-align: center; }
.btn.laranja { background: var(--laranja); color: #1A1F33; }
.btn.verde { background: var(--verde); }
.btn.claro { background: #EEF1FB; color: var(--azul); }
.btn:disabled { opacity: .45; }

/* carrinho */
.lista { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.linha-car { background: #fff; border-radius: var(--raio); padding: 12px; display: flex; gap: 12px; align-items: center; }
.linha-car img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.linha-car .dados { flex: 1; min-width: 0; }
.linha-car .nome { font-weight: 700; font-size: 14px; color: var(--azul-escuro); }
.linha-car .meta { font-size: 13px; color: var(--suave); margin-top: 2px; }
.resumo { margin: 4px 16px 0; background: #fff; border-radius: var(--raio); padding: 14px 16px; display: flex; justify-content: space-between; font-weight: 700; }
.obs { margin: 12px 16px 0; }
.obs textarea { width: 100%; min-height: 70px; border: 1.5px solid var(--linha); border-radius: 12px; padding: 10px 12px; font-size: 15px; resize: vertical; background: #fff; }

/* formulario */
.form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.campo label { display: block; font-size: 13px; font-weight: 700; color: var(--suave); margin-bottom: 6px; }
.campo input { width: 100%; padding: 13px 14px; border: 1.5px solid var(--linha); border-radius: 12px; font-size: 16px; background: #fff; outline: 0; }
.campo input:focus { border-color: var(--azul); }
.tipo-doc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipo-doc button { padding: 12px 8px; border-radius: 12px; border: 1.5px solid var(--linha); background: #fff; font-weight: 600; font-size: 14px; color: var(--suave); }
.tipo-doc button.ativo { border-color: var(--azul); background: #EEF1FB; color: var(--azul); }
.campo .erro { color: #B42318; font-size: 13px; margin-top: 4px; }
.boas-vindas { background: var(--azul-logo); color: #fff; padding: calc(32px + env(safe-area-inset-top)) 24px 28px; text-align: center; }
.boas-vindas img { height: 92px; margin: 0 auto 16px; }
.boas-vindas h1 { font-size: 22px; margin: 0 0 6px; }
.boas-vindas p { margin: 0; color: #C9D2F0; font-size: 15px; line-height: 1.4; }
.perfil-topo { display: flex; align-items: center; gap: 14px; padding: 16px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: #DCE2F5; display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 700; color: var(--azul); font-size: 26px; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* pedidos */
.pedido { background: #fff; border-radius: var(--raio); padding: 14px 16px; }
.pedido .data { font-size: 13px; color: var(--suave); }
.pedido .tot { font-weight: 700; color: var(--azul-escuro); margin-top: 4px; }
.pedido .acoes { display: flex; gap: 8px; margin-top: 10px; }
.pedido .acoes .btn { padding: 10px; font-size: 14px; }

/* menu inferior */
.menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: #fff; border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom); }
.menu .dentro { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.menu button { padding: 9px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--suave); position: relative; }
.menu button.ativo { color: var(--azul); }
.menu svg { width: 24px; height: 24px; }
.menu .selo { position: absolute; top: 4px; left: 50%; margin-left: 6px; background: var(--laranja); color: #1A1F33; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); background: var(--texto); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; max-width: 90%; text-align: center; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.preco-lin { font-size: 14px; color: var(--azul-escuro); margin-top: 3px; }
.resumo.total-valor { margin-top: 8px; font-size: 18px; color: var(--azul-escuro); }
.vend-info { margin: 10px 16px 0; font-size: 14px; color: var(--suave); }

/* cadastro: aviso da Receita e campos preenchidos sozinhos */
.dica-doc { font-size: 13px; margin-top: 6px; line-height: 1.4; color: #5A6078; }
.dica-doc:empty { display: none; }
.dica-doc .ok { color: #1B6E3C; font-weight: 600; }
.dica-doc .ruim { color: #B42318; font-weight: 600; }
.dica-doc .fraco { color: #5A6078; }
.campo input.auto { background: #FFF6EE; border-color: #F58124; transition: background .6s, border-color .6s; }
