/* ==========================================================================
   Рейтинг банков — bank-rating.php (Задача 3)
   Изолированные стили: все селекторы под .bank-rating.
   ========================================================================== */

.bank-rating { padding: 24px 0 60px; }
.bank-rating * { box-sizing: border-box; }

.bank-rating__h1 {
    font-size: 40px;
    font-weight: 800;
    color: #17171a;
    margin: 0 0 24px;
    line-height: 1.1;
}

/* -------------------- Поиск + алфавит -------------------- */

.bank-rating__search-card {
    background: #fff;
    border-radius: 24px;
    padding: 28px 32px;
    margin: 0 0 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.bank-rating__search {
    display: flex;
    gap: 16px;
    margin: 0 0 20px;
}

.bank-rating__search-input {
    flex: 1;
    min-width: 0;
    height: 64px;
    padding: 0 28px;
    background: #f4f4f7;
    border: 0;
    border-radius: 16px;
    font-size: 17px;
    color: #1a1a1a;
    outline: none;
    transition: box-shadow .15s;
}
.bank-rating__search-input::placeholder { color: #9b9ba5; }
.bank-rating__search-input:focus { box-shadow: inset 0 0 0 2px #8046FF; }

.bank-rating__search-btn {
    flex-shrink: 0;
    min-width: 220px;
    height: 64px;
    padding: 0 40px;
    background: #8046FF;
    color: #fff;
    border: 0;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.bank-rating__search-btn:hover { background: #6a2fe0; }

.bank-rating__alphabet {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bank-rating__all-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    background: #c9b3ff;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.bank-rating__all-btn.is-active,
.bank-rating__all-btn:hover { background: #8046FF; }

.bank-rating__letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.bank-rating__letter {
    color: #17171a;
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}
.bank-rating__letter:hover,
.bank-rating__letter.is-active { color: #8046FF; }

/* -------------------- Табы -------------------- */

.bank-rating__tabs {
    display: flex;
    gap: 12px;
    margin: 0 0 24px;
    flex-wrap: wrap;
}
.bank-rating__tab {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 26px;
    background: #fff;
    color: #17171a;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.bank-rating__tab:hover { background: #f0edfa; }
.bank-rating__tab.is-active {
    background: #17171a;
    color: #fff;
}

/* -------------------- Layout (список + сайдбар) -------------------- */

.bank-rating__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
.bank-rating__layout.has-sidebar {
    grid-template-columns: 1fr 340px;
}

.bank-rating__main { min-width: 0; }

.bank-rating__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bank-rating__empty {
    background: #fff;
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    color: #6b6b78;
}

/* -------------------- Строка банка -------------------- */

.br-row {
    display: grid;
    grid-template-columns: auto 88px minmax(180px, 1.3fr) minmax(0, 2fr);
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 24px;
    padding: 22px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.br-row__rank {
    font-size: 22px;
    font-weight: 700;
    color: #17171a;
    min-width: 24px;
}

.br-row__logo {
    width: 88px;
    height: 88px;
    border-radius: 15px;
    overflow: hidden;
    background: #f4f4f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.br-row__logo img { width: 100%; height: 100%; object-fit: contain; }

.br-row__brand { min-width: 0; }
.br-row__name {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #17171a;
    text-decoration: none;
    line-height: 1.2;
    margin-bottom: 6px;
}
.br-row__name:hover { color: #8046FF; }
.br-row__addr,
.br-row__lic {
    font-size: 13px;
    color: #6b6b78;
    line-height: 1.4;
}

.br-row__cols {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.br-row__col { min-width: 0; }
.br-row__col--wide { min-width: 130px; }
.br-row__col-label {
    display: block;
    font-size: 13px;
    color: #9b9ba5;
    margin-bottom: 6px;
}
.br-row__col-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #17171a;
    white-space: nowrap;
}
.br-row__rating { display: inline-flex; align-items: center; gap: 4px; }
.br-row__star { color: #FFB800; }

/* -------------------- Показать еще + пагинация -------------------- */

.bank-rating__showmore-wrap { text-align: center; margin: 28px 0 8px; }
.bank-rating__showmore {
    display: inline-block;
    padding: 16px 48px;
    background: #8046FF;
    color: #fff;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.bank-rating__showmore:hover { background: #6a2fe0; }

.bank-rating__pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 8px;
    flex-wrap: wrap;
}
.bank-rating__page {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #17171a;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.bank-rating__page:hover { background: #f0edfa; }
.bank-rating__page.is-active { background: #8046FF; color: #fff; }

/* -------------------- Сайдбар «Рейтинг банков» -------------------- */

.br-side {
    background: #fff;
    border-radius: 24px;
    padding: 28px 26px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 20px;
}
.br-side__title {
    font-size: 24px;
    font-weight: 800;
    color: #17171a;
    margin: 0 0 20px;
}
.br-side__list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.br-side__item { display: flex; align-items: center; gap: 12px; }
.br-side__logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f4f7;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.br-side__logo img { width: 100%; height: 100%; object-fit: contain; }
.br-side__body { min-width: 0; }
.br-side__name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #17171a;
    text-decoration: none;
    line-height: 1.2;
    margin-bottom: 4px;
}
.br-side__name:hover { color: #8046FF; }
.br-side__meta { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #6b6b78; }
.br-side__star { color: #FFB800; }
.br-side__avg { font-weight: 600; color: #17171a; }
.br-side__all {
    display: inline-block;
    color: #0084F4;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.br-side__all:hover { text-decoration: underline; }

/* -------------------- Выгодные предложения -------------------- */

.bank-rating__offers { margin: 48px 0 0; }
.bank-rating__offers-title {
    font-size: 30px;
    font-weight: 800;
    color: #17171a;
    margin: 0 0 24px;
}
.bank-rating__offers-group { margin: 0 0 32px; }
.bank-rating__offers-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 16px;
}
.bank-rating__offers-subtitle {
    font-size: 22px;
    font-weight: 700;
    color: #17171a;
    margin: 0;
}
.bank-rating__offers-all {
    color: #0084F4;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bank-rating__offers-all:hover { text-decoration: underline; }

/* 4 карточки главной (item.php / serv_item) в ряд */
.bank-rating__offers-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.bank-rating__offers-grid .serv_item_wr {
    width: 100%;
    padding: 0;
    margin: 0;
}
.bank-rating__offers-grid .serv_item { max-width: 100%; height: 100%; }

/* -------------------- Отзывы о Банках -------------------- */

.bank-rating__reviews { margin: 48px 0 0; }
.bank-rating__reviews-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 20px;
}
.bank-rating__reviews-title {
    font-size: 30px;
    font-weight: 800;
    color: #17171a;
    margin: 0;
}
.bank-rating__reviews-all {
    color: #0084F4;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bank-rating__reviews-all:hover { text-decoration: underline; }
.bank-rating__reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.br-review {
    background: #fff;
    border-radius: 20px;
    padding: 22px 22px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}
.br-review__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.br-review__logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f4f4f7;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.br-review__logo img { width: 100%; height: 100%; object-fit: contain; }
.br-review__bank { font-size: 15px; font-weight: 700; color: #17171a; line-height: 1.2; margin-bottom: 3px; }
.br-review__stars { font-size: 12px; letter-spacing: 1px; }
.br-review__star { color: #dcdce2; }
.br-review__star.is-on { color: #FFB800; }
.br-review__title { font-size: 15px; font-weight: 600; color: #17171a; margin-bottom: 8px; }
.br-review__text { font-size: 14px; color: #4a4a55; line-height: 1.5; margin-bottom: 10px; }
.br-review__more { color: #0084F4; font-size: 14px; font-weight: 500; text-decoration: none; margin-bottom: 16px; }
.br-review__more:hover { text-decoration: underline; }
.br-review__author { font-size: 12px; color: #9b9ba5; margin-top: auto; }

/* -------------------- SEO-текст -------------------- */

.bank-rating__seo {
    background: #fff;
    border-radius: 20px;
    padding: 32px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 32px 0 0;
}
.bank-rating__seo-author { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; }
.bank-rating__seo-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.bank-rating__seo-author-name { font-size: 15px; font-weight: 600; color: #17171a; line-height: 1.3; }
.bank-rating__seo-author-role,
.bank-rating__seo-author-spec { font-size: 13px; color: #6b6b78; line-height: 1.3; }
.bank-rating__seo-divider { height: 1px; background: #ebebee; margin: 20px 0 24px; }
.bank-rating__seo-heading { font-size: 26px; font-weight: 800; color: #17171a; margin: 0 0 14px; }
.bank-rating__seo-text {
    color: #4a4a55;
    font-size: 15px;
    line-height: 1.6;
    max-height: 7.5em;
    overflow: hidden;
    transition: max-height .3s ease;
}
.bank-rating__seo-text p { margin: 0 0 10px; }
.bank-rating__seo-text p:last-child { margin-bottom: 0; }
.bank-rating__seo.is-open .bank-rating__seo-text { max-height: 2000px; }
.bank-rating__seo-toggle {
    background: none; border: 0;
    color: #0084F4; font-size: 15px; font-weight: 500;
    cursor: pointer; padding: 14px 0 0;
    display: inline-flex; align-items: center; gap: 6px;
}
.bank-rating__seo-toggle:hover { color: #005fb3; }

/* -------------------- Частые вопросы -------------------- */

.bank-rating__faq { margin: 44px 0 0; }
.bank-rating__faq-title { font-size: 30px; font-weight: 800; color: #17171a; margin: 0 0 24px; }
.bank-rating__faq-list { display: flex; flex-direction: column; gap: 12px; }
.br-faq__item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}
.br-faq__q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: none; border: 0;
    padding: 22px 28px;
    text-align: left;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    color: #17171a;
    line-height: 1.4;
}
.br-faq__q-text { flex: 1; min-width: 0; }
.br-faq__q-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #2a2a35;
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}
.br-faq__q-minus { display: none; }
.br-faq__item.is-open .br-faq__q-plus { display: none; }
.br-faq__item.is-open .br-faq__q-minus { display: block; }
.br-faq__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    padding: 0 28px;
    color: #4a4a55;
    font-size: 15px;
    line-height: 1.6;
}
.br-faq__item.is-open .br-faq__a { max-height: 1000px; padding: 0 28px 24px; }
.br-faq__a p { margin: 0 0 10px; }
.br-faq__a p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (max-width: 1100px) {
    .bank-rating__layout.has-sidebar { grid-template-columns: 1fr; }
    .br-side { position: static; }
    .bank-rating__offers-grid,
    .bank-rating__reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .bank-rating__h1 { font-size: 30px; }
    .br-row {
        grid-template-columns: auto 64px 1fr;
        grid-template-areas:
            "rank logo brand"
            "cols cols cols";
        gap: 14px 16px;
    }
    .br-row__rank { grid-area: rank; }
    .br-row__logo { grid-area: logo; width: 64px; height: 64px; }
    .br-row__brand { grid-area: brand; }
    .br-row__cols {
        grid-area: cols;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 14px 28px;
        padding-top: 14px;
        border-top: 1px solid #f0f0f4;
    }
}

@media (max-width: 767px) {
    .bank-rating__search { flex-direction: column; }
    .bank-rating__search-input,
    .bank-rating__search-btn { width: 100%; min-width: 0; }
    .bank-rating__search-card { padding: 20px; border-radius: 18px; }
    .bank-rating__tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .bank-rating__tabs::-webkit-scrollbar { display: none; }
    .bank-rating__tab { flex-shrink: 0; }

    .bank-rating__offers-grid,
    .bank-rating__reviews-grid { grid-template-columns: minmax(0, 1fr); }
    .bank-rating__offers-title,
    .bank-rating__reviews-title,
    .bank-rating__faq-title { font-size: 24px; }

    .br-row { padding: 18px 18px; border-radius: 18px; }
    .bank-rating__seo { padding: 24px 20px; }
    .br-faq__q { padding: 18px 20px; font-size: 15px; }
    .br-faq__item.is-open .br-faq__a { padding: 0 20px 20px; }
}

@media (max-width: 560px) {
    .br-row__cols { gap: 12px 20px; }
    .br-row__col-value { font-size: 15px; }
}
