// ProductListing.module.scss

.productCard {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  &:hover {
    transform: translateY(-4px);
    cursor: pointer;
  }
  @media screen and (max-width: 426px) {
    padding: 8px;
  }
}

.discountBadge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: #ff0000;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  @media screen and (max-width: 426px) {
    font-size: 12px;
  }
}
.rating {
  display: flex;
  align-items: center;
  gap: 5px;
  svg {
    fill: #facc15;
    color: #facc15;
  }
}

.imageContainer {
  // aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid #eee;
  position: relative;
}

.productImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.productInfo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.productName {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
  @media screen and (max-width: 426px) {
    font-size: 14px;
  }
}

.productDescription {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
  margin: 0;

  @media screen and (max-width: 1023px) {
    font-size: 12px;
  }
}

.priceContainer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin: 0;
  justify-content: space-between;
}

.currentPrice {
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  @media screen and (max-width: 426px) {
    font-size: 14px;
  }
}

.oldPrice {
  font-size: 12px;
  color: #d32824;
  text-decoration: line-through;
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  gap: 0.5rem;
  cursor: pointer;
  svg {
    height: 20px;
    width: 20px;
  }
}

.favoriteButton {
  height: 36px;
  display: flex;
  // margin-right: 0.5rem;
  justify-content: center;
  align-items: center;
  border-radius: 0.375rem;
  background-color: rgb(255 255 255);
  border: 1px solid rgb(237 228 255);
  svg {
    fill: #888888;
  }
}

.addToCartButton {
  height: 36px;
  display: flex;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  justify-content: center;
  align-items: center;
  border-radius: 0.25rem;
  border-width: 1px;
  width: 100%;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  transition-duration: 150ms;
  background-color: #d32824;
  border: none;
  svg {
    fill: #fff;
    @media screen and (max-width: 426px) {
      width: 16px;
      height: 16px;
    }
  }

  &:hover {
    background-color: #e86064;
    cursor: pointer;
  }
}

@media (max-width: 768px) {
  .productGrid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.quantityControls {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background-color: #d32824;
  border-radius: 5px;
  min-width: 160px;

  span {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    width: 100%;
    justify-content: center;
  }

  .quantityBtn {
    // width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    @media screen and (max-width: 720px) {
      width: auto;
    }
    svg {
      fill: #fff;
      @media screen and (max-width: 720px) {
        width: 14px;
      }
    }

    &:hover {
      background: #e86064;
      height: 100%;
    }
  }
  @media screen and (max-width: 720px) {
    width: 100%;
    min-width: 80px;
    gap: 0.5rem;
    min-height: 33px;
    height: 36px;
  }
}
.outOfStock {
  background-color: #ff4d4f;
}

.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modalButton {
  // Style for modal buttons
  padding: 6px 15px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
