/* Container des Carousels mit fester Höhe */
#myCarouselContainer {
  display: flex;
  max-width: 100%;
  margin: auto;
  padding: 10px;
  height: 70vh;
  overflow: hidden; /* Verhindert Überlauf */
}

/* Beide Bereiche erhalten die volle Containerhöhe */
#myCarouselMain,
#myCarouselSidebar {
  height: 100%;
}

/* Hauptbildbereich */
#myCarouselMain {
  flex: 1;
  position: relative;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#myCarouselMain img {
  /* Bild nimmt 90% der Containerhöhe ein (ca. 63vh) */
  height: 90%;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain; /* Sorgt dafür, dass das Bild immer vollständig sichtbar bleibt */
}

/* Navigations-Buttons */
#myCarouselPrev,
#myCarouselNext {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
}

#myCarouselPrev {
  left: 10px;
}

#myCarouselNext {
  right: 10px;
}

/* Seitenleiste mit Vorschaubildern */
#myCarouselSidebar {
  width: 150px;
  overflow-y: auto;
  max-height: 100%;
}

#myCarouselSidebar img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  margin-bottom: 5px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

#myCarouselSidebar img.active {
  opacity: 1;
  border: 2px solid #333;
}

/* Responsive Anpassungen: Bei mobilen Geräten */
@media (max-width: 768px) {
  /* Container-Höhe wird auf 50vh reduziert */
  #myCarouselContainer {
    flex-direction: column;
    height: 50vh;
  }
  #myCarouselMain,
  #myCarouselSidebar {
    height: 100%;
  }
  /* Hauptbild nimmt nun 90% von 50vh ein (ca. 45vh) */
  #myCarouselMain img {
    height: 90%;
  }
  #myCarouselSidebar {
    width: 100%;
    max-height: none;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }
  #myCarouselSidebar img {
    width: auto;
    height: 80px;
    margin-right: 5px;
  }
  #myCarouselMain {
    margin-right: 0;
  }
}
