.ycw-brands,
.ycw-brands * {
    box-sizing: border-box;
}

.ycw-brands {
    --ycw-brands-section-bg: transparent;
    --ycw-brands-card-bg: #ffffff;
    --ycw-brands-border: #e5e8e3;
    --ycw-brands-border-hover: #79bd4d;
    --ycw-brands-heading: inherit;
    --ycw-brands-text: inherit;
    --ycw-brands-heading-font: inherit;
    --ycw-brands-body-font: inherit;
    --ycw-brands-card-radius: 8px;
    --ycw-brands-card-shadow: 0 2px 10px rgba(35, 46, 32, .055);
    --ycw-brands-card-shadow-hover: 0 3px 14px rgba(35, 46, 32, .085);
    --ycw-brands-card-width: 162px;
    --ycw-brands-card-height: 124px;
    --ycw-brands-gap: 20px;
    --ycw-brands-logo-height: 52px;
    --ycw-brands-section-spacing: 64px;
    --ycw-brands-edge-fade: clamp(44px, 6vw, 72px);

    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--ycw-brands-section-spacing) 0;
    overflow: hidden;
    background: var(--ycw-brands-section-bg);
    color: inherit;
    font-family: inherit;
}

.ycw-brands__heading {
    width: 100%;
    max-width: 100%;
    margin: 0 auto clamp(48px, 5vw, 58px);
    padding: 0;
    text-align: center;
}

.ycw-brands__title {
    margin-top: 0;
}

.ycw-brands__subtitle {
    max-width: 900px;
    margin: 0 auto;
}

.ycw-brands__viewport {
    width: 100%;
    /*
     * Ruimte voor de zachte kaartschaduw zonder de verticale positie van de
     * slider te wijzigen. De negatieve marge compenseert de extra padding.
     */
    padding-block: 10px;
    margin-block: -10px;
    overflow: hidden;
}

/*
 * De lichte fade aan de randen zorgt ervoor dat de doorlopende rij visueel
 * buiten het kader verder loopt, zoals in het referentieontwerp.
 */
.ycw-brands--marquee .ycw-brands__viewport {
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 var(--ycw-brands-edge-fade),
        #000 calc(100% - var(--ycw-brands-edge-fade)),
        transparent 100%
    );
    mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 var(--ycw-brands-edge-fade),
        #000 calc(100% - var(--ycw-brands-edge-fade)),
        transparent 100%
    );
}

.ycw-brands__track,
.ycw-brands__set {
    display: flex;
    align-items: stretch;
    width: max-content;
}

.ycw-brands__track {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.ycw-brands__set {
    gap: var(--ycw-brands-gap);
    padding-right: var(--ycw-brands-gap);
}

.ycw-brands__card {
    flex: 0 0 var(--ycw-brands-card-width);
    width: var(--ycw-brands-card-width);
    height: var(--ycw-brands-card-height);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    background: var(--ycw-brands-card-bg);
    border: 1px solid var(--ycw-brands-border);
    border-radius: var(--ycw-brands-card-radius);
    box-shadow: var(--ycw-brands-card-shadow);
    transition:
        box-shadow .22s ease,
        border-color .22s ease,
        background-color .22s ease;
}

.ycw-brands__link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 18px;
    color: var(--ycw-brands-heading);
    text-decoration: none !important;
    outline: none;
}

.ycw-brands__logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 76%;
    max-height: var(--ycw-brands-logo-height);
    object-fit: contain;
    opacity: .66;
    filter: grayscale(1) saturate(0);
    transform: translateZ(0);
    transition:
        opacity .22s ease,
        filter .22s ease;
}

/* Respecteer de beheeroptie ook als centraal eigen styling actief is. */
.ycw-brands:not(.ycw-brands--grayscale) .ycw-brands__logo {
    opacity: 1;
    filter: none;
}

.ycw-brands__fallback {
    max-width: 100%;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: center;
}

/*
 * Hover geldt voor de hele kaart, dus ook voor merken zonder externe URL.
 * Daardoor gedraagt iedere merkkaart zich visueel hetzelfde.
 */
@media (hover: hover) and (pointer: fine) {
    .ycw-brands__card:hover,
    .ycw-brands__card:focus-within {
        border-color: var(--ycw-brands-border-hover);
        box-shadow: var(--ycw-brands-card-shadow-hover);
    }

    .ycw-brands__card:hover .ycw-brands__logo,
    .ycw-brands__card:focus-within .ycw-brands__logo {
        opacity: 1;
        filter: grayscale(0) saturate(1);
    }
}

.ycw-brands__link[href]:focus-visible {
    box-shadow: inset 0 0 0 2px var(--ycw-brands-border-hover);
    border-radius: calc(var(--ycw-brands-card-radius) - 1px);
}

.ycw-brands--static .ycw-brands__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ycw-brands--static .ycw-brands__viewport::-webkit-scrollbar {
    display: none;
}

.ycw-brands--static .ycw-brands__track {
    padding: 0;
}

.ycw-brands-empty {
    padding: 14px 18px;
    border: 1px dashed #c3c4c7;
    background: #fff;
    color: #50575e;
}

@media (max-width: 1024px) {
    .ycw-brands {
        --ycw-brands-card-width: min(158px, 24vw) !important;
        --ycw-brands-card-height: 120px !important;
        --ycw-brands-gap: 16px !important;
    }
}

@media (max-width: 782px) {
    .ycw-brands {
        --ycw-brands-card-width: min(154px, 46vw) !important;
        --ycw-brands-card-height: 116px !important;
        --ycw-brands-gap: 14px !important;
        padding-top: clamp(46px, var(--ycw-brands-section-spacing), 72px);
        padding-bottom: clamp(46px, var(--ycw-brands-section-spacing), 72px);
    }

    .ycw-brands__heading {
        width: 100%;
        max-width: 100%;
        margin-bottom: 38px;
        padding-inline: 0;
    }

    .ycw-brands__link {
        padding: 18px 16px;
    }

    .ycw-brands__logo {
        max-width: 78%;
        max-height: min(var(--ycw-brands-logo-height), 50px);
    }

    .ycw-brands--marquee .ycw-brands__viewport {
        --ycw-brands-edge-fade: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ycw-brands--marquee .ycw-brands__viewport {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .ycw-brands--marquee .ycw-brands__viewport::-webkit-scrollbar {
        display: none;
    }

    .ycw-brands--marquee .ycw-brands__track {
        transform: none !important;
    }

    .ycw-brands__card,
    .ycw-brands__logo {
        transition: none;
        transform: none;
    }
}
