:root {
  --bg: #f7f7fb;
  --card-bg: #ffffff;
  --text: #1f2130;
  --text-muted: #6b6f80;
  --border: #e6e6f0;
  --accent: #6c5ce7;
  --accent-dark: #5a4bd1;
  --accent-soft: #efecfd;
  --success: #00b894;
  --warn: #e17055;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(31, 33, 48, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
header.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.brand .logo-dot {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Category nav ---------- */
nav.categorias {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

nav.categorias button {
  flex: none;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

nav.categorias button:hover {
  border-color: var(--accent);
}

nav.categorias button.ativo {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 8px;
}

.hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
}

.hero p {
  color: var(--text-muted);
  max-width: 620px;
  margin: 0;
}

.disclosure {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  display: inline-block;
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 28px 0 60px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.card .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 2;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0f0f5;
}

.card .card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card h3 {
  font-size: 1.02rem;
  margin: 0;
}

.card .descricao {
  color: var(--text-muted);
  font-size: 0.87rem;
  margin: 0;
}

.card .specs {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  font-size: 0.82rem;
  color: var(--text);
}

.card .specs li {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
}

.card .rodape {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preco {
  font-weight: 700;
  font-size: 1.05rem;
}

.nota {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }

.btn-primario {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.tipo-tag {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.tipo-afiliado {
  background: #fff1ea;
  color: var(--warn);
}

.tipo-proprio {
  background: #e6fbf5;
  color: var(--success);
}

.compare-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0 16px 12px;
}

/* ---------- Barra flutuante de comparação ---------- */
.compare-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 30;
}

.compare-bar[hidden] { display: none; }

.compare-bar button {
  background: white;
  color: var(--text);
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}

.compare-bar .limpar {
  background: transparent;
  color: rgba(255,255,255,0.75);
  text-decoration: underline;
  padding: 0;
  font-size: 0.8rem;
}

/* ---------- Modal de comparação ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: white;
  border-radius: var(--radius);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header button {
  border: none;
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

table.comparacao {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.comparacao th, table.comparacao td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

table.comparacao th {
  background: var(--accent-soft);
  position: sticky;
  top: 0;
}

table.comparacao img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

footer.site-footer p { margin: 4px 0; }

.vazio {
  padding: 60px 0;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card .card-body { padding: 12px; }
}
