.affbase-rating,
.affbase-rating *,
.affbase-rating *::before,
.affbase-rating *::after {
    box-sizing: border-box;
}

.affbase-rating {
    --affbase-main-color: #16a34a;
    --affbase-accent: var(--affbase-main-color);
    --affbase-accent-hover: color-mix(in srgb, var(--affbase-main-color) 85%, #000);
    --affbase-accent-soft: color-mix(in srgb, var(--affbase-main-color) 10%, transparent);
    --affbase-star: #f5b301;

    --affbase-text-heading: #0f172a;
    --affbase-text-primary: #334155;
    --affbase-text-muted: #64748b;
    --affbase-border: #e5e7eb;
    --affbase-bg-surface: #ffffff;
    --affbase-bg-subtle: #f8fafc;
    --affbase-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --affbase-cta-text: #ffffff;

    max-width: 1000px;
    margin: 2rem auto;
    font-family: inherit;
}

.affbase-rating[data-variant="dark"] {
    --affbase-text-heading: #f8fafc;
    --affbase-text-primary: #e2e8f0;
    --affbase-text-muted: #94a3b8;
    --affbase-border: #334155;
    --affbase-bg-surface: #1e293b;
    --affbase-bg-subtle: #0f172a;
    --affbase-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.affbase-rating__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.affbase-rating__item {
    display: grid;
    grid-template-columns: auto 7rem 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.125rem 1.5rem;
    background: var(--affbase-bg-surface);
    border: 1px solid var(--affbase-border);
    border-radius: 0.75rem;
    box-shadow: var(--affbase-shadow);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.affbase-rating__item:hover {
    border-color: color-mix(in srgb, var(--affbase-accent) 45%, var(--affbase-border));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.affbase-rating__position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--affbase-text-muted);
    background: var(--affbase-bg-subtle);
    border: 1px solid var(--affbase-border);
    border-radius: 999px;
    letter-spacing: -0.01em;
}

.affbase-rating__logo {
    width: 7rem;
    height: 5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--affbase-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background-color: #f1f5f9;
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.9) 45%, rgba(203, 213, 225, 0.85) 55%, rgba(203, 213, 225, 0.85) 100%);
}

.affbase-rating[data-variant="dark"] .affbase-rating__logo {
    background-color: #cbd5e1;
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.95) 45%, rgba(148, 163, 184, 0.9) 55%, rgba(148, 163, 184, 0.9) 100%);
}

.affbase-rating__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.affbase-rating__info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    min-width: 0;
}

.affbase-rating__brand-container {
    max-width: 150px;
    width: 100%;
    display: flex;
    gap: 0.8rem;
    flex-direction: column;
    align-items: center;
}

.affbase-rating__brand {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    color: var(--affbase-text-heading);
    line-height: 1.15;
    letter-spacing: -0.01em;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.affbase-rating__stars {
    flex-shrink: 0;
    display: inline-flex;
    gap: 0.0625rem;
    font-size: 0.875rem;
    line-height: 1;
}

.affbase-rating__star {
    color: color-mix(in srgb, var(--affbase-text-muted) 30%, transparent);
}

.affbase-rating__star.is-filled {
    color: var(--affbase-star);
}

.affbase-rating__bonus {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--affbase-text-heading);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.affbase-rating__promo {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4375rem;
}

.affbase-rating__promo-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--affbase-text-muted);
}

.affbase-rating__promo-code {
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 0.1875rem 0.5rem;
    border: 1px dashed var(--affbase-accent);
    border-radius: 0.3125rem;
    color: var(--affbase-accent);
    background: var(--affbase-accent-soft);
    letter-spacing: 0.02em;
}

.affbase-rating__promo-expires {
    font-size: 0.75rem;
    color: var(--affbase-text-muted);
}

.affbase-rating__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--affbase-cta-text);
    background: var(--affbase-accent);
    border-radius: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    min-width: 9rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.affbase-rating__cta:hover {
    background: var(--affbase-accent-hover);
    transform: translateY(-1px);
    color: var(--affbase-cta-text);
}

.affbase-rating__cta:focus-visible {
    outline: 2px solid var(--affbase-accent);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .affbase-rating__item {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "position info"
            "logo info"
            "cta cta";
        gap: 0.875rem 1rem;
        padding: 1.125rem;
    }

    .affbase-rating__position {
        grid-area: position;
        justify-self: start;
    }

    .affbase-rating__logo {
        grid-area: logo;
        width: 6rem;
        height: 4.25rem;
    }

    .affbase-rating__info {
        grid-area: info;
    }

    .affbase-rating__cta {
        grid-area: cta;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .affbase-rating {
        margin: 1rem auto;
    }

    .affbase-rating__list {
        gap: 0.625rem;
    }

    .affbase-rating__item {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "logo info position"
            "logo info ."
            "cta cta cta";
        gap: 0.75rem 0.875rem;
        padding: 1rem;
    }

    .affbase-rating__position {
        grid-area: position;
        align-self: start;
        min-width: 1.625rem;
        height: 1.625rem;
        font-size: 0.75rem;
        padding: 0 0.375rem;
    }

    .affbase-rating__logo {
        grid-area: logo;
        align-self: start;
        width: 4.5rem;
        height: 4.5rem;
        padding: 0.25rem;
        border-radius: 0.375rem;
    }

    .affbase-rating__info {
        grid-area: info;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
        width: 100%;
    }

    .affbase-rating__brand-container {
        max-width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .affbase-rating__brand {
        font-size: 0.9375rem;
        font-weight: 800;
        text-align: left;
    }

    .affbase-rating__stars {
        font-size: 0.75rem;
    }

    .affbase-rating__bonus {
        font-size: 0.8125rem;
        font-weight: 600;
        line-height: 1.25;
        color: var(--affbase-text-primary);
    }

    .affbase-rating__promo-code {
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
    }

    .affbase-rating__promo-expires {
        font-size: 0.6875rem;
    }

    .affbase-rating__cta {
        grid-area: cta;
        padding: 0.6875rem 1rem;
        font-size: 0.875rem;
        min-width: unset;
        border-radius: 0.375rem;
    }
}
