/* Product Grid Section */
.product-grid-section {
  padding: 2rem;
}

.product-grid-section h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #3D4390;
  text-align: center;
}

/* Grid Layout */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

/* Card Link Wrapper */
.product-card {
  flex: 1 1 calc(25% - 1.5rem);
  /* 4 cards per row */
  text-decoration: none;
  color: inherit;
  display: flex;
}

/* Product Card */
.product-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  min-height: 360px;
}

.price small {
  font-size: 0.7rem;
  font-weight: 100;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product Image */
.product-card img {
  width: 80%;
  max-width: 200px;
  margin: 0 auto 1rem;
  object-fit: contain;
}

/* Product Name */
.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

/* Product Number */
.product-card .product-number {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Product Price */
.product-card .price {
  font-size: 1rem;
  font-weight: bold;
  color: #3D4390;
  margin-top: auto;
}

.cart-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cart-controls input.quantity {
  width: 60px;
  text-align: center;
  padding: 0.3rem;
  font-size: 1rem;
}

.cart-controls button {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.cart-controls .increase,
.cart-controls .decrease {
  background-color: #eee;
  color: #333;
}

.cart-controls .add-to-cart {
  background-color: #3D4390;
  color: #fff;
  font-weight: bold;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card-link img,
.product-card-link h3 {
  cursor: pointer;
}

.stock-status {
  font-weight: 500;
  margin-top: 4px;
}

.stock-status.text-success {
  color: #198754;
  /* Bootstrap green */
}

.stock-status.text-danger {
  color: #dc3545;
  /* Bootstrap red */
}


/* Responsive Layout */
@media (max-width: 1024px) {
  .product-card {
    flex: 1 1 calc(33.33% - 1.5rem);
  }
}

@media (max-width: 768px) {
  .product-card {
    flex: 1 1 calc(50% - 1.5rem);
  }
}

@media (max-width: 480px) {
  .product-card {
    flex: 1 1 100%;
  }
}

.product-card img.bestseller-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 90px;
  z-index: 10;
}