.home-brands {
    padding: 8px 0 0;
}

.home-brands--tail {
    margin-top: 22px;
}

.home-brands-shell {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--surface-border) 82%, #fff 18%);
    border-radius: 26px;
    background: color-mix(in srgb, var(--bg-100) 97%, #fff 3%);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.home-brands-shell::before,
.home-brands-shell::after {
    content: "";
    position: absolute;
    top: 60px;
    bottom: 16px;
    width: 54px;
    pointer-events: none;
    z-index: 2;
}

.home-brands-shell::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-100), color-mix(in srgb, var(--bg-100) 0%, transparent));
}

.home-brands-shell::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg-100), color-mix(in srgb, var(--bg-100) 0%, transparent));
}

.home-brands-head {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.home-brands-copy {
    display: grid;
    gap: 2px;
}

.home-brands-kicker {
    color: var(--primary-100);
    font-size: .73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.home-brands-copy h2 {
    margin: 0;
    color: var(--text-100);
    font-size: clamp(1rem, 1.6vw, 1.26rem);
    font-weight: 900;
    line-height: 1.12;
}

.home-brands-all-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--surface-border) 80%, #fff 20%);
    background: color-mix(in srgb, var(--surface-muted) 84%, #fff 16%);
    color: var(--text-100);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.home-brands-all-link:hover,
.home-brands-all-link:focus-visible {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary-100) 34%, var(--surface-border));
    background: color-mix(in srgb, var(--primary-100) 10%, var(--surface-muted));
}

.home-brands-marquee {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.home-brands-track {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: max-content;
    will-change: transform;
}

.home-brands-marquee.is-looping .home-brands-track {
    animation: homeBrandsTicker 28s linear infinite;
}

.home-brands-marquee.is-looping:hover .home-brands-track,
.home-brands-marquee.is-looping:focus-within .home-brands-track {
    animation-play-state: paused;
}

.home-brands-marquee.is-static .home-brands-track {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.home-brand-card {
    min-width: 196px;
    min-height: 78px;
    padding: 10px 12px 10px 10px;
    border-radius: 22px;
    border: 1px solid color-mix(in srgb, var(--surface-border) 84%, #fff 16%);
    background: color-mix(in srgb, var(--bg-100) 95%, #fff 5%);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--text-100) 4%, transparent);
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-brand-card:hover,
.home-brand-card:focus-visible {
    transform: translateY(-2px);
    text-decoration: none;
    border-color: color-mix(in srgb, var(--primary-100) 28%, var(--surface-border));
    box-shadow: 0 14px 26px color-mix(in srgb, var(--text-100) 8%, transparent);
}

.home-brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--primary-100) 16%, var(--surface-border));
    background: color-mix(in srgb, var(--primary-100) 9%, var(--bg-100));
    color: var(--primary-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    font-size: .98rem;
    font-weight: 900;
    letter-spacing: .02em;
}

.home-brand-mark.has-image {
    background: color-mix(in srgb, var(--surface-muted) 92%, #fff 8%);
}

.home-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 8px;
}

.home-brand-body {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.home-brand-name {
    color: var(--text-100);
    font-size: .9rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-brand-count {
    color: var(--text-300);
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-brand-cta {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-300);
}

.home-brand-cta svg {
    width: 16px;
    height: 16px;
    display: block;
}

@keyframes homeBrandsTicker {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(-50% - 6px), 0, 0);
    }
}

@media (max-width: 760px) {
    .home-brands {
        padding: 6px 0 0;
    }

    .home-brands--tail {
        margin-top: 18px;
    }

    .home-brands-shell {
        padding: 14px;
        border-radius: 22px;
        gap: 10px;
    }

    .home-brands-shell::before,
    .home-brands-shell::after {
        display: none;
    }

    .home-brands-head {
        gap: 10px;
        align-items: stretch;
    }

    .home-brands-copy h2 {
        font-size: 1rem;
    }

    .home-brands-all-link {
        min-height: 36px;
        padding-inline: 12px;
        font-size: .78rem;
    }

    .home-brands-marquee {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        margin-inline: -2px;
        padding-inline: 2px;
    }

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

    .home-brands-track,
    .home-brands-marquee.is-looping .home-brands-track {
        animation: none;
        width: max-content;
    }

    .home-brand-card[data-brand-clone="1"] {
        display: none;
    }

    .home-brand-card {
        min-width: 168px;
        min-height: 72px;
        padding: 9px 11px 9px 9px;
        border-radius: 20px;
        grid-template-columns: 46px minmax(0, 1fr) 16px;
        gap: 9px;
    }

    .home-brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 16px;
    }

    .home-brand-mark img {
        padding: 7px;
    }

    .home-brand-name {
        font-size: .85rem;
    }

    .home-brand-count {
        font-size: .7rem;
    }
}

@media (max-width: 520px) {
    .home-brands-shell {
        padding: 12px;
        border-radius: 20px;
    }

    .home-brands-copy {
        gap: 1px;
    }

    .home-brands-kicker {
        font-size: .69rem;
    }

    .home-brands-copy h2 {
        font-size: .96rem;
    }

    .home-brands-all-link {
        width: 100%;
    }

    .home-brand-card {
        min-width: 156px;
        min-height: 68px;
        padding: 8px 10px 8px 8px;
        border-radius: 18px;
        grid-template-columns: 42px minmax(0, 1fr) 14px;
    }

    .home-brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: .87rem;
    }

    .home-brand-count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-brands-marquee {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

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

    .home-brands-track,
    .home-brands-marquee.is-looping .home-brands-track {
        animation: none;
        width: max-content;
    }
}
