.d-none {
  display: none;
}

/* Base styles for mobile-first */
.product-grid {
    display: grid;
    grid-template-columns: 1fr; /* One column on mobile */
    gap: 1rem;
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-card .description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.product-card .price {
    color: #3c3c3c;
    font-weight: bold;
    margin-bottom: 1rem;
}

.product-card .btn {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
}

.product-card .btn:hover {
    background: #0056b3;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.page-btn:hover:not(.active):not(:disabled) {
    background-color: #f0f0f0;
}

.page-btn.active {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: bold;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* FILTERS */
/* Base mobile styles */
.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.brand-filters,
.price-filter,
.sort-dropdown {
  display: flex;
  flex-direction: column;
  width: 100%;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.price-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input[type="number"],
select {
  padding: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive for medium+ screens */
@media (min-width: 768px) {
  .filters-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .price-inputs {
    flex-direction: row;
  }

  .brand-filters,
  .price-filter,
  .sort-dropdown {
    max-width: 250px;
  }
}

/* FILTERS V2 */
/* Fixed bottom button */
.mobile-filters-btn {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #1f2937; /* Dark gray */
  color: white;
  padding: 1rem;
  font-size: 1rem;
  border: none;
  z-index: 50;
  display: block;
}

/* Hide the button on larger screens */
@media (min-width: 768px) {
  .mobile-filters-btn {
    display: none;
  }
}

/* Modal backdrop */
.filters-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* Modal content */
.filters-modal-content {
  background-color: white;
  width: 100%;
  max-height: 80%;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  overflow-y: auto;
  padding: 1rem;
}

/* Header with close button */
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  margin-bottom: 1rem;
}

.filters-header button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}

/* Initially hidden */
.hidden {
  display: none;
}

.apply-filters-btn {
  margin-top: 1rem;
  width: 100%;
  background-color: #1f2937; /* dark gray */
  color: white;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.a-reset-filters {
  text-decoration: underline;
  font-size: 0.8rem;
  cursor: pointer;
}



/* Tablet: 2 columns */
@media (min-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
        max-width: 90%;
    }
}

/* Desktop: 3 columns */
@media (min-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 80%;
        padding: 2rem;
    }
}

.pagination a {
    color: gray;
}

/* Desktop filters shown on md+ screens */
@media (min-width: 768px) {
  .product-wrapper {
    display: flex;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  .filters-desktop {
    margin-top: 2rem;
  }
  #desktop-filters {
    display: flex;
    margin-bottom: 1rem;
  }

  #desktop-filters .filters-wrapper-desktop {
    width: 100%;
    flex-direction: row;
    gap: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
  }

  #desktop-filters .apply-filters-btn {
    width: auto;
    padding: 0.5rem 1rem;
    align-self: flex-end;
  }
}