/**
 * Carousel Styles - Eine Reihe mit mehreren Bildern
 */

/* Carousel Wrapper */
.gallery-carousel {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.cz-carousel-wrapper {
    position: relative;
    padding: 0 60px;
}

/* Container und Track */
.cz-carousel-container {
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}

.cz-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 15px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Einzelnes Carousel Item */
.cz-carousel-item {
    flex: 0 0 calc((100% - 45px) / 4); /* 4 Bilder mit 15px gap */
    min-width: 0;
    cursor: pointer;
}

.cz-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cz-carousel-item:hover .cz-image-wrapper {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cz-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.cz-carousel-item:hover .cz-image {
    transform: scale(1.05);
}

/* Zoom Button */
.cz-zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    pointer-events: auto;
}

.cz-carousel-item:hover .cz-zoom-btn {
    opacity: 1;
}

.cz-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.cz-zoom-btn svg {
    width: 18px;
    height: 18px;
}

/* Navigation Pfeile */
.cz-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}

.cz-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.cz-nav-prev {
    left: 0;
}

.cz-nav-next {
    right: 0;
}

.cz-nav svg {
    width: 24px;
    height: 24px;
}

/* Dots */
.cz-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    padding-bottom: 10px;
}

.cz-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d3d3d3;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.cz-dot:hover {
    background: #a0a0a0;
    transform: scale(1.2);
}

.cz-dot.active {
    background: #808080;
    transform: scale(1.3);
}

/* Lightbox/Zoom Overlay */
.cz-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: manipulation;
}

.cz-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.cz-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.cz-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

/* Lightbox Close Button */
.cz-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 10001;
}

.cz-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Lightbox Navigation */
.cz-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 10001;
}

.cz-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cz-lightbox-prev {
    left: 20px;
}

.cz-lightbox-prev:hover {
    transform: translateY(-50%) translateX(-5px);
}

.cz-lightbox-next {
    right: 20px;
}

.cz-lightbox-next:hover {
    transform: translateY(-50%) translateX(5px);
}

/* Lightbox Counter */
.cz-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
}

/* Responsive Anpassungen */
@media (max-width: 1200px) {
    .cz-carousel-item {
        flex: 0 0 calc((100% - 30px) / 3); /* 3 Bilder */
    }
}

@media (max-width: 768px) {
    .cz-carousel-wrapper {
        padding: 0 50px 30px 50px; /* Fügt 30px Abstand unten hinzu */
    }
    
    .cz-carousel-item {
        flex: 0 0 calc((100% - 15px) / 2); /* 2 Bilder */
    }
    
    /* Dots ausblenden im Mobile */
    .cz-dots {
        display: none;
    }
    
    .cz-nav {
        width: 40px;
        height: 40px;
    }
    
    .cz-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .cz-zoom-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
    }
    
    .cz-lightbox-nav {
        width: 50px;
        height: 50px;
    }
    
    .cz-lightbox-close {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .cz-carousel-wrapper {
        padding: 0 40px 30px 40px; /* 30px Abstand unten auch hier */
    }
    
    .cz-carousel-item {
        flex: 0 0 100%; /* 1 Bild */
    }
    
    .cz-carousel-track {
        gap: 0;
    }
}

/* Accessibility */
.cz-nav:focus,
.cz-dot:focus,
.cz-zoom-btn:focus,
.cz-lightbox-close:focus,
.cz-lightbox-nav:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}