/* Product styles */
:root {
  --primary-color: #3cc4fa;
  --primary-dark: #32b1e0;
  --secondary-color: #1a237e;
  --text-color: #333;
  --light-bg: #f3f3f3;
  --border-color: #e0e0e0;
  --white: #fff;
}

.product-container {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.product-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.product-details {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-color);
  word-break: break-word;
}

.price-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.price-before {
  font-size: 14px;
  color: #888;
  text-decoration: line-through;
  margin-right: 10px;
}

.price-now {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
}

.items-left {
  font-size: 14px;
  color: #e53935;
  margin-bottom: 10px;
}

.product-rating {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.rating-stars {
  height: 18px;
  margin-right: 8px;
}

.rating-number {
  font-size: 14px;
  color: #666;
}

.show-added-to-cart-css {
  display: none;
  color: #388e3c;
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 500;
}

.show-added-to-cart-css.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.quantity-selector {
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  flex: 0 0 70px;
}

.add-to-cart-btn {
  flex: 1;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-to-cart-btn:hover {
  background-color: var(--primary-dark);
}

/* Responsive design for products */
@media (max-width: 1024px) {
  .product-image {
    height: 200px;
  }
}

@media (max-width: 768px) {
  .product-image {
    height: 180px;
  }
  
  .product-name {
    font-size: 16px;
  }
  
  .price-now {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .product-container {
    display: grid;
    grid-template-columns: 120px 1fr;
    grid-template-rows: auto;
  }
  
  .product-image {
    height: 100%;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    grid-row: span 1;
  }
  
  .product-details {
    padding: 10px;
    display: flex;
    flex-direction: column;
  }
  
  .product-name {
    font-size: 15px;
    margin-bottom: 5px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .price-container {
    margin-bottom: 5px;
  }
  
  .price-before {
    font-size: 12px;
  }
  
  .price-now {
    font-size: 14px;
  }
  
  .items-left, .rating-number {
    font-size: 12px;
  }
  
  .product-rating {
    margin-bottom: 8px;
  }
  
  .cart-actions {
    gap: 5px;
  }
  
  .quantity-selector {
    flex: 0 0 50px;
    padding: 5px;
    font-size: 13px;
  }
  
  .add-to-cart-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .product-container {
    grid-template-columns: 100px 1fr;
  }
  
  .product-image {
    max-height: 140px;
  }
  
  .product-details {
    padding: 8px;
  }
  
  .product-name {
    font-size: 14px;
  }
  
  .price-before {
    font-size: 11px;
  }
  
  .price-now {
    font-size: 13px;
  }
  
  .items-left {
    font-size: 11px;
    margin-bottom: 5px;
  }
  
  .product-rating {
    margin-bottom: 5px;
  }
  
  .rating-stars {
    height: 15px;
  }
  
  .rating-number {
    font-size: 11px;
  }
  
  .show-added-to-cart-css {
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .cart-actions {
    flex-direction: row;
    align-items: center;
  }
  
  .quantity-selector {
    flex: 0 0 40px;
    padding: 3px;
    font-size: 12px;
  }
  
  .add-to-cart-btn {
    padding: 5px 8px;
    font-size: 12px;
  }
}

/* Fix for product images on small screens */
@media (max-width: 380px) {
  .product-container {
    grid-template-columns: 85px 1fr;
  }
  
  .product-image {
    max-height: 120px;
  }
}