.category-title {
  width: 100%;
  text-align: right;
  font-size: 3rem;
  color: white;
  margin-top: 50px;
  padding: 20px 50px;
  border-radius: 12px;
  background: linear-gradient(90deg, #007bff, #138615, #00c6ff, #ff416c);
  background-size: 400% 400%;
  animation: gradientBG 20s ease infinite;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.card-container {
  margin: 10px;
  min-height: 300px;
}

.category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 12px;
  box-sizing: border-box;
}

.category-row .card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  flex: 0 0 calc(16.666% - 20px);
  margin: 0 8px;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 240px;
  max-width: 280px;
  height: 450px;
  padding: 16px;
}


.card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  text-align: right;
  direction: rtl;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  min-height: 3.2em;
}

.sell-price {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin-right: 20px;
}

.card-sell-price {
  font-size: 1rem;
  color: #948484;
}

.card-price {
  font-size: 1.5rem;
  color: #414141;
  display: flex;
  justify-content: space-evenly;
  margin: 20px auto;
}

.category-row .card_action{
  padding: 10px 15px;
  margin-bottom: 10px;
  text-align: center;
  position: absolute;
  display: block;
  font-size: 16px;
  border-radius: 10%;
  transition: all 0.5s ease;
  top: 7%;
  left: -20%;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.category-row .card:hover .card_action {
  opacity: 1;
  left: 10%;
  transition: all 0.5s ease 0s;
  pointer-events: auto;
}

.category-row .card:hover .icon {
  border: 3px solid #002aff;
  cursor: pointer;
}

.category-row .card:hover {
  border: 3px solid #0000ff;
}

.add-to-cart {
  border: none;
  border-radius: 50%;
}

.category-row .card_action .icon {
  background: #ffeeeecc;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;

}

.card_action span:active {
  transform: translateY(-55%) scale(0.85);
}

.category-row .discount-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.category-row .discount-button button {
  background: #ff5722;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: bold;
}

.discount-percentage {
  position: absolute;
  top: 200px;
  left: -120px;
  background: #4CAF50;
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: bold;
  z-index: 5;
}

.sorting-options {
  display: flex;
  width: fit-content;
  margin-right: 40px;
  white-space: nowrap;

}

.sort-title {
  display: flex;
  align-items: center;
}

.sorting-items {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: fit-content;
  font-size: 1rem;
  margin-bottom: 20px;
  margin-top: 20px;
}

.sorting-items a {
  padding: 1% 4%;
  border-radius: 10px;
}

.sorting-options a.active {
  font-weight: bold;
  color: #007bff;
  text-decoration: underline;
  text-underline-offset: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  padding: 10px;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 2px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination .current {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
  cursor: default;
}

.pagination a:hover {
  background-color: #f0f0f0;
  color: #007bff;
}

.pagination span {
  padding: 8px 12px;
  color: #999;
  cursor: default;
}

.pagination a:first-child,
.pagination a:last-child {
  font-weight: bold;
  padding: 8px 16px;
}

.pagination a.disabled {
  pointer-events: none;
  background-color: #f0f0f0;
  color: #ccc;
  border-color: #ddd;
}

.out-of-stock {
  color: #ff5722;
  margin-right: 40%;
}



@media (max-width: 1023px) {
  .category-title {
    font-size: 1.3rem;
    margin-top: 10px;
    padding: 15px 40px;
  }

  .sorting-items {
    width: 100vw !important;
    max-width: 100vw !important;
    justify-content: flex-start;
margin-top: 8px;
font-size: 0.7rem;
flex-wrap: wrap;
  }

  .sorting-options {
    max-width: 100vw;
    overflow: hidden;
    margin-right: 10px;

  }

  .sorting-items a {
    padding: 5px 5px;

  }

  .category-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 10px;
  }

  .category-row .card {
    width: 100%;
    height: auto;
    min-height: 340px;
    padding: 12px;
    margin: 0 !important;
    min-width: auto !important;
    max-width: none !important;
  }

  .card-img {
    height: 160px;
    margin-bottom: 12px;
  }

  .card-title {
    font-size: 1.05rem;
    min-height: 2.6em;
  }
  .category-row .card:hover {
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }


  .sell-price {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-direction: column;
    margin-right: 0px;
  }

  .discount-percentage {

    top: 150px;
    left: -72px;

  }

  .card-price {
    margin: 0 auto;

    text-align: center;
    margin-top: 2px;
  }

  .card-sell-price {
    margin-top: 2px;
  }

  .category-row .discount-button {

    right: 1px;

  }
  .category-row .card_action {
    top: 7%;
    left: 0;
    opacity: 1;
}

.category-row .discount-button button {

    font-size: 0.6rem;

}
.category-row .card_action .icon {

    font-size: 1.2rem;
}
}