.carousel {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.carousel img {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer; /* Zeigt an, dass das Bild klickbar ist */
}

/* Modal (Hintergrund) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

/* Modal-Inhalt (Bild) */
.modal-content {
    margin: auto;
    display: block;
    max-width: 90vw; /* 90% der Viewport-Breite */
    max-height: 90vh; /* 90% der Viewport-Höhe */
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain; /* Behält das Seitenverhältnis bei */
}

/* Schließen-Button */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1010;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Modal-Navigationsbuttons */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 80px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
    z-index: 1005;
}

.modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-modal-btn {
    left: 20px;
    border-radius: 0 5px 5px 0;
}

.next-modal-btn {
    right: 20px;
    border-radius: 5px 0 0 5px;
}

@media (max-width: 768px) {
    .modal-nav {
        width: 40px;
        height: 60px;
        font-size: 20px;
    }
    
    .prev-modal-btn {
        left: 10px;
    }
    
    .next-modal-btn {
        right: 10px;
    }
}

.carousel-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 25px;
    height: 100%; /* Volle Bildhöhe */
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
    z-index: 5;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.next-btn {
    right: 0;
    border-radius: 3px 0 0 3px;
}

@media (max-width: 768px) {
    .carousel-btn {
        width: 20px;
        height: 100%; /* Volle Bildhöhe auch auf mobilen Geräten */
        font-size: 16px;
    }
}
