.brand-stack {
    position: relative;
    height: 540px;            /* Höhe des sichtbaren Fensters */
    overflow: hidden;
    display: flex;
    gap: 20px;
}

/* Gradient Overlay oben und unten */

.brand-stack::before,
.brand-stack::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 140px;
    z-index: 2;
    pointer-events: none;
}
.brand-stack::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(27,27,27,1) 0%, rgba(27,27,27,0.85) 25%, rgba(27,27,27,0.5) 60%, rgba(27,27,27,0.0) 100%);
}
.brand-stack::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(27,27,27,1) 0%, rgba(27,27,27,0.85) 25%, rgba(27,27,27,0.5) 60%, rgba(27,27,27,0.0) 100%);
}


.brand-track {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-track:first-child {
    animation: brand-scroll-up 18s linear infinite;
}
.brand-track:last-child {
    animation: brand-scroll-down 18s linear infinite;
    animation-delay: 0s; /* versetzt, damit es lückenlos looped */
}

.brand-card {
    background: #1b1b1b;
    border-radius: 18px;
    box-shadow: 0 6px 24px 0 rgba(0,0,0,0.18), 0 1.5px 4px 0 rgba(0,0,0,0.12);
    width: 220px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.brand-card img {
    max-height: 70px;
    width: auto;
    filter: grayscale(1);
    opacity: 0.85;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.brand-card:hover img {
    filter: grayscale(0);
    opacity: 1;
}


@keyframes brand-scroll-up {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

@keyframes brand-scroll-down {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

@media (max-width: 991px) {
    .brand-stack {
        height: 280px; /* Höhe für horizontales Karussell */
        flex-direction: column;
        gap: 20px;
    }
    .brand-track {
        flex-direction: row;
        gap: 20px;
        height: 120px;
        width: max-content;
    }
    .brand-card {
        height: 110px;
        width: 180px;
    }

    .brand-stack::before,
    .brand-stack::after {
        width: 140px;
        height: 100%;
        top: 0;
        left: unset;
        right: unset;
        z-index: 2;
    }
    .brand-stack::before {
        left: 0;
        background: linear-gradient(to right, rgba(27,27,27,1) 0%, rgba(27,27,27,0.85) 25%, rgba(27,27,27,0.5) 60%, rgba(27,27,27,0.0) 100%);
    }
    .brand-stack::after {
        right: 0;
        left: auto;
        background: linear-gradient(to left, rgba(27,27,27,1) 0%, rgba(27,27,27,0.85) 25%, rgba(27,27,27,0.5) 60%, rgba(27,27,27,0.0) 100%);
    }

    .brand-track:first-child {
        animation: brand-scroll-horizontal-ltr 18s linear infinite;
    }
    .brand-track:last-child {
        animation: brand-scroll-horizontal-rtl 18s linear infinite;
    }

    @keyframes brand-scroll-horizontal-ltr {
        0%   { transform: translateX(0); }
        100% { transform: translateX(-50%); }
    }
    @keyframes brand-scroll-horizontal-rtl {
        0%   { transform: translateX(-50%); }
        100% { transform: translateX(0); }
    }
}