.gallery-wrapper {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    margin: 3rem auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}
body.loaded .gallery-wrapper {
    opacity: 1;
    visibility: visible;
}
.main-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0 auto 15px auto;
    width: 100%;
    max-width: 1000px;
    padding: 0 10px;
    height: 570px; /* 👈 feste Höhe */
    overflow: hidden; /* verhindert optisches Überschießen */
    position: relative;
}

.main-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease-in-out;
    border-radius: 6px;
    background-color: transparent;
}

.main-image-wrapper img.fade-out {
    opacity: 0;
}
.nav-button {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-button:hover {
    opacity: 1;
}
#prev {
    left: 10px;
}
#next {
    right: 10px;
}
.thumbnail-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden; /* optional, verhindert optisches Überschießen */
}

.thumbnail-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 10px;
    padding: 10px 10px;
}

.thumbnail.active {
    box-shadow: 0 0 0 3px var(--color-primary);
    border-radius: 4px;
}

.thumbnail {
    height: 70px;                 /* feste Höhe, z. B. 75px oder wie du willst */
    width: auto;                  /* automatische Breite entsprechend Seitenverhältnis */
    object-fit: contain;          /* passt das Bild in den Container */
    border-radius: 4px;
    transition: transform 0.2s;
    flex-shrink: 0;
    background-color: var(--color-shoplink-bg); /* falls mal leerer Raum */
}

.thumbnail:hover {
    transform: scale(1.05);
}

.gallery-categories {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.thumbnail-row::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-row::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.thumbnail-row::-webkit-scrollbar-track {
    background-color: transparent;
}

.gallery-category {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 1.5rem;
    min-width: 150px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s;
}

.gallery-category:hover {
    background-color: var(--color-hover);
    color:#ddddff;
}
.gallery-category.active {
    background-color: var(--color-hover);
    font-weight: bold;
}

/* Lightbox */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox-overlay.active {
    visibility: visible;
    opacity: 1;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.thumbnail.active {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

@media (max-width: 950px) {
    .nav-button {
        display: none;
    }
}
@media (max-width: 768px) {

    .gallery-category{
        min-width:100px;
        padding:6px;
    }
    .gallery-categories{
        gap:10px;
    }
    .main-image-wrapper {
        width:auto;
        gap: 8px;
        height: auto;                 /* Keine feste Höhe mehr */
        aspect-ratio: auto;           /* Falls gesetzt: aufheben */
        padding: 10px;                /* optional etwas Luft */
    }

    .main-image-wrapper img {
        max-height: unset;
        max-width: 100%;
        object-fit: contain;
    }

    .thumbnail {
        height: 50px;
        width: auto;
    }
}
