.products-container {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

/* Filtros melhorados */
.filters-sidebar {
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  height: fit-content;
  position: sticky;
  top: 2rem;
  border: 1px solid rgba(255, 102, 0, 0.2);
  backdrop-filter: blur(10px);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(255, 102, 0, 0.2);
}

.filters-header h2 {
  font-size: 1.5rem;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.filters-header h2 i {
  color: #ff6600;
  font-size: 1.25rem;
}

.btn-text {
  background: rgba(255, 102, 0, 0.1);
  border: 1px solid rgba(255, 102, 0, 0.3);
  color: #ff6600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.btn-text:hover {
  background: rgba(255, 102, 0, 0.2);
  border-color: #ff6600;
  transform: translateY(-1px);
}

.filter-group {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group h3 {
  font-size: 1.125rem;
  color: #fff;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.filter-group h3 i {
  color: #ff6600;
  font-size: 1rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.checkbox-container:hover {
  background: rgba(255, 102, 0, 0.05);
  color: #fff;
}

.checkbox-container input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, #ff6600, #ff8533);
  border-color: #ff6600;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

/* Range de Preço melhorado */
.price-range {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.price-inputs input {
  width: 90px;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: all 0.3s ease;
  font-weight: 500;
}

.price-inputs input:focus {
  outline: none;
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* Conteúdo dos Produtos */
.products-content {
  flex: 1;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 3rem;
  color: #fff;
  margin: 0;
}

.products-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-options label {
  font-size: 1.2rem;
  color: #ccc;
}

.sort-options select {
  padding: 0.5rem;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #fff;
  background: #222;
}

/* Grid de Produtos - Cards menores */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch; /* Força cards a se esticarem para altura igual na linha */
}

.product-card {
  display: flex; /* Torna o card um flex container vertical */
  flex-direction: column; /* Empilha imagem e info verticalmente */
  justify-content: space-between; /* Distribui espaço, empurrando o fundo para baixo */
  height: 100%; /* Garante que todos os cards tenham altura igual no grid */
  min-height: 400px; /* Altura mínima fixa para consistência (ajuste conforme necessário, baseado em h-48 + padding + conteúdo típico) */
  max-width: 220px; /* Mantém o max-width existente */
  background: #1a1a1a; /* Fundo escuro, como no CSS original */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 102, 0, 0.2);
}

.product-card .relative {
  /* Seção da imagem */
  flex: 0 0 auto; /* Não cresce, mantém altura fixa */
  position: relative; /* Mantém posicionamento relativo para badges */
}

.product-card .relative img {
  width: 100%;
  height: 192px; /* Equivalente a h-48 no Tailwind, para consistência */
  object-fit: cover; /* Garante que imagens preencham sem distorção */
}

.product-card .p-4 {
  /* Seção de info (ajuste a classe se não for exatamente 'p-4'; no JS é 'p-4') */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Empurra o botão para o fundo da seção */
  flex: 1; /* Ocupa todo o espaço restante no card */
  padding: 1rem; /* Padding consistente (equivalente a p-4 no Tailwind) */
}

.product-card .product-title {
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 0.5rem; /* Espaçamento consistente */
  overflow: hidden; /* Previne overflow */
  text-overflow: ellipsis; /* Melhora o truncate */
  white-space: nowrap; /* Força uma linha só */
}

.product-card .text-sm {
  /* Marca do produto */
  font-size: 0.8rem;
  margin-bottom: 0.75rem; /* Espaçamento fixo para alinhar preços */
}

/* Ajustes para fixar o botão 'COMPRAR' no fundo do card */
.product-card {
  display: flex; /* Torna o card um flex container vertical */
  flex-direction: column; /* Empilha imagem e info verticalmente */
  justify-content: space-between; /* Distribui espaço, empurrando o fundo para baixo */
  height: 100%; /* Garante que todos os cards tenham altura igual no grid */
  min-height: 400px; /* Altura mínima fixa para consistência (ajuste conforme necessário, baseado em h-48 + padding + conteúdo típico) */
  max-width: 220px; /* Mantém o max-width existente */
  background: #1a1a1a; /* Fundo escuro, como no CSS original */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 102, 0, 0.2);
}

.product-card .relative {
  /* Seção da imagem */
  flex: 0 0 auto; /* Não cresce, mantém altura fixa */
  position: relative; /* Mantém posicionamento relativo para badges */
}

.product-card .relative img {
  width: 100%;
  height: 192px; /* Equivalente a h-48 no Tailwind, para consistência */
  object-fit: cover; /* Garante que imagens preencham sem distorção */
}

.product-card .p-4 {
  /* Seção de info (ajuste a classe se não for exatamente 'p-4'; no JS é 'p-4') */
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* Empurra o botão para o fundo da seção */
  flex: 1; /* Ocupa todo o espaço restante no card */
  padding: 1rem; /* Padding consistente (equivalente a p-4 no Tailwind) */
}

.product-card .product-title {
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 0.5rem; /* Espaçamento consistente */
  overflow: hidden; /* Previne overflow */
  text-overflow: ellipsis; /* Melhora o truncate */
  white-space: nowrap; /* Força uma linha só */
}

.product-card .text-sm {
  /* Marca do produto */
  font-size: 0.8rem;
  margin-bottom: 0.75rem; /* Espaçamento fixo para alinhar preços */
}

.product-card .flex {
  /* Container de preços */
  margin-bottom: 1rem; /* Espaçamento fixo antes do botão */
}

.product-card .add-to-cart {
  /* Botão 'COMPRAR' */
  margin-top: auto; /* Empurra para o fundo da seção flex */
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6600, #ff8533);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.product-card:hover {
  box-shadow: 0 0 25px rgba(255, 102, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-6px) scale(1.02);
  z-index: 2;
  border-color: #ff6600;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: linear-gradient(135deg, #ff6600, #ff8533);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.product-badge.sale {
  background: linear-gradient(135deg, #ff3333, #ff6666);
}

.product-image {
  position: relative;
  padding-top: 100%;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  color: #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background: linear-gradient(135deg, #ff6600, #ff8533);
  color: #fff;
  transform: scale(1.1);
}

.product-info {
  padding: 1.25rem;
}

.product-category {
  font-size: 0.7rem;
  color: #999;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.product-title {
  font-size: 0.9rem;
  color: #fff;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  font-weight: 600;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stars {
  color: #ff6600;
  font-size: 0.8rem;
}

.rating-count {
  font-size: 0.7rem;
  color: #999;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.current-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.old-price {
  font-size: 0.8rem;
  color: #999;
  text-decoration: line-through;
}

.discount {
  font-size: 0.7rem;
  color: #fff;
  background: linear-gradient(135deg, #ff3333, #ff6666);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

.add-to-cart {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6600, #ff8533);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.add-to-cart:hover {
  background: linear-gradient(135deg, #ff8533, #ffaa66);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

/* Paginação */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* Adicionado estilo para informações de paginação */
.pagination-info {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.items-count {
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #222;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn:not(:disabled):hover {
  background: #ff6600;
  border-color: #ff6600;
  color: #fff;
}

.pagination-pages {
  display: flex;
  gap: 0.5rem;
}

.pagination-page {
  width: 36px;
  height: 36px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #222;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-page.active {
  background: #ff6600;
  border-color: #ff6600;
  color: #fff;
}

.pagination-page:not(.active):hover {
  background: #333;
}

/* Responsividade para paginação */
@media (max-width: 768px) {
  .pagination {
    gap: 0.75rem;
  }

  .pagination-controls {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .pagination-pages {
    gap: 0.25rem;
  }

  .pagination-btn,
  .pagination-page {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .items-count {
    font-size: 0.8rem;
  }
}

/* Responsividade */
.mobile-actions {
  display: none;
}

/* Container principal */
.container {
  padding-left: 2rem;
  padding-right: 2rem;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .products-container {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 2rem;
  }

  .filters-sidebar {
    display: none;
  }

  .products-header {
    flex-direction: column;
    gap: 1rem;
  }

  .products-actions {
    width: 100%;
    justify-content: space-between;
  }

  .mobile-actions {
    display: flex;
    width: 100%;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .btn-mobile-filter,
  .btn-mobile-sort {
    flex: 1;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #444;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .sort-options {
    display: none;
  }

  .btn-close-panel {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1002;
  }

  .filters-sidebar.mobile-active .btn-close-panel,
  .sort-options.mobile-active .btn-close-panel {
    display: block;
  }

  .filters-sidebar.mobile-active {
    display: block;
    position: fixed !important; /* Forçar posicionamento */
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1001 !important; /* Forçar prioridade */
    overflow-y: auto;
    backdrop-filter: none;
  }

  .sort-options.mobile-active {
    display: block;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #111;
    padding: 1rem;
    z-index: 1001 !important;
    border-bottom: 1px solid #444;
    backdrop-filter: none;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sort-options.mobile-active select {
    width: 100%;
  }

  .overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 1000 !important;
    display: block !important;
    opacity: 1 !important; /* Garantir visibilidade */
  }

  .page-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
}

@media (min-width: 769px) {
  .btn-close-panel {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 320px) {
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Custom arrow for select in .enhanced-sort */
.enhanced-sort {
  position: relative;
}

.enhanced-sort select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #181818;
  color: #fff;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
  min-width: 140px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  background-image: none;
  position: relative;
}

.enhanced-sort::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #ff6600;
  font-size: 1rem;
  z-index: 2;
}

@media (max-width: 600px) {
  .enhanced-sort::after {
    right: 28px;
    top: 65%;
  }
}

#applyPriceFilter,
#applyFilters {
  display: none !important;
}

/* Previne scroll horizontal */
html,
body {
  overflow-x: hidden;
}

/* Box-sizing global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .product-card {
    transition: none;
  }
}
