.carousel {
  position: relative;
  margin: 0 !important;
  border-radius: 8px; /* optional rounded corners */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.carousel ul {
  display: flex;
  overflow-x: auto; /* allow horizontal scroll */
  flex-wrap: nowrap;
  align-items: center;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  margin: 0 !important;
  padding: 0;
}

.carousel ul::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

.carousel ul li {
  position: relative;
  overflow: hidden;
  min-width: 100%;
  list-style: none;
  flex: 0 0 100%; /* one slide per view */
  scroll-snap-align: start; /* snap each slide */
  padding: 0 30px;
}

.carousel ul li figure {
  margin: 0;
  display: flex;
  flex-direction: column; /* stack image and caption vertically */
  height: 100%;
}

.carousel ul li .slide-img {
  flex: 1 1 auto; /* takes remaining space */
  display: flex;
  justify-content: center; /* horizontal centering */
  align-items: center; /* vertical centering */
}

.carousel ul li figcaption {
  flex-shrink: 0; /* keeps caption at bottom */
  text-align: center;
  padding: 5px 10px;
  font-family: var(--default-font-family) !important;
}

.carousel ul li .slide-img img {
  object-fit: contain; /* keeps entire image visible */
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.carousel img {
  -webkit-user-drag: none; /* Safari/Chrome */
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
}

.carousel ol {
  position: relative;
  bottom: auto;
  display: flex;
  justify-content: center;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
}

.carousel ol li {
  list-style: none;
  padding: 0 5px;
}
.carousel ol li button {
  display: block;
  height: 10px;
  width: 10px;
  border: 2px solid var(--primary);
  background: transparent;
  border-radius: 100%;
  box-shadow: none;
}
.carousel ol li.selected button {
  background: var(--primary);
}
.carousel .prev,
.carousel .next {
  display: block;
  user-select: none;
  cursor: pointer;
  font-size: 50px;
  color: var(--primary);
  position: absolute;
  left: 0;
  transform: translateY(-50%);
  z-index: 9;
  line-height: 0;
}
.carousel .next {
  left: auto;
  right: 0;
}
