:root {
  --vermelho: #e10101;
  --bege: #ede2d5;
  --bege-claro: #f7f2ec;
  --texto: #1c1c1c;
  --suave: #7a7068;
  --linha: #e4d9cc;
  --fundo: #ffffff;
  --serifa: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Topo */
.topo {
  text-align: center;
  padding: 44px 16px 36px;
  background: var(--bege);
}
.logo {
  margin: 0;
  font-family: var(--serifa);
  font-weight: 500;
  font-size: clamp(34px, 7vw, 54px);
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.logo em { font-style: italic; color: var(--vermelho); font-weight: 400; }
.subtitulo {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--suave);
}

main { max-width: 1120px; margin: 0 auto; padding: 36px 16px 56px; }

/* Busca */
.busca {
  position: relative;
  max-width: 560px;
  margin: 0 auto 30px;
}
.busca input {
  width: 100%;
  padding: 14px 48px 14px 48px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--texto);
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s;
}
.busca input::-webkit-search-cancel-button { display: none; }
.busca input::placeholder { color: #a79c92; }
.busca input:focus { border-color: var(--texto); }
.lupa {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--suave);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}
.apagar-busca {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--suave);
  cursor: pointer;
}
.apagar-busca:hover { color: var(--texto); }
.aviso-busca {
  margin: -18px auto 26px;
  max-width: 560px;
  text-align: center;
  font-size: 13px;
  color: var(--suave);
}
.filtros.inativo .grupo { opacity: .4; transition: opacity .2s; }
.visualmente-oculto {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Filtros */
.filtros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--linha);
}
.grupo-familias, .limpar { grid-column: 1 / -1; }
.grupo h2 {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--suave);
}

.botoes { display: flex; flex-wrap: wrap; gap: 10px; }
.botoes button {
  flex: 1 1 0;
  min-width: 100px;
  padding: 11px 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  background: #fff;
  color: var(--texto);
  border: 1px solid var(--linha);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.familias button { flex: 0 1 auto; min-width: 118px; }
.botoes button:hover { border-color: var(--texto); }
.botoes button.ativo {
  background: var(--texto);
  border-color: var(--texto);
  color: #fff;
}
button:focus-visible, a:focus-visible, .foto:focus-visible {
  outline: 2px solid var(--texto);
  outline-offset: 3px;
}

.limpar {
  justify-self: start;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--suave);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.limpar:hover { color: var(--vermelho); }

/* Resultados */
.titulo-lista {
  margin: 34px 0 0;
  font-family: var(--serifa);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
}
.titulo-lista:not([hidden]) + .mensagem { margin-top: 6px; }
.mensagem { margin: 28px 0 22px; color: var(--suave); font-size: 15px; }
.mensagem strong { color: var(--texto); font-weight: 500; }

.lista {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 34px 26px;
}

.cartao { display: flex; flex-direction: column; }
.foto {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bege-claro);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.foto img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform .35s ease;
}
.foto:hover img { transform: scale(1.04); }
.sem-foto { font-family: var(--serifa); font-size: 56px; color: var(--linha); }
.acoes {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.ver-notas {
  padding: 7px 16px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto);
  background: var(--bege-claro);
  border: 1px solid var(--linha);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.ver-notas:hover { background: var(--bege); border-color: #cdbba7; }

.info { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.marca {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--suave);
  font-weight: 400;
}
.nome {
  margin: 0;
  font-family: var(--serifa);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.2;
}
.tags { margin: 6px 0 12px; font-size: 12px; color: var(--suave); white-space: pre-wrap; }

.ver-site {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--suave);
  text-decoration: none;
}
.ver-site:hover { color: var(--vermelho); text-decoration: underline; text-underline-offset: 3px; }

.rodape {
  text-align: center;
  font-family: var(--serifa);
  font-size: 16px;
  font-style: italic;
  color: var(--suave);
  padding: 28px 16px 36px;
  background: var(--bege);
}

/* Pirâmide olfativa (card sobreposto) */
.sobreposicao {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(28, 28, 28, .45);
  backdrop-filter: blur(3px);
}
.sobreposicao[hidden] { display: none; }
.piramide-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 6px;
  padding: 34px 28px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.piramide-card h3 {
  margin: 4px 0 0;
  font-family: var(--serifa);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
}
.piramide-titulo {
  margin: 18px 0 20px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--vermelho);
}
.fechar {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--suave);
  cursor: pointer;
}
.fechar:hover { color: var(--texto); }

.niveis { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nivel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: var(--bege);
}
.nivel-topo    { width: 62%; background: var(--bege-claro); border-radius: 60px 60px 4px 4px; }
.nivel-coracao { width: 82%; background: #f2e9df; }
.nivel-fundo   { width: 100%; background: var(--bege); border-radius: 4px 4px 6px 6px; }
.nivel-nome {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--suave);
}
.nivel-notas { font-family: var(--serifa); font-size: 18px; line-height: 1.3; }

/* Telemóvel */
@media (max-width: 720px) {
  .filtros { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 480px) {
  .botoes button, .familias button { min-width: calc(50% - 5px); }
  .lista { grid-template-columns: repeat(2, 1fr); gap: 26px 14px; }
  .nome { font-size: 18px; }
  .ver-notas { font-size: 10px; padding: 6px 12px; }
  .ver-site { font-size: 11px; }
  .nivel-topo { width: 74%; }
  .nivel-coracao { width: 88%; }
}

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