/* ==========================================================
   Peixinhos – estilos globais
   ========================================================== */
:root {
  --azul: #0b5d7a;
  --azul-escuro: #083f54;
  --verde: #2a9d8f;
  --areia: #f5f1e8;
  --texto: #1f2d33;
  --cinza: #5b6b72;
  --borda: #dfe6e9;
  --branco: #ffffff;
  --erro: #b00020;
  --ok: #1b7f3b;
  --raio: 12px;
  --sombra: 0 4px 14px rgba(8, 63, 84, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  background: var(--areia);
  line-height: 1.55;
}

[hidden] { display: none !important; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--azul); }
h1, h2, h3 { color: var(--azul-escuro); line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 1rem; }
h2 { font-size: 1.4rem; margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0.4rem 0; }

.container { width: min(1140px, 92%); margin: 0 auto; }
.secao { padding: 2rem 0 3rem; }

/* ---------- Cabeçalho ---------- */
.topo { background: var(--azul); color: var(--branco); position: sticky; top: 0; z-index: 10; }
.topo-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; flex-wrap: wrap; }
.logo { color: var(--branco); font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.menu { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.menu a { color: var(--branco); text-decoration: none; font-weight: 500; }
.menu a:hover, .menu a[aria-current="page"] { text-decoration: underline; }

.badge {
  display: inline-block; min-width: 1.5rem; padding: 0 0.4rem; margin-left: 0.2rem;
  border-radius: 999px; background: #ffb703; color: #1f2d33; font-size: 0.8rem; font-weight: 700;
  text-align: center; line-height: 1.5rem;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-block; background: var(--verde); color: var(--branco);
  border: 0; border-radius: 999px; padding: 0.7rem 1.4rem; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: #21837a; }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: #9aa8ad; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-add { width: 100%; margin-top: auto; }

.link-remover {
  background: none; border: 0; padding: 0; color: var(--erro); cursor: pointer;
  font: inherit; text-decoration: underline;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--azul) 0%, var(--verde) 100%);
  color: var(--branco); padding: 4rem 0;
}
.hero h1 { color: var(--branco); max-width: 22ch; }
.hero p { max-width: 60ch; font-size: 1.1rem; opacity: 0.95; }
.hero .btn { background: #ffb703; color: var(--texto); }
.hero .btn:hover { background: #f5a400; }

/* ---------- Categorias ---------- */
.categorias { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.cat-card {
  background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 1.2rem; text-align: center; text-decoration: none; color: var(--azul-escuro);
  font-weight: 600; box-shadow: var(--sombra); transition: transform 0.15s;
}
.cat-card:hover { transform: translateY(-3px); }

/* ---------- Filtros ---------- */
.filtros {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;
  margin-bottom: 1.5rem; background: var(--branco); padding: 1rem; border-radius: var(--raio);
  box-shadow: var(--sombra);
}
.filtros label, .form-pedido label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid #c6d1d6; border-radius: 8px;
  background: var(--branco); color: var(--texto);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #ffb703; outline-offset: 2px;
}

/* ---------- Grade de produtos ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--branco); border-radius: var(--raio); overflow: hidden;
  box-shadow: var(--sombra); display: flex; flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef4f6; }
.card-corpo { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.card.esgotado { opacity: 0.7; }
.tag {
  align-self: flex-start; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  background: #e0f1ef; color: #17625b; padding: 0.15rem 0.5rem; border-radius: 999px; margin-bottom: 0.4rem;
}
.descricao { color: var(--cinza); font-size: 0.95rem; margin: 0.2rem 0 0.6rem; }
.preco { font-size: 1.25rem; font-weight: 700; color: var(--azul-escuro); margin: 0 0 0.8rem; }
.vazio { color: var(--cinza); grid-column: 1 / -1; }

/* ---------- Carrinho ---------- */
.carrinho-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .carrinho-layout { grid-template-columns: 1fr; } }

.lista-itens { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.item-carrinho {
  display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 0.8rem 1rem; align-items: center;
  background: var(--branco); padding: 0.9rem; border-radius: var(--raio); box-shadow: var(--sombra);
}
.item-carrinho img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; background: #eef4f6; }
.item-info { display: flex; flex-direction: column; min-width: 0; }
.item-info span { color: var(--cinza); font-size: 0.9rem; }
.qtd-controles { display: flex; align-items: center; gap: 0.4rem; }
.qtd-controles button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid #c6d1d6; background: var(--branco);
  font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.qtd-controles button:disabled { opacity: 0.4; cursor: not-allowed; }
.qtd-controles span { min-width: 2ch; text-align: center; font-weight: 600; }
.subtotal { font-weight: 700; text-align: right; }
.item-carrinho .link-remover { grid-column: 2 / 4; justify-self: start; font-size: 0.9rem; }
@media (max-width: 560px) {
  .item-carrinho { grid-template-columns: 64px 1fr; }
  .item-carrinho img { width: 64px; height: 48px; }
  .qtd-controles, .subtotal { grid-column: 2; justify-self: start; }
  .subtotal { text-align: left; }
}

.acoes-carrinho { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

.resumo {
  background: var(--branco); padding: 1.25rem; border-radius: var(--raio); box-shadow: var(--sombra);
  position: sticky; top: 90px;
}
.total-linha { display: flex; justify-content: space-between; font-size: 1.1rem; margin: 0.5rem 0; }
.total-linha strong { color: var(--azul-escuro); }
.nota { color: var(--cinza); font-size: 0.85rem; }
.form-pedido { display: grid; gap: 0.9rem; margin-top: 1rem; }

.alerta { padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.95rem; margin: 0; }
.alerta:empty { display: none; }
.alerta.erro { background: #fde8ec; color: var(--erro); }
.alerta.ok { background: #e3f4e8; color: var(--ok); }

.vazio-bloco { background: var(--branco); padding: 2rem; border-radius: var(--raio); text-align: center; box-shadow: var(--sombra); }

/* ---------- Texto legal ---------- */
.texto-legal { max-width: 780px; }
.texto-legal h2 { font-size: 1.15rem; margin-top: 1.6rem; }

/* ---------- Rodapé ---------- */
.rodape { background: var(--azul-escuro); color: #d7e6eb; padding: 2rem 0; font-size: 0.95rem; }
.rodape a { color: #ffd166; }
.rodape p { margin: 0.3rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
