/* --- Main Card Container --- */
.bc-card {
    background-color: #ffffff;
    border: 1px solid var(--color-dark-blue-2);
    border-radius: 16px;
    padding: 24px 20px;
    margin-bottom: 16px;
    width: 100%;
    /* CSS Grid for Mobile Default Layout */
    display: grid;
    gap: 16px;
    grid-template-areas:
        "logo header"
        "meta meta"
        "actions actions";
    grid-template-columns: auto 1fr;
    align-items: start;
}

/* --- Logo Area --- */
.bc-card__logo {
    grid-area: logo;
    width: 130px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bc-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
}

/* --- Header Area (Title & Rating) --- */
.bc-card__header {
    grid-area: header;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
    height: 100%;
}

.bc-card__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-dark-blue-7);
    line-height: 1;
    margin: 0;
}

.bc-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #EDF5FB;
    color: var(--color-dark-blue-7);
    padding: 2px 8px;
    border-radius: 80px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4em;
}

.bc-card__rating svg {
    width: 16px;
    height: 16px;
    fill: #0084FF;
}

/* --- Meta Area (Badges & Specs) --- */
.bc-card__meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bc-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bc-card__badges a.bc-card__badge.bc-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 12px;
    font-weight: 400;
    line-height: 1em;
    background-color: #ffffff;
    text-decoration: none;
}

.bc-card__badge svg {
    width: 16px;
    height: 16px;
}

.bc-card__badges a.bc-card__badge.bc-card__badge--bonus {
    border-color: #008E77;
    color: #008E77;
    background-color: rgba(0, 142, 118, 0.05);
}

.bc-card__badges a.bc-card__badge.bc-card__badge--rebate {
    border-color: var(--color-blue-6);
    color: var(--color-blue-6);
    background-color: rgba(62, 116, 254, 0.05);
}

.bc-card__specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--color-dark-blue-5);
    font-size: 14px;
    font-weight: 400;
}

.bc-card__divider {
    display: none;
    /* Hidden on mobile */
}

/* --- Actions Area (Buttons) --- */
.broker-actions {
    grid-area: actions;
    display: flex;
    gap: 8px;
    width: 100%;
}

.bc-card .broker-actions a.bc-card__btn {
    font-family: inherit;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 2em;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.bc-card .broker-actions a.bc-card__btn--primary {
    background-color: var(--color-blue-6);
    padding: 6px 12px;
    color: #ffffff;
    flex: 1;
}

.bc-card .broker-actions a.bc-card__btn--primary:hover,
.bc-card .broker-actions a.bc-card__btn--primary:focus {
    background-color: var(--color-blue-7);
}

.bc-card__btn--desktop-only {
    display: none;
}

/* display: contents allows secondary buttons to sit inline with the primary button on mobile */
.bc-card__btn-group {
    display: contents;
}

.bc-card .broker-actions a.bc-card__btn--outline {
    background-color: #ffffff;
    border-color: var(--color-blue-6);
    color: var(--color-blue-6);
    flex: 1;
    /* Takes equal remaining space on mobile */
}

.bc-card .broker-actions a.bc-card__btn--outline:hover,
.bc-card .broker-actions a.bc-card__btn--outline:focus {
    background-color: #f8faff;
    color: var(--color-blue-6);
}

/* Desktop Layout */
@media (min-width: 768px) {
    .bc-card {
        grid-template-areas:
            "logo header actions"
            "logo meta actions";
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 12px 16px;
        padding: 24px 20px;
    }

    .bc-card__header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }

    .bc-card__meta {
        flex-direction: column;
        align-items: start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bc-card__specs {
        flex-direction: row;
        align-items: center;
    }

    .bc-card__divider {
        display: inline-block;
        color: #D9D9D9;
    }

    .bc-card__specs--regulation,
    .bc-card__specs--min-deposit {
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .broker-actions {
        flex-direction: column;
        width: 212px;
        /* Fixed width for actions block on desktop */
        flex-shrink: 0;
    }

    .bc-card__btn--primary {
        width: 100%;
        flex: none;
    }

    .bc-card__btn--desktop-only {
        display: inline;
    }

    /* Disable display contents so the secondary buttons form their own flex row */
    .bc-card__btn-group {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .bc-card__btn-group .bc-card__btn--outline {
        width: 100%;
    }
}