/* ============================================================
   categoria.css — Estilos da página de categorias/busca
============================================================ */

/* ================= BARRA DE FILTROS ================= */
html,
body {
  overflow-x: hidden;
}

.filtros-bar {
  background: #111827;
  border-bottom: 1px solid #1e293b;
  padding: 12px 0;
  position: sticky;
  top: calc(
    var(--navbar-sticky-offset, 0px) + var(--navbar-categories-height, 0px)
  );
  z-index: 50;
}

/* Compacta o hero da categoria para reduzir o vao visual abaixo da navbar. */
.page-hero {
  padding: 18px 24px 14px;
  background: linear-gradient(165deg, #0a111c, #0a1018);
  border-bottom: 1px solid #1e293b;
}

.page-hero-content h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  margin-bottom: 4px;
}

.page-hero-content p {
  font-size: 13px;
}

.filtros-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.filtros-label {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Scroll horizontal sem barra de rolagem */
.filtros-scroll {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filtros-scroll::-webkit-scrollbar {
  display: none;
}

/* Botão de filtro */
.filtro-btn {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  align-self: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid #1e293b;
  background: #0f172a;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
}

.filtro-btn:hover {
  border-color: #ff4a00;
  color: #ff4a00;
}

/* Estado ativo */
.filtro-btn.active {
  background: #ff4a00;
  border-color: #ff4a00;
  color: #fff;
  font-weight: 600;
}

/* ================= FILTROS AVANÇADOS (MARKETPLACE) ================= */
.filtros-mercado {
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 0 24px;
  display: grid;
  gap: 12px;
}

.filtros-mercado-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 12px;
}

.filtro-pesquisa-wrap,
.filtro-ordenacao-wrap,
.filtro-bloco {
  border: 1px solid #1e293b;
  background: linear-gradient(160deg, #0f172a, #111827);
  border-radius: 12px;
  padding: 12px;
}

.filtro-pesquisa-wrap label,
.filtro-ordenacao-wrap label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  color: #93a4be;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.filtro-pesquisa-input {
  display: flex;
  align-items: stretch;
  border: 1px solid #24344b;
  border-radius: 10px;
  overflow: hidden;
}

.filtro-pesquisa-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: #0b1322;
  color: #e2e8f0;
  padding: 10px 12px;
  outline: none;
}

.filtro-pesquisa-input input:focus {
  background: #0c1527;
}

.filtro-pesquisa-input button {
  border: none;
  min-width: 46px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff4a00, #ff9800);
  cursor: pointer;
}

.filtro-pesquisa-input button:hover {
  background: linear-gradient(135deg, #f05f00, #ff8b00);
}

.filtro-ordenacao-wrap select {
  width: 100%;
  border: 1px solid #25364d;
  background: #0b1322;
  color: #d6e1ef;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.filtro-ordenacao-wrap select:focus {
  border-color: #ff4a00;
}

.filtros-mercado-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.filtros-mercado-top > *,
.filtros-mercado-grid > * {
  min-width: 0;
}

.filtro-bloco h3 {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #e7eef9;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filtro-bloco h3 i {
  color: #ff4a00;
}

.filtro-campo-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9db0c9;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.filtro-select-input {
  width: 100%;
  border: 1px solid #27384f;
  background: #0b1322;
  color: #d6e1ef;
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
}

.filtro-select-input:focus {
  border-color: #ff4a00;
}

.filtro-preco-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filtro-preco-inputs label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: #9db0c9;
  min-width: 0;
}

.filtro-preco-inputs input {
  width: 100%;
  border: 1px solid #27384f;
  background: #0b1322;
  color: #d6e1ef;
  border-radius: 9px;
  padding: 9px 10px;
  outline: none;
}

@media (max-width: 380px) {
  .filtro-preco-inputs {
    grid-template-columns: 1fr;
  }
}

.filtro-preco-inputs input:focus {
  border-color: #ff4a00;
}

.filtro-categorias-avancado {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding-right: 4px;
}

.categoria-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #23344b;
  background: #0d1727;
  border-radius: 8px;
  padding: 7px 9px;
  color: #c0d1e5;
  font-size: 13px;
}

.categoria-check-item input {
  accent-color: #ff4a00;
}

.categoria-check-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.categoria-check-item small {
  color: #90a5bf;
  font-weight: 700;
}

.check-filtro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #c0d1e5;
}

.check-filtro input {
  accent-color: #ff4a00;
}

.filtro-actions-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-filtro-secundario {
  border: 1px solid #2d425d;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-filtro-secundario {
  color: #c3d3e7;
  background: #101b2d;
}

.btn-filtro-secundario:hover {
  border-color: #ff4a00;
  color: #ff4a00;
}

.filtro-auto-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #97adca;
  font-size: 12px;
}

.filtro-auto-hint i {
  color: #ff8a2d;
}

.produto-card.dynamic-reveal {
  transition:
    opacity 0.38s ease,
    transform 0.38s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.filtros-ativos {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.filtro-ativo-chip {
  border: 1px solid rgba(255, 106, 0, 0.44);
  background: rgba(255, 106, 0, 0.12);
  color: #ffd6bd;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.filtro-ativo-chip i {
  color: #ffab78;
}

.filtros-sem-categoria {
  color: #7f94af;
  font-size: 13px;
}

/* ================= MAIN ================= */
.produtos-main {
  padding: 32px 24px 60px;
  min-height: 50vh;
}

.produtos-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Linha de resultados */
.resultados-header {
  margin-bottom: 20px;
}

#resultadosCount {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

/* ================= GRID DE PRODUTOS ================= */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

/* ================= CARD DE PRODUTO ================= */
.produto-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
  transition: 0.25s;
  display: flex;
  flex-direction: column;
}

.produto-card-clickable {
  cursor: pointer;
}

.produto-card-clickable:focus-visible {
  outline: 2px solid #ff4a00;
  outline-offset: 4px;
}

.produto-card:hover {
  transform: translateY(-4px);
  border-color: #ff4a00;
  box-shadow: 0 8px 30px rgba(255, 60, 0, 0.15);
}

/* IMAGEM */
.produto-img-wrap {
  position: relative;
  height: 180px;
  background: #0f172a;
  overflow: hidden;
}

.produto-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s;
}

.produto-card:hover .produto-img-wrap img {
  transform: scale(1.05);
}

/* Badge de categoria */
.produto-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  color: #ff4a00;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* INFORMAÇÕES */
.produto-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.produto-nome {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.4;
}

.produto-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Rodapé do card */
.produto-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.produto-preco {
  font-size: 18px;
  font-weight: 800;
  color: #ff4a00;
}

/* Botão adicionar ao carrinho */
.btn-add-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #ff4a00;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

.btn-add-cart:hover {
  background: #d94300;
  transform: translateY(-1px);
}

/* ================= ESTADO VAZIO ================= */
.produtos-vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  text-align: center;
}

.produtos-vazio i {
  font-size: 56px;
  color: #1e293b;
}

.produtos-vazio p {
  color: #64748b;
  font-size: 16px;
}

.btn-voltar-loja {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #ff4a00;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
}

.btn-voltar-loja:hover {
  background: #d94300;
  transform: translateY(-2px);
}

/* ================= LOADING ================= */
.produtos-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: #64748b;
}

.produtos-loading i {
  font-size: 36px;
  color: #ff4a00;
}

/* ================= RESPONSIVO ================= */
@media (max-width: 768px) {
  .page-hero {
    padding: 14px 16px 12px;
  }

  .filtros-mercado {
    padding: 0 14px;
  }

  .filtros-mercado-top,
  .filtros-mercado-grid {
    grid-template-columns: 1fr;
  }

  .filtro-categorias-avancado {
    max-height: 150px;
  }

  .produtos-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .produto-img-wrap {
    height: 140px;
  }

  .produto-preco {
    font-size: 15px;
  }

  .btn-add-cart {
    padding: 8px 10px;
    font-size: 12px;
  }

  .filtros-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .filtros-scroll {
    width: 100%;
    flex: 0 0 auto;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
}

@media (max-width: 980px) {
  .filtros-mercado-top,
  .filtros-mercado-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .filtros-mercado {
    margin-top: 10px;
    padding: 0 12px;
  }

  .filtro-pesquisa-wrap,
  .filtro-ordenacao-wrap,
  .filtro-bloco {
    padding: 10px;
  }

  .produtos-main {
    padding: 20px 12px 40px;
  }
  .produtos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .produto-img-wrap {
    height: 120px;
  }
  .produto-nome {
    font-size: 12px;
  }
  .produto-preco {
    font-size: 13px;
  }
  .btn-add-cart {
    font-size: 11px;
    padding: 7px 8px;
  }
  .filtros-bar {
    padding: 8px 0;
    top: calc(
      var(--navbar-sticky-offset, 0px) + var(--navbar-categories-height, 0px)
    );
  }
  .filtro-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
}
