* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f4f7;
  color: #222;
}

header {
  background: #1f3a5f;
  color: white;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
header h1 { margin: 0; font-size: 22px; margin-right: auto; }
nav { display: flex; gap: 8px; }
#saudacao { font-size: 14px; }

main { max-width: 1000px; margin: 0 auto; padding: 20px; }

button {
  background: #2d6cdf;
  color: white;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
button:hover { opacity: 0.9; }
button.secundario { background: #6b7785; }
button.perigo { background: #c0392b; }

.grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.card img { height: 150px; object-fit: contain; }
.card h3 { font-size: 14px; margin: 0; }
.preco { font-weight: bold; font-size: 18px; }

.caixa {
  background: white;
  border-radius: 8px;
  padding: 20px;
  max-width: 420px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.caixa label { display: block; margin-top: 10px; font-weight: bold; }
.caixa input { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #bbb; border-radius: 6px; }
.caixa button { margin-top: 14px; margin-right: 6px; }
.erro { color: #c0392b; font-size: 13px; display: block; min-height: 16px; }

#mensagem {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  z-index: 20;
}
#mensagem.sucesso { background: #2e8b57; }
#mensagem.erro-msg { background: #c0392b; }

#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.modal-conteudo {
  background: white;
  border-radius: 8px;
  padding: 20px;
  max-width: 600px;
  max-height: 90vh;
  overflow: auto;
}
.modal-conteudo img { max-width: 100%; max-height: 220px; display: block; margin: 12px auto; }

.escondido { display: none !important; }
.vazio { margin-top: 20px; color: #666; }
