.carousel {
  position: relative;
  width: 100%;
  max-width: 850px; /* or whatever width you need */
  overflow: hidden;
  margin: 0 auto;
  border-radius: 8px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

.carousel-slide {
  flex: 0 0 100%;
  box-sizing: border-box;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  max-height: 600px; /* optional: limit height */
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  padding: 0 12px;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.3s;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 1);
}

.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 0;
  border-radius: 0 0 8px 8px;
}
.carousel {
  width: 100%;
  max-width: 100%;
}
.carousel img {
  width: 100%;
  height: auto;
}

.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  cursor: grab;
}
.carousel-track:active {
  cursor: grabbing;
}
.carousel-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.carousel-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-thumb.active {
    opacity: 1;
    border-color: #fff;
}
/* Main carousel viewport */
.carousel {
  width: 100%;
}

/* Track stays flexible */
.carousel-track {
  display: flex;
}

/* Each slide defines the image area */
.carousel-slide {
  flex: 0 0 100%;
  max-height: 500px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Image scales to fit */
.carousel-slide img {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: contain;   /* 👈 prevents cropping */
  object-position: center;
  display: block;
}
