/* ================== Base ================== */
:root {
  --destaque: #F5C400;
  --preto: #0e0e0e;
  --texto: #1d1d1f;
  --suave: #6b6b70;
  --fundo: #f6f5f2;
  --linha: #e6e4de;
  --verde: #1fa855;
  --raio: 16px;
  --fonte-titulo: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fonte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fonte); color: var(--texto); background: var(--fundo);
  line-height: 1.45; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.oculto { display: none !important; }
.icone { width: 1.15em; height: 1.15em; flex: none; }

/* ================== Topo ================== */
.topo {
  position: sticky; top: 0; z-index: 20; background: var(--preto); color: #fff;
  padding: 14px 16px 12px;
}
.topo-linha { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.marca-loja { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.marca-loja img { height: 40px; width: auto; }
.marca-loja .nome {
  font-family: var(--fonte-titulo); font-weight: 700; font-size: 1.25rem; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.marca-loja .nome b { color: var(--destaque); font-weight: 700; }
.slogan { font-size: .78rem; color: #b9b9b9; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.busca input {
  width: 100%; border: 0; border-radius: 999px; padding: 11px 16px 11px 42px; background: #fff; color: var(--texto);
  outline: 2px solid transparent; transition: outline-color .15s;
}
.busca input:focus { outline-color: var(--destaque); }
.busca .icone { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #888; }

/* Abas de marcas */
.marcas {
  position: sticky; top: 68px; z-index: 15; background: var(--fundo);
  border-bottom: 1px solid var(--linha);
}
.marcas-rolagem {
  max-width: 1180px; margin: 0 auto; display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.marcas-rolagem::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--linha); background: #fff; border-radius: 999px;
  padding: 8px 14px; font-size: .9rem; font-weight: 500; white-space: nowrap; transition: all .15s;
}
.chip small { color: var(--suave); font-weight: 400; margin-left: 4px; }
.chip:hover { border-color: var(--destaque); }
.chip.ativo { background: var(--preto); color: #fff; border-color: var(--preto); }
.chip.ativo small { color: var(--destaque); }

/* ================== Conteúdo ================== */
main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 110px; }
.secao { margin-top: 22px; }
.secao-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.secao h2 {
  font-family: var(--fonte-titulo); font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 10px;
}
.secao h2::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: var(--destaque); }
.secao h2 small { font-family: var(--fonte); font-size: .85rem; color: var(--suave); font-weight: 400; }
.link-ver { background: none; border: 0; color: var(--texto); font-weight: 600; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
@media (min-width: 720px) { .grade { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; } }

.card {
  background: #fff; border: 1.5px solid color-mix(in srgb, var(--destaque) 70%, #fff);
  border-radius: var(--raio); padding: 12px; display: flex; flex-direction: column; position: relative;
  transition: transform .15s, box-shadow .15s; cursor: pointer;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0,0,0,.35); }
.card .foto { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #fafafa; }
.card .foto img { width: 100%; height: 100%; object-fit: contain; }
.card .info { padding: 10px 2px 0; display: flex; flex-direction: column; flex: 1; }
.card .marca { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
.card h3 { font-size: 1rem; margin: 3px 0 2px; line-height: 1.25; font-weight: 600; }
.card .tam { font-size: .82rem; color: var(--suave); }
.card .preco {
  margin: 10px 0 12px; align-self: flex-start; background: #f0efea; border-radius: 10px; padding: 5px 10px;
  font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.card .acoes { margin-top: auto; }
.selo {
  position: absolute; top: 18px; left: 18px; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 4px 8px; border-radius: 6px; background: var(--preto); color: var(--destaque);
}
.selo.esgotado { background: #fff; color: #b3261e; border: 1px solid #f0c8c5; }
.card.indisponivel .foto img { filter: grayscale(1); opacity: .55; }

.btn-zap {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--preto); color: var(--destaque); border: 0; border-radius: 12px; padding: 11px 12px;
  font-weight: 700; font-size: .92rem; text-decoration: none; transition: filter .15s;
}
.btn-zap:hover { filter: brightness(1.25); }
.btn-zap.aviso { background: #fff; color: var(--texto); border: 1.5px solid var(--linha); font-weight: 600; }

.vazio { text-align: center; padding: 60px 20px; color: var(--suave); }
.vazio strong { display: block; color: var(--texto); font-size: 1.1rem; margin-bottom: 6px; }
.carregando { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 22px; }
.carregando div { aspect-ratio: .62; border-radius: var(--raio); background: linear-gradient(90deg,#eee,#f7f7f7,#eee); background-size: 200% 100%; animation: brilho 1.2s infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

/* Botão flutuante */
.zap-flutuante {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 58px; height: 58px; border-radius: 50%;
  background: var(--verde); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px -6px rgba(0,0,0,.45);
}
.zap-flutuante .icone { width: 30px; height: 30px; }

/* Rodapé */
.rodape { background: var(--preto); color: #aaa; text-align: center; padding: 26px 16px 90px; font-size: .85rem; }
.rodape a { color: var(--destaque); text-decoration: none; }
.rodape p { margin: 4px 0; }

/* ================== Janela do produto ================== */
dialog {
  border: 0; padding: 0; border-radius: 20px; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal-prod { display: grid; grid-template-columns: 1fr; }
@media (min-width: 680px) { .modal-prod { grid-template-columns: 1fr 1fr; } }
.modal-prod .foto { background: #fafafa; aspect-ratio: 1; }
.modal-prod .foto img { width: 100%; height: 100%; object-fit: contain; }
.modal-prod .corpo { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.modal-prod .marca { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
.modal-prod h2 { font-family: var(--fonte-titulo); margin: 0; font-size: 1.5rem; line-height: 1.2; }
.modal-prod .tam { color: var(--suave); }
.modal-prod .desc { color: #3a3a3c; white-space: pre-line; }
.modal-prod .preco { font-size: 1.6rem; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.modal-prod .btn-zap { padding: 14px; font-size: 1rem; margin-top: auto; }
.fechar {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); font-size: 1.4rem; line-height: 1; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 2;
}

.aviso-demo {
  background: #fff7d6; color: #5c4a00; border-bottom: 1px solid #f0dc8a; font-size: .85rem; text-align: center; padding: 8px 14px;
}

@media (max-width: 560px) {
  .topo-linha { flex-wrap: wrap; gap: 10px; }
  .busca { flex-basis: 100%; max-width: none; }
  .marcas { top: 114px; }
  .slogan { display: none; }
  .card { padding: 9px; }
  .card h3 { font-size: .93rem; }
  .btn-zap { font-size: .85rem; padding: 10px 8px; }
  .selo { top: 14px; left: 14px; }
}

/* ================== Painel administrativo ================== */
.adm body, body.adm { background: #f2f1ee; }
.adm-topo { background: var(--preto); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 20; }
.adm-topo .topo-linha { justify-content: space-between; }
.adm-topo .nome { font-family: var(--fonte-titulo); font-weight: 700; }
.adm-topo .nome span { color: var(--destaque); font-weight: 500; font-size: .85rem; margin-left: 6px; }
.adm-topo nav { display: flex; gap: 8px; }
.btn {
  border: 1.5px solid var(--linha); background: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--texto);
}
.btn:hover { border-color: #c9c6bd; }
.btn.escuro { background: transparent; color: #fff; border-color: #444; }
.btn.principal { background: var(--destaque); border-color: var(--destaque); color: var(--preto); }
.btn.perigo { color: #b3261e; }
.btn:disabled { opacity: .55; cursor: wait; }

.login {
  max-width: 380px; margin: 10vh auto 0; background: #fff; border-radius: 20px; padding: 28px;
  box-shadow: 0 20px 50px -25px rgba(0,0,0,.35);
}
.login h1 { font-family: var(--fonte-titulo); margin: 0 0 4px; font-size: 1.5rem; }
.login p { margin: 0 0 18px; color: var(--suave); font-size: .9rem; }

.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.campo label { font-weight: 600; font-size: .85rem; }
.campo input, .campo textarea, .campo select {
  border: 1.5px solid var(--linha); border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%;
}
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--preto); }
.campo .dica { font-size: .78rem; color: var(--suave); }
.linha-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--linha); border-radius: 10px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.check input { width: 20px; height: 20px; accent-color: var(--preto); }
.check span small { display: block; color: var(--suave); font-size: .78rem; }
.erro { color: #b3261e; font-size: .88rem; min-height: 1.2em; margin: 4px 0 10px; }

.adm-main { max-width: 980px; margin: 0 auto; padding: 18px 16px 80px; }
.resumo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.resumo div { background: #fff; border-radius: 14px; padding: 12px 14px; }
.resumo b { display: block; font-size: 1.5rem; font-family: var(--fonte-titulo); }
.resumo span { font-size: .8rem; color: var(--suave); }
.barra { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.barra input, .barra select { flex: 1; min-width: 160px; border: 1.5px solid var(--linha); border-radius: 10px; padding: 10px 12px; background: #fff; }

.lista-adm { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: #fff; border-radius: 14px; padding: 10px; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
}
.item img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fafafa; }
.item .t { font-weight: 600; line-height: 1.25; }
.item .s { font-size: .82rem; color: var(--suave); }
.item .botoes { display: flex; gap: 6px; align-items: center; }
.item.off img { filter: grayscale(1); opacity: .6; }
.interruptor { position: relative; display: block; width: 46px; height: 26px; flex: none; }
.interruptor input { opacity: 0; width: 0; height: 0; position: absolute; }
.interruptor span { position: absolute; inset: 0; background: #d5d3cc; border-radius: 99px; transition: .2s; cursor: pointer; }
.interruptor span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.interruptor input:checked + span { background: var(--verde); }
.interruptor input:checked + span::after { transform: translateX(20px); }
.rotulo-int { font-size: .7rem; color: var(--suave); text-align: center; }

.form-prod { padding: 22px; }
.form-prod h2 { font-family: var(--fonte-titulo); margin: 0 0 16px; }
.foto-escolha { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.foto-escolha img { width: 110px; height: 110px; object-fit: contain; border-radius: 12px; background: #fafafa; border: 1.5px dashed var(--linha); }
.rodape-form { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; position: sticky; bottom: -22px; background: #fff; padding: 12px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 99;
  background: var(--preto); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; transition: .25s; pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast.mostrar { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .item { grid-template-columns: 52px 1fr; }
  .item img { width: 52px; height: 52px; }
  .item .botoes { grid-column: 1 / -1; justify-content: flex-end; }
  .linha-2 { grid-template-columns: 1fr; gap: 0; }
  .adm-topo .nome span { display: none; }
}
