/*
 * Панель «Выберите банк» (assets/sbp-picker.js) — только для телефонов: на компьютере
 * панель не открывается, но стили грузятся вместе со страницей.
 */
.sbp-picker {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sbp-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.sbp-picker__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    padding: 16px 16px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
    animation: sbp-picker-up 0.2s ease-out;
}

/* Панель получает фокус при открытии — рамка вокруг неё не нужна. */
.sbp-picker__panel:focus {
    outline: none;
}

@keyframes sbp-picker-up {
    from {
        transform: translateY(12%);
        opacity: 0.6;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbp-picker__panel {
        animation: none;
    }
}

.sbp-picker [hidden] {
    display: none !important;
}

.sbp-picker__head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sbp-picker__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: #212529;
}

.sbp-picker__close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6c757d;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.sbp-picker__close:hover,
.sbp-picker__close:focus-visible {
    background: #f1f3f5;
    color: #212529;
}

.sbp-picker__hint {
    margin: 2px 0 12px;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #6c757d;
}

.sbp-picker__search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    /* 16px — чтобы браузер на телефоне не приближал страницу на фокусе. */
    font-size: 16px;
    line-height: 1.2;
    color: #212529;
    background: #fff;
    appearance: none;
}

.sbp-picker__search:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.sbp-picker__loading,
.sbp-picker__empty {
    margin: 16px 0;
    font-size: 0.9rem;
    text-align: center;
    color: #6c757d;
}

.sbp-picker__list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 8px 0 0;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    /* Один банк = одна строка: искать своё приложение по логотипу так проще. */
}

.sbp-picker__divider {
    padding: 12px 4px 6px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #adb5bd;
}

.sbp-picker__bank {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 9px 4px;
    border: 0;
    border-bottom: 1px solid #f1f3f5;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1.3;
    color: #212529;
    text-align: left;
    cursor: pointer;
}

.sbp-picker__bank:hover,
.sbp-picker__bank:focus-visible {
    background: #f8f9fa;
}

.sbp-picker__logo {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: contain;
}

/* Логотипа нет — первая буква названия: строки не разъезжаются по высоте. */
.sbp-picker__logo--letter {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f1f3f5;
    color: #6c757d;
    font-size: 16px;
    font-weight: 600;
}

.sbp-picker__name {
    flex: 1 1 auto;
    min-width: 0;
}

.sbp-picker__other {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed #ced4da;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.sbp-picker__other:hover,
.sbp-picker__other:focus-visible {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.sbp-picker__other-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #212529;
}

.sbp-picker__other-note {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Полоска «приложение не открылось?» — вместо таймера, который уводил со страницы, пока
   Safari ещё спрашивал разрешение на открытие приложения банка. */
.sbp-picker__fallback {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1090;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 536px;
    margin: 0 auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.sbp-picker__fallback-text {
    flex: 1 1 auto;
}

.sbp-picker__fallback-link {
    flex: 0 0 auto;
    color: #fff;
    text-decoration: underline;
    white-space: nowrap;
}

.sbp-picker__fallback-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.sbp-picker__fallback-close:hover,
.sbp-picker__fallback-close:focus-visible {
    background: rgba(255, 255, 255, 0.15);
}

/* Панель открыта — страница под ней не прокручивается. */
body.sbp-picker-open {
    overflow: hidden;
}

@media (min-width: 576px) {
    .sbp-picker {
        align-items: center;
    }

    .sbp-picker__panel {
        border-radius: 16px;
        max-height: 80vh;
    }
}
