a {
  text-decoration: none;
}

body {
  background: #f5f5f5;
}

.container {
  max-width: 1650px;
  margin: 0 auto;
  padding: 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: Arial, sans-serif;
}

.product-image-container {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image:hover {
  scale: 1.01;
  transition: 0.3s;
}

.smth {
  background: #ef4444;
  overflow: hidden;
}

:root {
  --heart-color: gray;
  --heart-active-color: red;
}

.so {
  background: transparent;
  border: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
}

.heart {
  /* filter: invert(1); */
  fill: none;
  cursor: pointer;
  transition: filter 0.3s ease;
  width: 30px;
  height: 30px;
}

.heart.inverted {
  filter: invert(0);
  transform: scale(1.1);
}

.flex {
  display: flex;
  justify-content: space-between;
}

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ef4444;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
}

.product-info {
  padding: 12px;
}

.product-title {
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
  height: 32px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sale-badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}


.price-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
}

.old-price {
  color: #6b7280;
  text-decoration: line-through;
  font-size: 12px;
}

.new-price {
  color: #ef4444;
  font-weight: bold;
  font-size: 16px;
}

.flex {
  display: flex;
  justify-content: space-between;
}

.add-to-cart {
  /* width: 100%; */
  background: transparent;
  border-radius: 180in;
  border: #4b5563 solid 1px;
  color: white;
  padding: 8px;
  /* border-radius: 4px; */
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 8px;
  font-size: 13px;
}

.add-to-cart img {
  height: 20px;
  width: 20px;
}

.add-to-cart:hover {
  background: #e1e1e2;
}

.category-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 20px 0;
  position: relative;
}

.category-header::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, #e5e7eb, #ffffff);
}

.category-title {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  position: relative;
}

.category-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: #ef4444;
  border-radius: 2px;
}

.products-count {
  margin: 20px 0;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.sort-container {
  position: relative;
  z-index: 100;
}

.sort-button {
  padding: 10px 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
  transition: all 0.2s ease;
}

.sort-button:hover {
  border-color: #d1d5db;
  background: #f9fafb;
}

.sort-button svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.sort-button.active svg {
  transform: rotate(180deg);
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  display: none;
  min-width: 200px;
  padding: 6px;
}

.sort-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sort-option {
  padding: 8px 12px;
  cursor: pointer;
  color: #4b5563;
  font-size: 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-option:hover {
  background: #f3f4f6;
  color: #000;
}

.sort-option.active {
  background: #ef44441a;
  color: #ef4444;
}

.sort-option svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sort-option.active svg {
  opacity: 1;
}

.products-grid {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .sort-container {
    width: 100%;
  }

  .sort-button {
    width: 100%;
    justify-content: space-between;
  }

  .sort-dropdown {
    width: 100%;
  }
}
