.recently-viewed-section {
  background-color: rgb(var(--color-background));
  --container-padding-top: 60px;
  --container-padding-bottom: 60px;
  --container-padding-right: 20px;
  --container-padding-left: 20px;
  --container-max-width: 1600px;
}

.recently-viewed-section .recently-viewed-container {
  margin: 0 auto;
  max-width: calc(var(--container-max-width) + var(--container-padding-left) + var(--container-padding-right));
  padding: var(--container-padding-top) var(--container-padding-right) var(--container-padding-bottom) var(--container-padding-left);
  width: 100%;
}

.recently-viewed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.recently-viewed__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.recently-viewed__title {
  margin: 0;
  color: rgb(var(--color-foreground));
  font-family: var(--sort-title-font);
  font-style: var(--sort-title-font-style);
  font-weight: var(--sort-title-font-weight, 700);
  line-height: var(--sort-title-line-height);
  text-transform: var(--sort-title-text-transform);
  letter-spacing: var(--sort-title-letter-spacing);
}

.recently-viewed__title.title1 {
  font-size: var(--title1-font-size);
}

.recently-viewed__title.title2 {
  font-size: var(--title2-font-size);
}

.recently-viewed__title.title3 {
  font-size: var(--title3-font-size);
}

.recently-viewed__container {
  position: relative;
  width: 100%;
}

.recently-viewed__slider-wrapper {
  overflow: hidden;
}

.recently-viewed__slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.recently-viewed__slider::-webkit-scrollbar {
  display: none;
}

.recently-viewed__card {
  flex: 0 0 calc((100% - 60px) / 4.5);
  width: calc((100% - 60px) / 4.5);
  min-width: 280px;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  background: rgb(var(--color-background));
  border: 1px solid #e0e0e0;
  cursor: pointer;
}

.recently-viewed__image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: rgb(var(--color-background-secondary, var(--color-background)));
  overflow: hidden;
}

.recently-viewed__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.recently-viewed__card:hover .recently-viewed__image {
  transform: scale(1.1);
}

.recently-viewed__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.recently-viewed__info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recently-viewed__title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: rgb(var(--color-foreground));
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recently-viewed__price {
  font-size: 18px;
  font-weight: 600;
  color: rgb(var(--color-foreground));
}

.recently-viewed__empty {
  padding: 60px 20px;
  text-align: center;
  color: rgb(var(--color-foreground-secondary, var(--color-foreground)));
  opacity: 0.6;
}

.hidden {
  display: none !important;
}

.recently-viewed__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  width: 100%;
}

.recently-viewed__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
  padding: 0;
  color: #000;
}

.recently-viewed__nav-btn:hover:not(:disabled) {
  opacity: 0.6;
}

.recently-viewed__nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.recently-viewed__nav-btn svg {
  width: 24px;
  height: 24px;
}

.recently-viewed__scrollbar {
  flex: 1;
  max-width: 400px;
  height: 6px;
  position: relative;
}

.recently-viewed__scrollbar-track {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: visible;
  position: relative;
}

.recently-viewed__scrollbar-thumb {
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 40px;
  position: absolute;
  top: 0;
}

.recently-viewed__scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

@media (max-width: 959px) {
  .recently-viewed__slider {
    margin-left: calc(-1 * var(--page-padding, 16px));
    margin-right: calc(-1 * var(--page-padding, 16px));
    padding-left: var(--page-padding, 16px);
    padding-right: var(--page-padding, 16px);
    gap: 8px;
  }

  .recently-viewed__card {
    flex: 0 0 240px;
    width: 240px;
  }

  .recently-viewed__info {
    padding: 12px;
  }

  .recently-viewed__title {
    font-size: 14px;
  }

  .recently-viewed__price {
    font-size: 16px;
  }

  .recently-viewed__nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .recently-viewed__card {
    flex: 0 0 140px;
    width: 140px;
  }

  .recently-viewed__info {
    padding: 8px;
  }

  .recently-viewed__title {
    font-size: 12px;
  }

  .recently-viewed__price {
    font-size: 14px;
  }
}
