/* ── Recommended Brands — Infinite Marquee ── */

.recommended-brands {
    --rb-navy:   #1E2D4F;
    --rb-gold:   #BF9855;
    --rb-ivory:  #F7F5F2;
    --rb-border: rgba(30, 45, 79, 0.1);
    position: relative;
    padding: 20px 0 12px;
    overflow: hidden;
}

/* ── Header ── */
.recommended-brands__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
    padding: 0 max(16px, env(safe-area-inset-left));
}

.recommended-brands__heading-wrap {
    flex: 1;
    min-width: 0;
}

.recommended-brands__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rb-gold);
    margin-bottom: 4px;
}

.recommended-brands__title {
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--rb-navy);
}

/* ── Marquee container ── */
.brands-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* fade edges */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 6%,
        #000 94%,
        transparent 100%
    );
}

/* ── Scrolling track ── */
.brands-marquee__track {
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    animation: brandsScroll 48s linear infinite;
    will-change: transform;
}

@keyframes brandsScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Single brand pill ── */
.brand-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 8px 16px 8px 10px;
    background: #fff;
    border: 1px solid var(--rb-border);
    border-radius: 40px;
    box-shadow: 0 2px 8px -4px rgba(30, 45, 79, 0.12);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    cursor: default;
    white-space: nowrap;
}

.brand-pill:hover {
    border-color: rgba(30, 45, 79, 0.22);
    box-shadow: 0 6px 18px -6px rgba(30, 45, 79, 0.18);
    transform: translateY(-2px);
}

/* Pills with real logo image */
.brand-pill__img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    flex-shrink: 0;
}

/* Pills with text badge (no logo image) */
.brand-pill--text {
    padding: 8px 16px 8px 8px;
}

.brand-pill__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--rb-navy);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.brand-pill__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--rb-navy);
    letter-spacing: 0.01em;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── ATF compact variant ── */
.recommended-brands--atf {
    padding: 16px 0 8px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .recommended-brands--atf {
        padding: 12px 0 4px;
    }

    .recommended-brands__header {
        margin-bottom: 10px;
    }

    .brand-pill {
        padding: 6px 12px 6px 8px;
        gap: 8px;
    }

    .brand-pill__img,
    .brand-pill__badge {
        width: 28px;
        height: 28px;
    }

    .brand-pill__name {
        font-size: 11px;
    }

    .brands-marquee__track {
        animation-duration: 36s;
    }
}

@media (min-width: 1280px) {
    .brands-marquee__track {
        animation-duration: 60s;
    }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .brands-marquee__track {
        animation: none;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
        padding: 0 max(16px, env(safe-area-inset-left));
    }

    .brands-marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }
}
