:root {
  --cream: #fff8dc;
  --sage: #809762;
  --sage-dark: #5f7347;
  --sage-light: #a8bc8f;
  --sage-soft: #eef2e6;
  --ink: #3d4633;
  --white: #fffefa;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  min-height: 100vh;
}

/* ---------- Cabeçalho ---------- */
header {
  text-align: center;
  padding: 64px 24px 40px;
  position: relative;
  overflow: hidden;
}

header::before, header::after {
  content: "❀";
  position: absolute;
  font-size: 180px;
  color: var(--sage);
  opacity: .08;
  top: -30px;
}
header::before { left: -20px; transform: rotate(-20deg); }
header::after  { right: -20px; transform: rotate(20deg); }

.ornament {
  color: var(--sage);
  font-size: 22px;
  letter-spacing: 14px;
  margin-bottom: 14px;
}

h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(42px, 7vw, 68px);
  color: var(--sage-dark);
  line-height: 1.05;
}

h1 em {
  font-style: italic;
  color: var(--sage);
}

.subtitle {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink);
  opacity: .75;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 28px auto 0;
  color: var(--sage);
}
.divider::before, .divider::after {
  content: "";
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sage));
}
.divider::after { background: linear-gradient(90deg, var(--sage), transparent); }

/* ---------- Busca ---------- */
.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}

.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  stroke: var(--sage);
}

#busca {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: 1.5px solid var(--sage-light);
  border-radius: 999px;
  background: var(--white);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

#busca:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(128, 151, 98, .15);
}

#busca::placeholder { color: #9aa88b; }

.contagem {
  font-size: 14px;
  color: var(--sage-dark);
  font-weight: 500;
  letter-spacing: .5px;
}

/* ---------- Grade de cartões ---------- */
.grade {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px;
}

.cartao {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(95, 115, 71, .10);
  border: 1px solid rgba(128, 151, 98, .18);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}

.cartao:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(95, 115, 71, .22);
}

.foto {
  position: relative;
  background: #fff;
  aspect-ratio: 1 / 1;
  min-height: 0; /* impede o mínimo automático do flex de esticar o quadrado */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-bottom: 1px solid var(--sage-soft);
}

.foto img {
  /* fora do fluxo: a imagem nunca altera a altura do card */
  position: absolute;
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  object-fit: contain;
  transition: transform .3s ease;
}

.cartao:hover .foto img { transform: scale(1.06); }

.cotas {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--sage);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(95, 115, 71, .35);
}

.info {
  padding: 18px 20px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: center;
  background: linear-gradient(180deg, var(--white), var(--sage-soft));
}

.info h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--sage-dark);
  line-height: 1.15;
}

.info .qtde {
  font-size: 12.5px;
  color: var(--ink);
  opacity: .7;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.vazio {
  display: none;
  text-align: center;
  padding: 60px 24px;
  color: var(--sage-dark);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-style: italic;
}

/* ---------- Rodapé ---------- */
footer {
  text-align: center;
  padding: 44px 24px 56px;
  color: var(--sage-dark);
}

footer .ornament { margin-bottom: 10px; font-size: 18px; letter-spacing: 10px; }

footer p {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-style: italic;
}

@media (max-width: 560px) {
  .grade { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 16px; }
  .info h2 { font-size: 18px; }
  header { padding: 44px 16px 28px; }
}
