/* Products Container */
#products-container {
  padding: 20px;
  font-family: Arial, sans-serif;
}

/* Category Title */
.category-title {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  justify-content: center; /* Center items when fewer products */
  margin: 0 auto; /* Center the grid within the container */
  max-width: 1200px; /* Restrict grid width */
}

/* Product Card */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 300px; /* Limit width of single cards */
  margin: 0 auto; /* Center cards when fewer products */
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Product Card Image */
.product-card-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Product Card Content */
.product-card-content {
  padding: 15px;
  text-align: center;
}

.product-card-title {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  text-align: left;
}

.product-card-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: #249208;
  margin-bottom: 5px;
  text-align: left;
}

.product-card-part {
  font-size: 0.8rem;
  color: #ffffff;
  background-color: rgba(255, 0, 0, 0.418);
  
}

/* Pagination Container */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination-button {
  padding: 10px 15px;
  margin: 0 5px;
  border: none;
  border-radius: 5px;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.pagination-button.active,
.pagination-button:hover {
  background-color: #0056b3;
}

/* Error Message */
.error-message {
  color: #ff0000;
  text-align: center;
  font-size: 1.2rem;
  margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Two columns on small devices */
  }

  .product-card {
    max-width: 100%; /* Allow cards to adjust width for small screens */
  }

  .category-title {
    font-size: 1.5rem; /* Slightly smaller titles on small screens */
  }

  .pagination-button {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}

/* Ensure proper display when there are no products */
.products-grid:empty::before {
  content: "No products available.";
  display: block;
  text-align: center;
  font-size: 1.2rem;
  color: #999;
  margin: 20px 0;
}
