/* General Styles */
body {
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  overflow-x: hidden;
}

.footer {
  text-align: center;
  padding: 15px 0;
  background-color: #4caf50;
  color: white;
}

/* Cart Icon */
/* Cart Icon Container */
.header {
  top: 0;
  width: 100%;
  background-color: #d1fae5;
  padding: 5px 10px;
  text-align: center;
  z-index: 999;
}

.header p {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #065f46;
}
#cartIcon {
  position: absolute;
  top: 15px; /* was 16px */
  right: 16px;
  /* rest same */

  background: linear-gradient(
    135deg,
    #4caf50,
    #2e7d32
  ); /* Premium green gradient */
  color: white;
  padding: 10px 18px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 999;
}

#cartIcon:hover {
  background: linear-gradient(135deg, #43a047, #1b5e20);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(56, 142, 60, 0.5);
}

/* Cart Icon */
#cartIcon i {
  font-size: 20px;
  color: white;
}

/* "CART" Text */
.cart-text {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

/* Cart Count Badge */
#cartCount {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #ff3b3b;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.product-grid-container {
  display: flex;
  justify-content: center;
  padding: 15px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: -15px;
}

.product-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-image-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-content {
  padding: 15px;
}

.product-content h3 {
  margin: 0 0 10px;
  font-size: 1.4em;
  font-weight: 600; /* Thoda bold */
  color: #1e293b; /* Clean dark */
  margin-left: 5px;
}

.product-content p {
  margin: 5px 0;
  color: #666;
}

/* Discount Price Style */
.product-price {
  font-size: 1.5em;
  color: #333;
}

.product-price .old {
  text-decoration: line-through;
  color: #999;
  margin-right: 8px;
}

.product-price .new {
  color: #16a34a;
  font-weight: 600;
}

button {
  margin-top: 10px;
  padding: 10px 20px;
  border: none;
  color: white;
  background-color: #4caf50;
  cursor: pointer;
  border-radius: 4px;
  width: 100%;
}

/* Button Styles */
button {
  background-color: #4caf50;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%; /* Full width button */
  font-size: 17px;
  font-weight: 600;
}

button:hover {
  background-color: #45a049;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff6600, #ce664c);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  z-index: 9999;
  text-align: center;

  white-space: nowrap; /* 🟢 Force one line */
  overflow: hidden; /* 🟢 Cut overflow text */
  text-overflow: ellipsis; /* 🟢 Show "..." if too long */
  max-width: 90vw; /* 🟢 Responsive max width */
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
  margin: 20px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

/* Input and Select - Common Styles */
.filters input,
.filters select {
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f9fafb;
  flex: 0 1 auto;
}

/* Desktop View (Default) */
#searchInput {
  flex: 1 1 40%;
  min-width: 200px;
}

#sortSelect,
#categorySelect {
  flex: 0 0 auto;
  min-width: 160px;
}

@media (max-width: 768px) {
  .filters {
    margin-top: 30px;
    flex-direction: column;
    align-items: stretch;
  }

  /* Search full width */
  #searchInput {
    width: 90%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1.5px solid #d1d5db; /* subtle grey border */
    border-radius: 8px;
    background-color: #f9fafb;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    margin-bottom: 12px;
  }

  #searchInput:focus {
    border-color: #4caf50; /* green border on focus */
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
  }

  /* Put selects side by side */
  .filters-selects {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 7px;
  }

  #sortSelect,
  #categorySelect {
    flex: 0 0 48%;
    margin: 0;
  }
}

@media (max-width: 768px) {
  #cartIcon {
    margin-top: 12px;
    font-size: 20px;
  }

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

  .product-image-container {
    height: 320px; /* ✅ Increased height */
  }

  .product-image-container img {
    margin-top: 10px;
    object-fit: contain; /* ✅ Prevents cutting image */
  }

  /* Fix image overflow */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}
