const carousel = document.querySelector('.carousel-inner');
const slides = document.querySelectorAll('.carousel-item');
let index = 0;

document.querySelector('.next').addEventListener('click', () => {
  index = (index + 1) % slides.length;
  updateCarousel();
});

document.querySelector('.prev').addEventListener('click', () => {
  index = (index - 1 + slides.length) % slides.length;
  updateCarousel();
});

function updateCarousel() {
  carousel.style.transform = `translateX(-${index * 100}%)`;
}
