/* ===== МОНИТОРИНГ РЫНКА ===== */
.market-section {
    padding: 40px 0 48px;
    background-color: var(--color-bg);
}

.market-section__title {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.market-grid {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* ===== ОБЩАЯ КАРТОЧКА ===== */
.market-card {
    width: 413px;
    height: 470px;
    background-color: var(--color-surface);
    border-radius: 24px;
    border: 1px solid var(--color-border);
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex-shrink: 0;
}

.market-card__title {
    margin: 0 0 2px;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.market-card__subtitle {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Табы */
.market-card__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.market-tab {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.market-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.market-tab.active { background-color: var(--color-primary); border-color: var(--color-primary); color: #000; }

/* Футер */
.market-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    flex-shrink: 0;
}

.market-card__footer-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.4;
    max-width: 160px;
}

.market-card__cta {
    padding: 11px 18px;
    background-color: var(--color-primary);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.market-card__cta:hover { background-color: #fff; }

/* ===== БЛОК 1: ВЕРТИКАЛЬНЫЕ СТОЛБИКИ ===== */
.market-card__banks--columns {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: flex-end;      /* выравниваем по нижнему краю */
    justify-content: space-around;
    padding-bottom: 0;
    gap: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.bank-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 0;
}

.bank-column__rate {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    margin-bottom: 4px;
    line-height: 1;
}

.bank-column__bar {
    width: 100%;
    max-width: 40px;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 6px;
    background: linear-gradient(180deg, #1a6b99 0%, #0b3c51 100%);
}

.bank-column__logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    display: block;
    margin-top: -18px;
    position: relative;
    z-index: 2;
    background-color: var(--color-surface);
    border: 2px solid var(--color-border);
}

/* ===== БЛОК 2: ГОРИЗОНТАЛЬНЫЕ ПОЛОСЫ ===== */
.market-card__banks--rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.bank-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bank-row__logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    background-color: var(--color-border);
}

.bank-row__bar-wrap {
    flex: 1;
    height: 32px;
    background-color: #0b1e2a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.bank-row__bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #0b3c51 0%, #1a6b99 100%);
    transition: width 0.5s ease;
    min-width: 2px;
}

.bank-row__rate {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    min-width: 38px;
    text-align: right;
    flex-shrink: 0;
}

/* ===== БЛОК 3: ИПОТЕКА ===== */

.mortgage-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1d3e28;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    flex-shrink: 0;
    min-height: 68px;
    box-sizing: border-box;
}

.mortgage-promo__text-block { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mortgage-promo__title { font-size: 15px; font-weight: 700; color: #fff; margin: 0; }
.mortgage-promo__sub {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin: 0;
    text-decoration: none;
    line-height: 1.3;
}
.mortgage-promo__sub:hover { color: #fff; }

.mortgage-promo__img {
    width: 72px;
    height: 62px;
    object-fit: contain;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Ипотечные строки — текст слева, шкала справа */
.market-card__banks--mortgage {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.mortgage-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mortgage-row__label {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
    min-width: 130px;
    flex-shrink: 0;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mortgage-row__label:hover { color: var(--color-primary); }

/* Шкала начинается с правой стороны блока (rtl) */
.mortgage-row__bar-wrap {
    flex: 1;
    height: 28px;
    background-color: #0b1e2a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: flex-end; 
}

.mortgage-row__bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(270deg, #1a6b99 0%, #0b3c51 100%);
    transition: width 0.5s ease;
}

.mortgage-row__rate {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
    min-width: 42px;
    text-align: right;
    flex-shrink: 0;
}

