/* ===== RESET BÁSICO ===== */

*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-main);
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
}

/* ===== MAIN ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-align: center;
}

input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
}
input[type="text"]:focus {
  border-color: #378add;
}

/* Categorias */
#categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
  justify-content: center;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 72px;
}

.cat-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition:
    border-color 0.15s,
    transform 0.15s;
  background: #eee;
}
.cat-item:hover .cat-img {
  transform: scale(1.05);
}
.cat-item.ativo .cat-img {
  border-color: #378add;
  box-shadow: 0 0 0 3px #e6f1fb;
}

.cat-label {
  font-size: 12px;
  color: #666;
  text-align: center;
}
.cat-item.ativo .cat-label {
  color: #378add;
  font-weight: 500;
}

/* Lista de produtos */
#lista {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.card-categoria {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}

.card-nome {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.card-preco {
  font-size: 14px;
  color: #378add;
}

#vazio {
  display: none;
  color: #999;
  font-size: 14px;
  margin-top: 1rem;
  text-align: center;
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: #aaa;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  margin-top: 4rem;
}

/* ===== FOCO (acessibilidade) ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .categorias-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .produtos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  header {
    height: 56px;
    padding: 0 1.5rem;
  }
  nav ul {
    gap: 1rem;
  }
  #sobre {
    grid-template-columns: 1fr;
  }
  #hero {
    padding: 4rem 1rem;
  }
  #hero h1 {
    font-size: 2rem;
  }
}

@media (max-width: 500px) {
  .categorias-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .produtos-grid {
    grid-template-columns: 1fr;
  }
  .filtros {
    gap: 0.5rem;
  }
  .filtro-btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
}

@media (max-width: 480px) {
  nav ul {
    gap: 0.75rem;
    font-size: 0.85rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
