*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--preto);
  color: var(--branco);
  font-family: var(--fonte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; }

/* ---------- topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--preto);
  border-bottom: 1px solid var(--linha-escura);
  padding: calc(18px + env(safe-area-inset-top)) 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.topo__linha { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.titulo {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}
.logo { width: 132px; height: auto; }

.busca {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--borda-escura);
  border-radius: var(--raio);
  color: var(--apoio-escuro);
}
.busca:focus-within { border-color: var(--branco); }
.busca input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--branco);
  font-size: 16px; /* 16px impede o iPhone de dar zoom ao tocar */
  font-weight: 500;
  outline: none;
}
.busca input::placeholder { color: var(--fraco-escuro); }
.busca input::-webkit-search-cancel-button { filter: invert(1); }

.cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--borda-escura);
  border-radius: 2px;
  background: transparent;
  color: var(--branco);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.cat.is-ativa { border-color: var(--branco); }

/* ---------- lista ---------- */
.lista {
  padding: 14px 14px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}
.contagem, .vazio { margin: 0; font-size: 12px; color: var(--fraco-escuro); font-weight: 500; grid-column: 1 / -1; }
.vazio { padding: 40px 0; text-align: center; font-size: 14px; color: var(--apoio-escuro); }

.card {
  background: var(--branco);
  color: var(--texto-escuro);
  border-radius: var(--raio);
  padding: 12px;
  display: flex;
  gap: 12px;
}
.card[hidden] { display: none; }
.card__foto {
  width: 112px;
  flex-shrink: 0;
  aspect-ratio: 5 / 6;
  border-radius: 2px;
  background: var(--branco);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card__foto img { width: 100%; height: 100%; object-fit: contain; }
.card__foto .card__sem-foto { width: 64%; height: auto; opacity: 0.18; }
.card__info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.card__nome { margin: 0; font-size: 15px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
.card__specs { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.card__specs li { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--texto-escuro); }
.card__specs .check { flex-shrink: 0; margin-top: 1px; color: var(--verde); }
.ver-sabores {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 0 10px;
  margin-top: 2px;
  border: 1px solid var(--texto-escuro); border-radius: 2px;
  background: transparent; color: var(--texto-escuro);
  font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  cursor: pointer;
}
.ver-sabores:hover { background: var(--texto-escuro); color: var(--branco); }
.card__pe { margin-top: auto; padding-top: 4px; }
.preco { margin: 0; display: flex; align-items: baseline; gap: 4px; }
.preco__rs { font-size: 14px; font-weight: 800; }
.preco__valor { font-size: 28px; line-height: 1; font-weight: 900; letter-spacing: -0.02em; }
.botao {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 2px;
  background: var(--texto-escuro);
  color: var(--branco);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
}
.botao:hover { background: #3D3D3D; }

/* ---------- rodapé ---------- */
.rodape {
  border-top: 1px solid var(--linha-escura);
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--fraco-escuro);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
}
.rodape a { color: var(--apoio-escuro); text-decoration: none; }
.rodape a:hover { color: var(--branco); }
.rodape p { margin: 4px 0 0; flex-basis: 100%; }

/* ---------- pop-up de sabores ---------- */
/* No celular ocupa a tela toda, com o Fechar sempre à vista no topo; no computador, centralizado. */
.sabores {
  border: 0; padding: 0; margin: 0;
  width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  background: var(--branco); color: var(--texto-escuro);
  border-radius: 0;
  overflow: hidden;
}
.sabores::backdrop { background: rgba(0, 0, 0, 0.7); }
.sabores[open] { animation: entra .2s ease-out; }
@keyframes entra { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
body:has(.sabores[open]) { overflow: hidden; }
.sabores__caixa { display: flex; flex-direction: column; height: 100%; }
.sabores__topo {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--linha-clara);
  background: var(--branco);
}
.sabores__titulo { margin: 0; font-size: 16px; line-height: 1.2; font-weight: 900; text-transform: uppercase; }
.sabores__fechar {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px 0 10px;
  border: 0; border-radius: var(--raio);
  background: var(--texto-escuro); color: var(--branco);
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer;
}
.sabores__fechar:hover { background: #3D3D3D; }
.sabores__corpo {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
.sabores__foto { background: var(--branco); border-radius: 2px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sabores__foto img { width: 100%; height: 100%; object-fit: contain; }
.sabores__atual { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fraco-claro); }
.sabores__atual b { color: var(--texto-escuro); }
.sabores__lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sabor {
  width: 100%; display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 6px 8px 6px 6px;
  border: 1px solid var(--borda-clara); border-radius: var(--raio);
  background: var(--branco); color: var(--texto-escuro);
  font-size: 12px; font-weight: 700; text-align: left; line-height: 1.25;
  cursor: pointer;
}
.sabor img { width: 42px; height: 42px; flex-shrink: 0; object-fit: contain; background: var(--claro); border-radius: 2px; }
.sabor[aria-pressed="true"] { border-color: var(--texto-escuro); box-shadow: inset 0 0 0 1px var(--texto-escuro); }
@media (min-width: 720px) {
  .sabores { margin: auto; width: calc(100% - 48px); max-width: 560px; height: auto; max-height: 90vh; border-radius: var(--raio); }
  .sabores__caixa { height: auto; max-height: 90vh; }
  .sabores__topo { padding-top: 12px; }
  .sabores__lista { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- senha do parceiro e 404 ---------- */
.tela-senha { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.senha { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.senha .logo { width: 160px; }
.senha p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--apoio-escuro); }
.senha__form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.senha__erro { color: #FF8A8E !important; font-weight: 600; }
.botao--claro { background: var(--branco); color: var(--texto-escuro); border: 0; cursor: pointer; justify-content: center; min-height: 46px; }
.botao--claro:hover { background: #DADADA; }

/* ---------- telas maiores ---------- */
@media (min-width: 720px) {
  .topo { padding-left: max(24px, calc((100vw - 1200px) / 2 + 14px)); padding-right: max(24px, calc((100vw - 1200px) / 2 + 14px)); }
  .titulo { font-size: 36px; }
  .logo { width: 160px; }
  .busca { max-width: 520px; }
  .cats { margin: 0; padding: 0; flex-wrap: wrap; }
  .lista { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 20px 24px 40px; gap: 14px; }
  .card__foto { width: 140px; }
}
@media (min-width: 1080px) {
  .lista { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
