/* CSS для горизонтальной прокрутки товаров v1.1 */
.related-products {
  width: 100%;
  margin: 0px 0 38px 0;
  padding: 0 10px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  position: relative;
}
.related-products::after {
  content: '';
  width: calc(100% - 20px); /* Ширина с учетом отступов */
  height: 1px;
  background-color: #e0e0e0;
  position: absolute;
  bottom: -15px;
  left: 10px;
}
.related-products__title {
  margin: 0 0 15px 0;
  padding: 0;
  font-weight: normal;
}

/* Контейнер с горизонтальной прокруткой */
.related-products__scroll {
  display: flex;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  touch-action: pan-x;
  width: 100%;
  position: relative;
  z-index: 1;
  padding-bottom: 5px;
  margin: 0 -5px;
}

/* Скрываем стандартную полосу прокрутки */
.related-products__scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Элементы внутри прокрутки */
.related-products__item {
  flex: 0 0 auto;
  width: 140px;
  margin: 0 5px;
  position: relative;
  z-index: 2;
  scroll-snap-align: start;
  touch-action: manipulation;
  /* Добавляем правую границу как разделитель */
  border-right: 1px solid #e0e0e0;
  padding-right: 10px;
}

/* Убираем границу у последнего элемента */
.related-products__item:last-child {
  border-right: none;
}

/* Карточка товара */
.related-products__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Контейнер изображения */
.related-products__img-container {
  position: relative;
  width: 110px;
  height: 110px;
  overflow: hidden;
  border-radius: 4px;
  background-color: #f5f5f5;
  margin: 0 auto;
}

/* Изображение товара */
.related-products__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Контейнер контента */
.related-products__content {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex-grow: 1;
}

/* Название товара */
.related-products__name {
  line-height: 1.3;
  color: #333;
  margin: 0 0 5px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.6em;
}

/* Контейнер цены */
.related-products__price-container {
  display: flex;
  align-items: flex-end; /* Выравнивание по нижнему краю, чтобы корзина была на уровне основной цены */
  justify-content: space-between;
  margin-top: auto;
}


/* Контейнер для цен (обычная и акционная) */
.related-products__price-wrapper {
  display: flex;
  flex-direction: column;
}

/* Значение цены */
.related-products__price-value {
  font-size: 16px;
  font-weight: bold;
  color: #4863ab;
}

/* Акционная цена */
.related-products__price-action {
  color: #db5837;
}

/* Старая цена (зачеркнутая) */
.related-products__price-old {
  font-size: 12px;
  text-decoration: line-through;
  color: #999;
  display: block;
}

/* Иконка корзины для мобильной версии */
.related-products__basket-icon {
  width: 26px;
  height: 26px;
  display: none;
  cursor: pointer;
  margin-right: 3px; /* Отступ от правого края */
  margin-left: auto; /* Выравнивание по правому краю */
}

.related-products__basket-icon:hover {
  background-color: rgba(230, 140, 60, 0.1); /* Полупрозрачный квадрат при наведении */
}

.related-products__basket-icon {
  display: block;
}
/* Кнопка "Купить" 
.related-products__btn {
  display: block;
  width: 100%;
  background-color: #fff;
  color: #f2800d;
  text-align: center;
  padding: 7px 0;
  margin-top: 8px;
  border-radius: 19px;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid #f2800d;
  cursor: pointer;
  display: none;
}

.related-products__btn:hover {
  background-color: #f2800d;
  color: #fff;
} */

/* Горизонтальный скроллбар вместо индикаторов */
.related-products__scrollbar {
  position: relative;
  height: 4px;
  background-color: #f0f0f0;
  border-radius: 2px;
  margin: 10px auto 0;
  width: 80%;
  max-width: 300px;
  overflow: hidden;
}

.related-products__scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: #e68c3c;
  border-radius: 2px;
  width: 30%;
  transition: transform 0.1s ease;
}

/* Предотвращение конфликтов с существующими стилями */
#productCarousel .carousel-inner {
  overflow: visible;
}

.carousel-inner .carousel-contr {
  z-index: 0;
}


/* Медиа-запросы для адаптивности */
@media (min-width: 768px) {
  .related-products__item {
    width: 160px;
  }
  
  .related-products__img-container {
    width: 130px;
    height: 130px;
  }
  
  .related-products__name {
    font-size: 13px;
  }
  
  .related-products__title {
    font-size: 24px;
    margin-bottom: 20px;
  }
}

/* Для мобильных устройств показываем корзину вместо кнопки */
@media (max-width: 767px) {

  
  .related-products__basket-icon {
    display: block;
  }
  
  .related-products__price-container {
    flex-wrap: wrap;
    justify-content: flex-start; /* Выравнивание по левому краю на мобильных устройствах */
  }
}

/* Очень маленькие экраны */
@media (max-width: 359px) {
  .related-products__item {
    width: 130px;
  }
  
  .related-products__img-container {
    width: 100px;
    height: 100px;
  }
  
  .related-products__name {
    font-size: 11px;
  }
  
  .related-products__price-value {
    font-size: 13px;
  }
  
  .related-products__price-old {
    font-size: 11px;
  }
}