/* Container */
.my-gallery-wrapper {
    width: 100%;
    position: relative;
    max-width: 700px; /* Begrenzung, damit es auf Desktop nicht riesig wird */
}

/* --- Hauptbild Bereich --- */
.main-image-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #f4f4f4; /* Ladeplatzhalter */
    min-height: 300px; /* Verhindert Springen beim Laden */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.main-image-stage img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: opacity 0.2s ease; /* Weicher Übergang beim Wechseln */
}

/* Zoom Icon */
.gallery-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 50%;
    pointer-events: none;
    display: flex;
}

/* --- Thumbnail Slider Bereich --- */
.thumb-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Die Pfeile (immer sichtbar) */
.thumb-nav {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    height: 80px; /* Höhe passend zu den Thumbs */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0; /* Darf nicht kleiner werden */
    transition: all 0.2s ease;
    z-index: 2;
    padding-left: 0px;
    padding-right: 0px;
}

.thumb-nav:hover {
    background: #eebe26; /* Gold */
    border-color: #eebe26;
    color: #fff;
}

/* Der Scroll-Bereich */
.thumb-track {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Hier wird gescrollt */
    scroll-behavior: smooth; /* Sanftes Gleiten */
    flex-grow: 1; /* Nimmt den restlichen Platz ein */
    white-space: nowrap;
    
    /* Scrollbalken verstecken (sieht schöner aus) */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}

.thumb-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Einzelnes Thumbnail */
.thumb-item {
    width: 70px;
    height: 90px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s;
    border-radius: 2px;
    overflow: hidden;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Aktives Thumbnail */
.thumb-item.active {
    opacity: 1;
    border-color: #eebe26; /* Goldener Rahmen */
}

.thumb-item:hover {
    opacity: 1;
}

.my-gallery-wrapper {
    width: 100%;
    position: relative;
    max-width: 700px; 
    margin: 0 auto;
}

/* WICHTIG: touch-action für besseres Swipe-Verhalten */
.main-image-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
    background-color: #f4f4f4;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: zoom-in;
    
    /* NEU: Optimiert für Wischgesten auf Handy */
    touch-action: pan-y; 
    -webkit-user-select: none; /* Verhindert Markieren beim Wischen */
    user-select: none;
}

.main-image-stage img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Damit das Bild selbst keine Events klaut */
}

/* Rest bleibt gleich wie in Version 1.1 */
.gallery-zoom-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 50%;
    pointer-events: none;
    display: flex;
}

.thumb-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.thumb-nav {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    width: 40px;
    height: 80px; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    z-index: 2;
}

.thumb-nav:hover {
    background: #eebe26;
    border-color: #eebe26;
    color: #fff;
}

.thumb-track {
    display: flex;
    gap: 10px;
    overflow-x: auto; 
    scroll-behavior: smooth; 
    flex-grow: 1; 
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumb-track::-webkit-scrollbar {
    display: none;
}

.thumb-item {
    width: 70px;
    height: 90px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s;
    border-radius: 2px;
    overflow: hidden;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-item.active {
    opacity: 1;
    border-color: #eebe26;
}

.thumb-item:hover {
    opacity: 1;
}

/* Lightbox Styles */
.lightbox-overlay {
    display: none; 
    position: fixed;
    z-index: 10000; 
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content-wrapper {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform:scale(0.9); opacity:0} 
    to {transform:scale(1); opacity:1}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #eebe26;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    z-index: 10001;
    background-color: rgba(0,0,0,0.3);
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(238, 190, 38, 0.8);
}

@media (max-width: 768px) {
    .thumb-nav {
        width: 30px;
        height: 70px;
    }
    .thumb-item {
        width: 60px;
        height: 75px;
    }
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 20px;
        padding: 10px;
    }
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .thumb-nav {
        width: 30px; /* Etwas schmalere Pfeile auf Handy */
        height: 70px;
    }
    .thumb-item {
        width: 60px;
        height: 75px;
    }
}