:root {
  --items-per-view: 4;
}

.slider {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 0;
}

.carousel {
  position: relative;
  padding: 0 20px;
}

.carousel__track-container {
  overflow: hidden;
  width: 100%;
  border-radius: 12px;
}

.carousel__track {
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
  will-change: transform;
}

.carousel__slide {
  flex: 0 0
    calc((100% - (var(--items-per-view) - 1) * 20px) / var(--items-per-view));
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f4f4f4;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

/* Панель управления: Кнопка "Назад" слева, точки в центре, "Вперед" справа */
.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Распределяет элементы по краям */
  margin-top: 20px;
  padding: 0 5px;
}

/* Кнопки */
.carousel__button {
  position: static;
  transform: none;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    background 0.3s,
    transform 0.2s;
}

.carousel__button:hover {
  background: #d4af37; /* Золотой цвет при наведении */
  transform: scale(1.05);
}

.carousel__button--left {
  left: 0;
}
.carousel__button--right {
  right: 0;
}

/* Точки */
.carousel__nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.carousel__nav .carousel__indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel__indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.3s;
}

.carousel__indicator.active {
  background: #d4af37;
  transform: scale(1.2);
}
