recently-viewed-products {
  display: block;
  direction: rtl;
  text-align: right;
}

recently-viewed-products[hidden] {
  display: none !important;
}

.rv__inner {
  width: min(calc(100% - 40px), 1400px);
  margin-inline: auto;
}

.rv__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  direction: rtl;
}

.rv__title {
  margin: 0;
  font: inherit;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 600;
}

.rv__clear {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  opacity: .65;
}

.rv__grid {
  display: grid;
  grid-template-columns: repeat(var(--rv-cols), minmax(0, 220px));
  justify-content: start;
  gap: 16px;
  direction: rtl;
}

.rv-card {
  position: relative;
  min-width: 0;
  text-align: right;
}

.rv-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.rv-card__media {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f6f4;
  border-radius: 4px;
}

.rv-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rv-card__info {
  padding-top: 10px;
  direction: rtl;
  text-align: right;
}

.rv-card__title {
  margin: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  overflow: hidden;

  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
}

.rv-card__price {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: .7;
}

.rv-card__remove {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;

  width: 32px;
  height: 32px;

  border: 0;
  border-radius: 50%;

  background: rgba(255,255,255,.95);
  color: #111;

  font-size: 20px;
  line-height: 1;

  cursor: pointer;

  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.rv-card__price {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;

  margin: 4px 0 0;

  font-size: 14px;
  line-height: 1.4;

  direction: rtl;
  opacity: .72;
}

.rv-card__riyal {
  display: inline-block;
  width: 12px;
  height: 12px;
  object-fit: contain;
  flex: 0 0 auto;
}

@media (max-width: 749px) {
  .rv__inner {
    width: calc(100% - 32px);
  }

  .rv__grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 48%;
    gap: 12px;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .rv__grid::-webkit-scrollbar {
    display: none;
  }

  .rv-card {
    scroll-snap-align: start;
  }
}