.recently-viewed {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: rgba(var(--color-background));
  color: rgba(var(--color-text));
}

.recently-viewed[hidden] {
  display: none !important;
}

.recently-viewed__inner {
  display: flex;
  flex-direction: column;
  gap: inherit;
  width: 100%;
}

.recently-viewed__heading {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 300;
  line-height: 1.15;
  word-break: normal;
}

.recently-viewed__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.recently-viewed__card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

.recently-viewed__media {
  aspect-ratio: 425 / 600;
  overflow: hidden;
  background-color: rgba(var(--color-media-background));
}

.recently-viewed__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recently-viewed__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
}

.recently-viewed__price {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(var(--color-light-text));
}

@media (max-width: 989px) {
  .recently-viewed__grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 70%);
    grid-template-columns: none;
    overflow-x: auto;
    padding-block-end: 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .recently-viewed__card {
    scroll-snap-align: start;
  }
}
