/* Header & Search Section */
.products-header {
  padding: 60px 20px 40px;
  text-align: center;
  background: var(--bg-light, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.header-content h1 {
  font-size: 38px;
  font-weight: 700;
  color: var(--bg-dark, #0f172a);
  margin-bottom: 10px;
}

.header-content p {
  color: var(--text-muted, #64748b);
  font-size: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Filters Layout */
.filters {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1.5;
  min-width: 260px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted, #64748b);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  font-size: 15px;
  background: white;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Auto-suggest Dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 250px;
  overflow-y: auto;
  z-index: 100;
  text-align: left;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--bg-light, #f8fafc);
}

.suggestion-title {
  font-size: 14px;
  color: var(--text-main, #1e293b);
  font-weight: 500;
}

.suggestion-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #2563eb);
}

.select-box select {
  padding: 12px 18px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  font-size: 15px;
  background: white;
  color: var(--text-main, #1e293b);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.select-box select:focus {
  border-color: var(--primary, #2563eb);
}

/* Price Range Filter */
.price-filter-box {
  background: white;
  padding: 8px 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.price-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

.price-label strong {
  color: var(--bg-dark, #0f172a);
}

.price-filter-box input[type="range"] {
  width: 100%;
  accent-color: var(--primary, #2563eb);
  cursor: pointer;
}

/* Product Container Section */
.products-section {
  padding: 60px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

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

/* Individual Product Cards */
.product-card {
  background: white;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.product-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  background-color: #f1f5f9;
}

.product-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--bg-dark, #0f172a);
}

.product-info p {
  color: var(--text-muted, #64748b);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

.product-info .price {
  font-size: 20px;
  font-weight: 700;
  color: var(--bg-dark, #0f172a);
  margin-bottom: 20px;
}

.product-card-actions {
  display: flex;
  gap: 10px;
}

.product-card-actions a,
.product-card-actions button {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
}

.product-card-actions a {
  background: var(--bg-dark, #0f172a);
  color: white;
  text-decoration: none;
}

.product-card-actions a:hover {
  background: #1e293b;
}

.product-card-actions button {
  background: var(--primary, #2563eb);
  color: white;
}

.product-card-actions button:hover {
  background: var(--primary-hover, #1d4ed8);
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #64748b);
}

.loading-state i {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  color: var(--primary, #2563eb);
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* Responsive Overrides */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .filters {
    flex-direction: column;
  }

  .search-box,
  .select-box,
  .price-filter-box,
  .select-box select {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-section {
    padding: 40px 20px;
  }
}