/* ======================================
   AA AFFILIATES BLOCK
   Brand: #B31942 (red) | #06064E (navy)
====================================== */

.aa-affiliates-block {
    position: relative;
    width: 100%;
    padding: 80px 0;
    background: #fff;
    color: #0f172a;
    overflow: hidden;
}

.aa-affiliates-block *,
.aa-affiliates-block *::before,
.aa-affiliates-block *::after {
    box-sizing: border-box;
}

.aa-affiliates-block__inner {
    max-width: 1680px;
    padding: 0 12px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 480px;
}

/* ======================================
   LEFT — Icon + Heading
====================================== */
.aa-affiliates-block__left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 420px;
}

/* Icon — top left */
.aa-affiliates-block__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aa-affiliates-block__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(14%) sepia(87%) saturate(2000%) hue-rotate(322deg) brightness(85%) contrast(95%);
}

/* Text — bottom of left column */
.aa-affiliates-block__text {
    margin-top: auto;
}

.aa-affiliates-block__heading {
    font-size: clamp(36px, 4vw, 58px);
    font-weight: 900;
    color: #B31942;
    line-height: 1.05;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.aa-affiliates-block__subheading {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.5;
}

/* ======================================
   RIGHT — Infinite Scroll Logo Grid
====================================== */
.aa-affiliates-block__right {
    position: relative;
    height: 480px;
    overflow: hidden;
}

/* Fade masks top and bottom */
.aa-affiliates-block__scroll-mask {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.aa-affiliates-block__scroll-mask::before,
.aa-affiliates-block__scroll-mask::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 2;
    pointer-events: none;
}

.aa-affiliates-block__scroll-mask::before {
    top: 0;
    background: linear-gradient(to bottom, #fff 0%, transparent 100%);
}

.aa-affiliates-block__scroll-mask::after {
    bottom: 0;
    background: linear-gradient(to top, #fff 0%, transparent 100%);
}

/* Track — scrolls upward infinitely */
.aa-affiliates-block__scroll-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: aa-scroll-down var(--ab-speed, 18s) linear infinite;
    will-change: transform;
}

.aa-affiliates-block__scroll-track:hover {
    animation-play-state: paused;
}

/* Each set = one full copy of all logos in a grid */
.aa-affiliates-block__logo-set {
    display: grid;
    grid-template-columns: repeat(var(--ab-cols, 2), 1fr);
    gap: 14px;
    padding-bottom: 14px;
    /* gap between sets */
}

/* Individual logo card */
.aa-affiliates-block__logo-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.aa-affiliates-block__logo-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: rgba(179, 25, 66, 0.20);
}

.aa-affiliates-block__logo-card img {
    max-width: 100%;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: none;
    /* keep logos in their original colors */
}

.aa-affiliates-block__logo-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
}

/* ======================================
   KEYFRAME — scroll upward (logos move up = appears to scroll down from viewer perspective)
   To make logos move DOWN on screen, we go from translateY(0) to translateY(-50%)
   since we have 2 identical sets stacked, -50% = one full set height
====================================== */
@keyframes aa-scroll-down {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

/* ======================================
   TABLET — 991px
====================================== */
@media (max-width: 991px) {
    .aa-affiliates-block__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        min-height: 400px;
    }

    .aa-affiliates-block__left {
        min-height: 360px;
    }

    .aa-affiliates-block__right {
        height: 400px;
    }

    .aa-affiliates-block__heading {
        font-size: clamp(28px, 4vw, 44px);
    }
}

/* Mobile marquees — hidden on desktop */
.aa-affiliates-block__mobile-marquees {
    display: none;
}

/* ======================================
   TABLET STACKED — 767px
====================================== */
@media (max-width: 767px) {
    .aa-affiliates-block {
        padding: 50px 0 40px;
    }

    /* Stack inner to single column, remove grid */
    .aa-affiliates-block__inner {
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: unset;
        padding-bottom: 0;
    }

    /* Center the header row */
    .aa-affiliates-block__left {
        min-height: unset;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.875rem;
        padding: 0 12px;
        margin-bottom: 32px;
    }

    .aa-affiliates-block__icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .aa-affiliates-block__text {
        margin-top: 0;
    }

    .aa-affiliates-block__heading {
        font-size: 1.25rem;
        margin-bottom: 2px;
        white-space: nowrap;
    }

    .aa-affiliates-block__subheading {
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    /* Hide vertical desktop scroll */
    .aa-affiliates-block__right {
        display: none;
    }

    /* Show horizontal marquees */
    .aa-affiliates-block__mobile-marquees {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow: hidden;
    }

    .aa-affiliates-block__marquee-row {
        overflow: hidden;
        width: 100%;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    }

    .aa-affiliates-block__marquee-track {
        display: flex;
        width: max-content;
    }

    .aa-affiliates-block__marquee-row--left .aa-affiliates-block__marquee-track {
        animation: aa-aff-marquee-left var(--ab-speed, 18s) linear infinite;
    }

    .aa-affiliates-block__marquee-row--right .aa-affiliates-block__marquee-track {
        animation: aa-aff-marquee-right var(--ab-speed, 18s) linear infinite;
    }

    .aa-affiliates-block__marquee-row:hover .aa-affiliates-block__marquee-track {
        animation-play-state: paused;
    }

    .aa-affiliates-block__marquee-set {
        display: flex;
        flex-direction: row;
        gap: 12px;
        padding-right: 12px;
    }

    .aa-affiliates-block__marquee-card {
        background: #fff;
        border: 1px solid rgba(15, 23, 42, 0.10);
        border-radius: 12px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 160px;
        height: 96px;
        flex-shrink: 0;
        text-decoration: none;
        color: inherit;
        transition: box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .aa-affiliates-block__marquee-card:hover {
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
        border-color: rgba(179, 25, 66, 0.20);
    }

    .aa-affiliates-block__marquee-card img {
        max-width: 100%;
        max-height: 60px;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

    .aa-affiliates-block__marquee-card span {
        font-size: 11px;
        font-weight: 600;
        color: #0f172a;
        text-align: center;
        line-height: 1.3;
    }
}

/* ======================================
   MOBILE — 575px
====================================== */
@media (max-width: 575px) {
    .aa-affiliates-block__heading {
        font-size: 1rem !important;
        margin-bottom: 2px;
    }

    .aa-affiliates-block__marquee-card {
        width: 136px;
        height: 80px;
        padding: 12px 14px;
    }

    .aa-affiliates-block__marquee-card img {
        max-height: 50px;
    }
}

@keyframes aa-aff-marquee-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes aa-aff-marquee-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}