/* Brand Pages — homepage listing block (design: Variant A card grid). */

.bp {
    --bp-bg: #EEF2F8;
    --bp-surface: #FFFFFF;
    --bp-soft: #F4F7FC;
    --bp-ink: #0E1726;
    --bp-ink-2: #5A6573;
    --bp-ink-3: #939DAC;
    --bp-line: #E6ECF4;
    --bp-blue: #2F8FED;
    --bp-blue-strong: #1B6FD6;
    --bp-blue-soft: #E5F0FD;
    --bp-green: #149E5D;
    --bp-green-soft: #DFF6EA;

    color: var(--bp-ink);
    font-family: 'Manrope', -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

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

/* ── Block shell + header ─────────────────────────────────────────────── */
.bp-block {
    padding: 32px 32px 36px;
    container-type: inline-size;
    background: var(--bp-bg);
    border-radius: 28px;
}

.bp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.bp-head__main {
    min-width: 0;
}

.bp-title {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.7px;
    line-height: 1.08;
    color: var(--bp-ink);
    text-wrap: pretty;
}

.bp-sub {
    margin: 9px 0 0;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--bp-ink-2);
    max-width: 62ch;
    text-wrap: pretty;
}

.bp-head__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    flex: 0 0 auto;
}

.bp-total {
    font-size: 13px;
    color: var(--bp-ink-3);
    font-weight: 600;
}

.bp-total b {
    color: var(--bp-ink);
    font-weight: 800;
}

/* ── Card head: brand (left, small) + type badge (right, small) ───────── */
.bp-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.bp-card__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bp-card__brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--bp-ink-2);
    letter-spacing: -0.1px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bonus name — the big text ────────────────────────────────────────── */
.bp-card__bonuses {
    margin: 2px 0 0;
}

.bp-bonus {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.2;
    color: var(--bp-ink);
    text-wrap: balance;
}

/* ── Bonus count ──────────────────────────────────────────────────────── */
.bp-count {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: var(--bp-ink-2);
    font-weight: 600;
}

.bp-count b {
    color: var(--bp-ink);
    font-weight: 800;
    font-size: 15px;
    margin-right: 4px;
}

.bp-count__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    margin-right: 9px;
    background: var(--bp-green-soft);
    color: var(--bp-green);
}

/* ── Bonus-type badge (small colour-coded pill, top-right) ────────────── */
.bp-card__cat {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
    padding: 6px 11px 6px 8px;
    border-radius: 999px;
    background: var(--cat-soft);
    color: var(--cat);
    white-space: nowrap;
}

.bp-card__cat-ico {
    display: inline-flex;
    align-items: center;
}

.bp-card__cat-ico svg {
    width: 14px;
    height: 14px;
}

/* ── Logo monogram ────────────────────────────────────────────────────── */
.bp-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex: 0 0 auto;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.5px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.bp-logo--img {
    background: var(--bp-surface);
    box-shadow: inset 0 0 0 1px var(--bp-line);
}

.bp-logo--img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    display: block;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.bp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}

.bp-btn--primary {
    background: linear-gradient(135deg, #2F8FED 0%, #1B6FD6 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(27, 111, 214, .28);
}

.bp-btn--ghost {
    background: var(--bp-surface);
    color: var(--bp-blue-strong);
    border: 1.5px solid #D5E4F7;
}

.bp-btn--ghost:hover {
    background: var(--bp-blue-soft);
}

.bp-btn--ghost svg {
    transition: transform .2s;
}

.bp-btn--ghost.is-open svg {
    transform: rotate(180deg);
}

.bp-more {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* ── Card grid ────────────────────────────────────────────────────────── */
.bp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bp-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    background: var(--bp-surface);
    border: 1px solid var(--bp-line);
    border-radius: 18px;
    padding: 16px 18px 18px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: transform .16s, box-shadow .16s, border-color .16s;
}

.bp-card:hover {
    border-color: color-mix(in srgb, var(--cat) 35%, var(--bp-line));
}

/* Висока специфічність, щоб перебити тему (напр. `.space-page-content a`). */
.bp.bp-block a,
.bp.bp-block a:hover,
.bp.bp-block a:focus,
.bp.bp-block a *,
.bp.bp-block a:hover * {
    text-decoration: none;
}

.bp.bp-block a.bp-card,
.bp.bp-block a.bp-card:hover,
.bp.bp-block a.bp-card:focus,
.bp.bp-block .bp-card .bp-bonus {
    color: var(--bp-ink);
}

.bp.bp-block .bp-card .bp-card__cat {
    color: var(--cat);
}

.bp.bp-block .bp-card .bp-card__brand-name,
.bp.bp-block .bp-card .bp-count {
    color: var(--bp-ink-2);
}

.bp.bp-block .bp-card .bp-count b {
    color: var(--bp-ink);
}

.bp.bp-block .bp-card .bp-card__cta {
    color: #fff;
}

.bp-card[hidden] {
    display: none;
}

.bp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(16, 30, 55, .10);
}

.bp-card__cta {
    margin-top: auto;
    width: 100%;
    background: var(--cat);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--cat) 30%, transparent);
}

.bp-card:hover .bp-card__cta.bp-btn--primary {
    box-shadow: 0 10px 22px color-mix(in srgb, var(--cat) 38%, transparent);
}

/* ── Container responsiveness (embed-width aware) ─────────────────────── */
@container (max-width: 920px) {
    .bp-grid { grid-template-columns: repeat(2, 1fr); }
}

@container (max-width: 760px) {
    .bp-head { flex-direction: column; }
    .bp-head__meta { flex-direction: row; align-items: center; }
}

@container (max-width: 540px) {
    .bp-grid { grid-template-columns: 1fr; }
    .bp-title { font-size: 25px; }
    .bp-block { padding: 22px 18px 26px; }
}
