.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fafafa;
}

.shop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.search-form {
  display: flex;
  align-items: center;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  flex: 0 1 350px;
}

.search-form:focus-within {
  border-color: #FF4B2B;
  box-shadow: 0 0 0 2px rgba(255, 75, 43, 0.1);
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  border: none;
  outline: none;
  color: #333;
}

.search-button {
  padding: 12px 20px;
  background: #FF4B2B;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-button:hover {
  background: #FF416C;
}

.sort-dropdown {
  padding: 12px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: white;
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.sort-dropdown:hover {
  border-color: #FF4B2B;
}

.product-list-container {
  display: flex;
  gap: 30px;
  width: 100%;
  min-height: 800px;
}

.sidebar {
  flex: 0 0 250px;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  height: fit-content;
}

.clear-filter-btn {
  display: block;
  width: 90%;
  padding: 12px;
  background: #FF4B2B;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.clear-filter-btn:hover {
  background: #FF416C;
}

.product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 columns per row */
  grid-template-rows: repeat(2, auto); /* 2 rows */
  gap: 25px;
  align-items: start;
  min-height: 800px;
  align-content: flex-start;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}

.product-card {
  height: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.product-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}
.product-price .offer-percentage {
  color: #e91e63;
  font-size: 12px;
  margin-left: 5px;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #e91e63;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.product-price .offer-percentage {
color: #e91e63;
font-size: 12px;
margin-left: 5px;
}

.product-badge {
position: absolute;
top: 10px;
left: 10px;
background-color: #e91e63;
color: white;
padding: 2px 8px;
border-radius: 3px;
font-size: 12px;
}

.product-brand {
font-size: 16px;
color: red;
display: block;
margin-bottom: 5px;
}

.product-img .primary-img {
  opacity: 1;
  z-index: 2;
}

.product-img .hover-img {
  opacity: 0;
  z-index: 1;
}

.product-img:hover .primary-img {
  opacity: 0;
}

.product-img:hover .hover-img {
  opacity: 1;
}

.product-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-name {
  color: #333;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.original-price {
  text-decoration: line-through;
  color: #888;
  font-size: 0.9em;
}

.sale-price {
  color: #FF4B2B;
  font-weight: 600;
  font-size: 1.1em;
}

.filter-section {
  margin-bottom: 30px;
}

.filter-title {
  color: #333;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

.filter-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item a {
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 18px;
  padding: 6px 0;
  display: block;
}

.filter-item a:hover {
  color: #FF4B2B;
  padding-left: 5px;
}

.price-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price-button {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #e0e0e0;
  color: #666;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  text-align: center;
}

.price-button:hover {
  background: #FF4B2B;
  color: white;
  border-color: #FF4B2B;
}

.add-to-cart-btn {
  margin-top: auto;
  width: 100%;
  padding: 12px;
  background: linear-gradient(45deg, #FF416C, #FF4B2B);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  opacity: 0.95;
}

.add-to-cart-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.add-to-cart-btn.out-of-stock {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.add-to-cart-btn.out-of-stock:hover {
  transform: none;
}

.wishlist-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  z-index: 10;
}

.product-card:hover .wishlist-btn {
  opacity: 1;
}

.wishlist-btn:hover {
  background: #FF4B2B;
  color: #fff;
}

.wishlist-btn.active {
  background: #FF4B2B;
  color: #fff;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #e91e63;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  z-index: 10;
}

.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.no-products h3 {
  color: #666;
  font-size: 1.2em;
}

.pagination {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 0;
}

.page-link {
  padding: 8px 15px;
  background-color: #fff;
  color: #FF4B2B;
  text-decoration: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.page-link:hover:not(.disabled):not(.active) {
  background-color: #FF4B2B;
  color: #fff;
  border-color: #FF4B2B;
}

.page-link.active {
  background-color: #FF4B2B;
  color: #fff;
  border-color: #FF4B2B;
  font-weight: 600;
}

.page-link.disabled {
  color: #999;
  cursor: not-allowed;
  background-color: #f5f5f5;
  border-color: #e0e0e0;
}

@keyframes wishlistPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.wishlist-btn.animate {
  animation: wishlistPulse 0.5s ease;
}

@media (max-width: 768px) {
  .shop-topbar {
      flex-direction: column;
      gap: 20px;
      align-items: stretch;
  }

  .search-form {
      flex: none;
      width: 100%;
  }

  .sort-dropdown {
      width: 100%;
  }

  .product-list-container {
      flex-direction: column;
      min-height: 600px;
  }

  .sidebar {
      width: 100%;
      margin-bottom: 20px;
  }

  .product-grid {
      grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller screens */
      grid-template-rows: auto; /* Flexible rows */
      min-height: 600px;
  }
}

@media (max-width: 480px) {
  .product-grid {
      grid-template-columns: 1fr; /* 1 column on very small screens */
      grid-template-rows: auto;
  }

  .product-img-wrapper {
      height: 180px;
  }
}