.products-section {
  max-width: 1200px;
  padding: 0 20px;
  margin: 0 auto;
}

.category-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
  flex-wrap: wrap;
}

.category-breadcrumb a {
  color: #1e3a8a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.category-breadcrumb a i {
  font-size: 16px;
  line-height: 1;
  position: relative;
  top: -1.5px;
}

.category-breadcrumb a:hover {
  color: #3b82f6;
}

.category-breadcrumb span:not(:last-child) {
  color: #999;
}

.category-breadcrumb span:last-child {
  color: #666;
}

/* Header Row */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.products-section h1 {
  color: #1e3a8a;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  padding: 0;
}

.mobile-filter-btn {
  display: none;
  padding: 12px;
  background: #1e3a8a;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  transition: all 0.3s ease;
  position: fixed;
  bottom: 80px;
  right: 10px;
  z-index: 100;
}

.mobile-filter-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

/* ============= FILTERS SIDEBAR ============= */
.search-filters {
  display: none;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.filter-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: 700;
}

.close-filters-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 5px;
}

.filter-scroll-content {
  padding: 20px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group h4 {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: #555;
  font-weight: 600;
}

.filter-select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  background: white;
}

.filter-select:focus {
  border-color: #1e3a8a;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-inputs span {
  flex-shrink: 0;
  color: #666;
}

.price-input {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.price-input:focus {
  border-color: #1e3a8a;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  padding: 4px 0;
}

.filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1e3a8a;
  flex-shrink: 0;
}

.filter-checkbox span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.filter-options::-webkit-scrollbar {
  width: 6px;
}

.filter-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb {
  background: #1e3a8a;
  border-radius: 3px;
}

.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.apply-filters-btn,
.clear-filters-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.apply-filters-btn {
  background: #1e3a8a;
  color: white;
}

.apply-filters-btn:hover {
  background: #2563eb;
}

.clear-filters-btn {
  background: #f0f0f0;
  color: #555;
}

.clear-filters-btn:hover {
  background: #e0e0e0;
}

.mobile-filter-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-filter-overlay.show {
  display: block;
  opacity: 1;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card {
  background: white;
  border-radius: 3px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.product-image-container {
  width: 100%;
  height: 200px;
  position: relative;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 100px;
}

.product-name {
  font-size: 14px;
  color: #1e3a8a;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.product-description {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.product-pricing {
  margin-top: auto;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: #22c55e;
}

.product-original-price {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
}

.product-rating .stars {
  color: #fbbf24;
  display: flex;
  gap: 2px;
}

.product-rating .stars i {
  font-size: 14px;
}

.product-rating .rating-count {
  color: #666;
}

.no-products {
  text-align: center;
  padding: 60px 20px;
  color: #1e3a8a;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.no-products i {
  font-size: 48px;
  color: #1e3a8a;
}

#loading-indicator {
  text-align: center;
  padding: 30px 20px;
  margin-top: 20px;
}

.end-message {
  text-align: center;
  padding: 30px 20px;
  color: #22c55e;
  font-size: 14px;
  font-weight: 600;
}

.end-message i {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 8px;
}

/* Prevent body scroll when filters are open */
body.filters-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}


/* Mobile: 0-550px - Sticky filter buttons at bottom */
@media (max-width: 550px) {
  .products-section {
    padding: 0 10px;
  }

  .mobile-filter-btn {
    display: flex;
  }

  .products-section h1 {
    font-size: 18px;
  }

  .header-row {
    margin-bottom: 15px;
  }

  .category-breadcrumb {
    display: none;
  }

  /* Bottom Sheet Filter (Mobile) */
  .search-filters {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    max-height: 600px;
    border-radius: 20px 20px 0 0;
    z-index: 999;
    transition: bottom 0.3s ease;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  }

  .search-filters.show {
    bottom: 60px;
  }

  .filter-header {
    flex-shrink: 0;
  }

  /* Form wrapper to handle layout */
  #filterForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
  }

  .filter-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }

  .filter-group {
    margin-bottom: 18px;
  }

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

  /* Sticky buttons at bottom - ALWAYS visible */
  .filter-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    z-index: 10;
  }

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

  .product-card {
    min-height: 220px;
  }

  .product-image-container {
    height: 160px;
  }

  .product-image {
    object-fit: contain;
  }

  .product-name {
    font-size: 13px;
  }

  .product-price {
    font-size: 15px;
  }

  .product-original-price {
    font-size: 12px;
  }

  .product-info {
    padding: 10px;
    min-height: 90px;
  }

  .product-name {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .product-description {
    font-size: 11px;
    margin-bottom: 4px;
  }
}

/* Tablet: 551-600px - Sticky filter buttons at bottom */
@media (min-width: 551px) and (max-width: 600px) {
  .products-section {
    padding: 0 15px;
  }

  .mobile-filter-btn {
    display: flex;
  }

  .category-breadcrumb {
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* Bottom Sheet Filter (Tablet) */
  .search-filters {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    top: auto;
    height: 70vh;
    max-height: 600px;
    border-radius: 20px 20px 0 0;
    z-index: 999;
    transition: bottom 0.3s ease;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  }

  .search-filters.show {
    bottom: 60px;
  }

  .filter-header {
    flex-shrink: 0;
  }

  /* Form wrapper to handle layout */
  #filterForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
  }

  .filter-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    padding-bottom: 80px;
    min-height: 0;
  }

  /* Sticky buttons at bottom - ALWAYS visible */
  .filter-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    z-index: 10;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .product-card {
    min-height: 260px;
  }

  .product-image-container {
    height: 200px;
  }

  .product-image {
    object-fit: contain;
  }

  .product-name {
    font-size: 14px;
  }

  .product-price {
    font-size: 16px;
  }

  .product-info {
    padding: 12px;
    min-height: 95px;
  }

  .product-name {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .product-description {
    font-size: 12px;
    margin-bottom: 4px;
  }
}

/* Tablet larger: 601-767px - Bottom 0 */
@media (min-width: 601px) and (max-width: 767px) {
  .products-section {
    padding: 0 15px;
  }

  .mobile-filter-btn {
    display: flex;
  }

  .category-breadcrumb {
    font-size: 14px;
    margin-bottom: 6px;
  }

  /* Bottom Sheet Filter (Tablet) */
  .search-filters {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    top: auto;
    height: 70vh;
    max-height: 600px;
    border-radius: 20px 20px 0 0;
    z-index: 999;
    transition: bottom 0.3s ease;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  }

  .search-filters.show {
    bottom: 0;
  }

  .filter-header {
    flex-shrink: 0;
  }

  /* Form wrapper to handle layout */
  #filterForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
  }

  .filter-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    padding-bottom: 80px;
    min-height: 0;
  }

  /* Sticky buttons at bottom - ALWAYS visible */
  .filter-buttons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
    z-index: 10;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .product-card {
    min-height: 260px;
  }

  .product-image-container {
    height: 200px;
  }

  .product-image {
    object-fit: contain;
  }

  .product-name {
    font-size: 14px;
  }

  .product-price {
    font-size: 16px;
  }

  .product-info {
    padding: 12px;
    min-height: 75px;
  }
}

/* Desktop: 768px+ - Sidebar filter with 4 items per row */
@media (min-width: 768px) {
  .mobile-filter-btn {
    display: none;
  }

  .products-section {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
  }

  .category-breadcrumb,
  .header-row {
    grid-column: 1 / -1;
  }

  /* Sidebar Filter (Desktop) */
  .search-filters {
    display: flex;
    flex-direction: column;
    width: 260px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 100px);
    overflow: hidden;
  }

  .filter-header {
    flex-shrink: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
  }

  .filter-header h3 {
    font-size: 17px;
  }

  .close-filters-btn {
    display: none;
  }

  #filterForm {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .filter-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
  }

  .filter-scroll-content::-webkit-scrollbar {
    width: 6px;
  }

  .filter-scroll-content::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

  .filter-scroll-content::-webkit-scrollbar-thumb {
    background: #1e3a8a;
    border-radius: 3px;
  }

  .filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    margin: 0;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
  }

  .products-grid-wrapper {
    grid-column: 2;
    min-height: 400px;
  }

  #loading-indicator,
  .end-message {
    grid-column: 2;
  }

  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .product-card {
    min-height: 280px;
  }

  .product-image-container {
    height: 220px;
  }

  .product-name {
    font-size: 14px;
  }

  .product-info {
    padding: 12px;
    gap: 8px;
    min-height: 100px;
  }

  .product-name {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .product-description {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .product-price {
    font-size: 16px;
  }

  .product-original-price {
    font-size: 13px;
  }

  .products-section h1 {
    font-size: 22px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}