/* ===== PRODUCT LIST PAGE SPECIFIC STYLES ===== */

/* Product List Header Section */
.product-list-header-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 3rem 0;
}

.product-list-header-section .main-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--color-dark);
  margin: 0;
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-description {
  color: var(--color-gray);
  margin-top: var(--spacing-sm);
  font-size: 1.1rem;
  line-height: 1.6;
}

.breadcrumb {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--color-gray);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-secondary);
}

.breadcrumb .active {
  color: var(--color-dark);
  font-weight: 500;
}

/* ===== PRODUCT LIST CONTENT SECTION ===== */
.product-list-content-section {
  background-color: var(--color-light-gray);
  padding: 3rem 0;
}

/* ===== FILTERS SIDEBAR ===== */
.filters-sidebar {
  background: #ffffff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 100px;
  transition: all 0.3s ease;
}

.filters-sidebar:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.filter-header {
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f1f3f4;
  margin-bottom: 1.5rem;
}

.filter-header h3 {
  font-weight: 700;
  color: #2d3748;
  margin: 0;
  font-size: 1.4rem;
}

.filter-group {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.3s ease;
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-group:hover {
  transform: translateX(5px);
}

.filter-title {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-title::before {
  content: "▸";
  color: var(--color-secondary);
  font-size: 1.2rem;
}

/* Search Filter */
.search-filter {
  position: relative;
}

.search-filter .form-control {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.search-filter .form-control:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #ffffff;
}

.search-filter .search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-secondary);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-filter .search-btn:hover {
  background: var(--color-primary);
  transform: translateY(-50%) scale(1.05);
}

/* Price Filter */
.price-inputs {
  gap: 12px;
  margin-bottom: 1.5rem;
}

.price-inputs .form-control {
  text-align: center;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  font-weight: 600;
  background: #fafbfc;
  transition: all 0.3s ease;
}

.price-inputs .form-control:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.price-slider {
  position: relative;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 10px;
  margin: 2rem 0;
}

.slider-track {
  position: absolute;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  border-radius: 10px;
  z-index: 1;
}

.slider-min,
.slider-max {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 0;
  -webkit-appearance: none;
  background: none;
  pointer-events: none;
  z-index: 2;
}

.slider-min::-webkit-slider-thumb,
.slider-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--color-secondary);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.slider-min::-webkit-slider-thumb:hover,
.slider-max::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.price-values {
  font-size: 0.9rem;
  color: var(--color-gray);
  font-weight: 600;
}

/* Filter Options */
.category-filter,
.metal-filter,
.gemstone-filter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.form-check:hover {
  background: #f7fafc;
  transform: translateX(5px);
}

.form-check-input {
  margin: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e0;
  transition: all 0.3s ease;
}

.form-check-input:checked {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.form-check-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.95rem;
  color: #4a5568;
  font-weight: 500;
  cursor: pointer;
}

.count {
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  min-width: 40px;
  text-align: center;
}

/* Apply Filters Button */
.apply-filters {
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.apply-filters:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* ===== PRODUCTS GRID SECTION - 3 PRODUCTS PER ROW ===== */
.products-grid-section {
  padding-left: 2rem;
}

.products-header {
  background: #ffffff;
  padding: 1.5rem 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.results-info p {
  margin: 0;
  color: #4a5568;
  font-size: 1rem;
  font-weight: 500;
}

.results-count,
.total-count {
  color: var(--color-secondary);
  font-weight: 700;
}

.sort-options {
  gap: 12px;
  align-items: center;
}

.sort-options span {
  font-size: 0.95rem;
  color: #4a5568;
  font-weight: 500;
}

.sort-options .form-select {
  width: auto;
  font-size: 0.95rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.5rem 2rem 0.5rem 1rem;
  background: #fafbfc;
  transition: all 0.3s ease;
}

.sort-options .form-select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Active Filters */
.active-filters {
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.active-filter {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.9rem;
  color: white;
  font-weight: 500;
  margin: 0.25rem;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.remove-filter {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  margin-left: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.remove-filter:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ===== PRODUCTS GRID - 3 PRODUCTS PER ROW ===== */
.products-grid {
  margin-top: 1rem;
  width: 100%;
}

/* 3-Column Grid System */
.row.g-4 {
  margin: 0 -12px;
  display: flex;
  flex-wrap: wrap;
}

/* 3 products per row on large screens */
.row.g-4 > .col-xl-4 {
  padding: 12px;
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

/* 2 products per row on medium screens */
.row.g-4 > .col-lg-6 {
  padding: 12px;
  flex: 0 0 50%;
  max-width: 50%;
}

/* 2 products per row on small screens */
.row.g-4 > .col-md-6 {
  padding: 12px;
  flex: 0 0 50%;
  max-width: 50%;
}

/* 1 product per row on extra small screens */
.row.g-4 > .col-sm-12 {
  padding: 12px;
  flex: 0 0 100%;
  max-width: 100%;
}

/* Product Cards for 3-Column Layout */
.product-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  backdrop-filter: blur(10px);
  margin-bottom: 0;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.product-card:hover::before {
  transform: scaleX(1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-img {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.4s ease;
  max-height: 180px;
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

/* ===== FIXED ACTION BUTTONS - UPDATED ===== */
.product-actions {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0 10px;
  box-sizing: border-box;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translateY(0);
}

.product-action-btn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 18px;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #2d3748;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  max-width: 120px;
  justify-content: center;
}

.product-action-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  font-size: 0.65rem;
}

.product-action-btn i {
  flex-shrink: 0;
  font-size: 0.65rem;
}

.product-action-btn:hover {
  background: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Enhanced Quick View */
.quick-view {
  position: absolute;
  top: 15px;
  right: 15px;
  opacity: 0;
  transition: all 0.3s ease;
}

.product-card:hover .quick-view {
  opacity: 1;
}

.quick-view-btn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #2d3748;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-view-btn i {
  font-size: 0.6rem;
}

.quick-view-btn:hover {
  background: var(--color-primary);
  color: white;
}

/* Badge Styles */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  font-size: 0.7rem;
  padding: 0.4rem 0.8rem;
  border-radius: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.badge-limited {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
}

.badge-exclusive {
  background: linear-gradient(135deg, #4834d4, #686de0);
  color: white;
}

.badge-standard {
  background: linear-gradient(135deg, #00d2d3, #54a0ff);
  color: white;
}

/* Enhanced Product Info for 3-Column Layout */
.product-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #2d3748;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}

.price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e53e3e;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #e53e3e, #ed8936);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rating {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 2px;
}

.rating i {
  font-size: 0.9rem;
}

.description {
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
  min-height: 2.4em;
}

.specifications {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.specifications small {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
}

/* Enhanced Product Footer for 3-Column Layout */
.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f3f4;
}

.stock-status {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.stock-status.text-success {
  color: #38a169;
}

.stock-status.text-danger {
  color: #e53e3e;
}

.add-to-compare {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.75rem;
  color: #4a5568;
  transition: all 0.3s ease;
}

.add-to-compare:hover {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
  transform: scale(1.05);
}

/* ===== PAGINATION ===== */
.products-pagination {
  margin-top: 3rem;
}

.products-pagination .pagination {
  margin: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.products-pagination .page-link {
  border: 2px solid #e2e8f0;
  color: #4a5568;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  background: #ffffff;
}

.products-pagination .page-link:hover {
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  border-color: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.products-pagination .page-item.active .page-link {
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  border-color: var(--color-secondary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* ===== LOADING AND ERROR STATES ===== */
.loading-state,
.error-state,
.auth-state,
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.loading-state i,
.error-state i,
.auth-state i,
.empty-state i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.loading-state i {
  color: var(--color-secondary);
}

.error-state i {
  color: #e53e3e;
}

.auth-state i {
  color: #cbd5e0;
}

.empty-state i {
  color: #cbd5e0;
}

.loading-state h4,
.error-state h3,
.auth-state h3,
.empty-state h3 {
  color: #4a5568;
  margin-bottom: 1rem;
  font-weight: 600;
}

.loading-state p,
.error-state p,
.auth-state p,
.empty-state p {
  color: #718096;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ===== RESPONSIVE STYLES FOR 3-COLUMN LAYOUT ===== */
@media (max-width: 1200px) {
  .product-list-header-section .main-heading {
    font-size: 2.2rem;
  }

  .products-grid-section {
    padding-left: 1rem;
  }

  .product-info {
    padding: 1rem;
  }

  .product-title {
    font-size: 0.95rem;
  }

  .price {
    font-size: 1.1rem;
  }

  .product-action-btn {
    padding: 7px 10px;
    font-size: 0.65rem;
    max-width: 110px;
  }

  .product-action-btn span {
    font-size: 0.65rem;
  }
}

@media (max-width: 992px) {
  .product-list-header-section {
    padding: 2rem 0;
  }

  .product-list-header-section .main-heading {
    font-size: 2rem;
  }

  .products-grid-section {
    padding-left: 0;
    margin-top: 2rem;
  }

  .filters-sidebar {
    position: static;
    margin-bottom: 2rem;
  }

  .products-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem;
  }

  .sort-options {
    justify-content: center;
  }

  /* Switch to 2 columns on tablets */
  .row.g-4 > .col-xl-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .product-actions {
    opacity: 1;
    transform: translateY(0);
    position: static;
    margin-top: 0.75rem;
    padding: 0 5px;
  }

  .product-action-btn {
    max-width: 130px;
    font-size: 0.7rem;
    padding: 8px 12px;
  }

  .quick-view {
    opacity: 1;
    position: static;
    margin-top: 0.5rem;
  }

  .quick-view-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.7rem;
    padding: 8px 12px;
  }
}

/* No Results & Top Products Styling */
.empty-state {
  padding: 3rem 0;
}

.empty-state i {
  opacity: 0.7;
}

.top-products-section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #eee;
}

.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  max-width: 600px;
  margin: 0 auto;
}

.know-more-btn.clear-filters {
  background: #dc3545;
  border-color: #dc3545;
}

.know-more-btn.clear-filters:hover {
  background: #c82333;
  border-color: #bd2130;
}

/* Loading states */
.loading-state,
.error-state,
.auth-state {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .product-list-content-section {
    padding: 2rem 0;
  }

  .product-list-header-section .main-heading {
    font-size: 1.8rem;
  }

  .page-description {
    font-size: 1rem;
  }

  .filters-sidebar {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .products-header {
    padding: 1.25rem;
  }

  .product-info {
    padding: 1rem;
  }

  .price {
    font-size: 1.1rem;
  }

  /* Enhanced Pagination Styles */
  .products-pagination {
    margin-top: 3rem;
  }

  .products-pagination .pagination {
    margin: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .products-pagination .page-link {
    border: 2px solid #e2e8f0;
    color: #4a5568;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #ffffff;
    min-width: 50px;
    text-align: center;
  }

  .products-pagination .page-link:hover {
    background: linear-gradient(
      135deg,
      var(--color-secondary),
      var(--color-primary)
    );
    border-color: var(--color-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  }

  .products-pagination .page-item.active .page-link {
    background: linear-gradient(
      135deg,
      var(--color-secondary),
      var(--color-primary)
    );
    border-color: var(--color-secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  }

  .products-pagination .page-item.disabled .page-link {
    background: #f7fafc;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  /* Remove infinite scroll styles */
  .infinite-scroll-loader,
  .end-of-results {
    display: none !important;
  }

  /* Maintain 2 columns on small screens */
  .row.g-4 > .col-xl-4,
  .row.g-4 > .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .product-img {
    padding: 12px;
  }

  .product-title {
    font-size: 0.9rem;
    min-height: auto;
  }

  .description {
    min-height: auto;
    -webkit-line-clamp: 2;
  }

  .product-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .product-actions {
    flex-direction: row;
    gap: 6px;
    padding: 0 10px;
  }

  .product-action-btn {
    flex: 1;
    max-width: none;
    font-size: 0.65rem;
    padding: 6px 8px;
  }

  .product-action-btn span {
    font-size: 0.65rem;
  }
}

@media (max-width: 576px) {
  .product-list-header-section {
    padding: 1.5rem 0;
    text-align: center;
  }

  .product-list-header-section .main-heading {
    font-size: 1.6rem;
  }

  .filters-sidebar {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .filter-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .price-inputs {
    flex-direction: column;
  }

  .products-header {
    padding: 1rem;
  }

  .sort-options {
    flex-direction: column;
    width: 100%;
  }

  .sort-options .form-select {
    width: 100%;
  }

  .product-card {
    margin-bottom: 1.5rem;
  }

  .products-pagination .page-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Switch to 1 column on mobile */
  .row.g-4 > .col-xl-4,
  .row.g-4 > .col-lg-6,
  .row.g-4 > .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .product-img {
    padding: 15px;
  }

  .product-info {
    padding: 1.25rem;
  }

  .product-actions {
    flex-direction: column;
    gap: 6px;
    padding: 0 15px;
  }

  .product-action-btn {
    width: 100%;
    max-width: none;
    font-size: 0.7rem;
    padding: 8px 12px;
    justify-content: center;
  }

  .product-action-btn span {
    font-size: 0.7rem;
  }

  .badge {
    top: 10px;
    left: 10px;
    font-size: 0.65rem;
    padding: 0.35rem 0.7rem;
  }
}

/* Smooth transitions for filter changes */
.products-grid-section {
  transition: opacity 0.3s ease;
}

.products-grid-section.loading {
  opacity: 0.7;
}

/* Ensure proper spacing */
.mb-4 {
  margin-bottom: 1.5rem !important;
}

.g-4 {
  gap: 1.5rem !important;
}

/* ===== FORCE 3 PRODUCTS PER ROW - OVERRIDE COMMON.CSS ===== */

/* Override the common.css grid system */
.products-grid .row.g-4 {
  display: flex !important;
  flex-wrap: wrap !important;
  margin: 0 -12px !important;
}

/* Force 3 columns on large screens */
.products-grid .row.g-4 > [class*="col-"] {
  padding: 12px !important;
}

.products-grid .row.g-4 > .col-xl-4,
.products-grid .row.g-4 > .col-xl-6,
.products-grid .row.g-4 > .col-lg-4,
.products-grid .row.g-4 > .col-lg-6,
.products-grid .row.g-4 > .col-md-6,
.products-grid .row.g-4 > .col-sm-12 {
  flex: 0 0 33.333% !important;
  max-width: 33.333% !important;
}

/* Medium screens (992px-1199px) - 2 products per row */
@media (max-width: 1199px) {
  .products-grid .row.g-4 > .col-xl-4,
  .products-grid .row.g-4 > .col-xl-6,
  .products-grid .row.g-4 > .col-lg-4,
  .products-grid .row.g-4 > .col-lg-6,
  .products-grid .row.g-4 > .col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

/* Small screens (768px-991px) - 2 products per row */
@media (max-width: 991px) {
  .products-grid .row.g-4 > .col-xl-4,
  .products-grid .row.g-4 > .col-xl-6,
  .products-grid .row.g-4 > .col-lg-4,
  .products-grid .row.g-4 > .col-lg-6,
  .products-grid .row.g-4 > .col-md-6 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

/* Mobile screens (<768px) - 1 product per row */
@media (max-width: 767px) {
  .products-grid .row.g-4 > .col-xl-4,
  .products-grid .row.g-4 > .col-xl-6,
  .products-grid .row.g-4 > .col-lg-4,
  .products-grid .row.g-4 > .col-lg-6,
  .products-grid .row.g-4 > .col-md-6,
  .products-grid .row.g-4 > .col-sm-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* Ensure product cards display properly */
.products-grid .product-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

/* Make sure the container is properly structured */
.products-grid-section .products-grid {
  width: 100% !important;
}

/* Override any Bootstrap container issues */
#productsContainer.row.g-4 {
  display: flex !important;
  flex-wrap: wrap !important;
  margin: 0 -12px !important;
}

/* ===== INFINITE SCROLL STYLES ===== */
.infinite-scroll-loader {
  text-align: center;
  padding: 2rem;
  display: none;
}

.infinite-scroll-loader.show {
  display: block;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.end-of-results {
  text-align: center;
  padding: 2rem;
  color: var(--color-gray);
  font-style: italic;
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}

.end-of-results i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

/* Smooth animations for new products */
.products-grid .product-card {
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
