/*
 * Списки как на проде (page-new-testing.php: testing-custom-*).
 * Нативный select Windows сам открывается вверх и свой список не красит.
 */
.testing-custom-select-native {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 1px !important;
    height: 1px !important;
    border: 0 !important;
    outline: none !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
}
.testing-custom-select {
    position: relative;
    width: 100%;
    min-width: 0;
}
.testing-custom-select.is-open { z-index: 80; }
button.testing-custom-trigger {
    width: 100%;
    min-height: 46px;
    margin: 0;
    border: 1px solid #d7dde7;
    border-radius: 22px;
    background: #fff;
    padding: 0 54px 0 22px;
    font-size: 15px;
    font-weight: 600;
    color: #17335c;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
button.testing-custom-trigger:hover {
    background: #fff;
    border-color: #c7d1df;
    color: #17335c;
}
button.testing-custom-trigger:focus,
.testing-custom-select.is-open > button.testing-custom-trigger {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14) !important;
    outline: none;
    background: #fff;
    color: #17335c;
}
.testing-custom-select.is-disabled > button.testing-custom-trigger {
    background: #f8fafc;
    color: #98a2b3;
    cursor: not-allowed;
}
.testing-custom-trigger-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    flex: 1 1 auto;
}
.testing-custom-trigger-icon {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    position: relative;
}
.testing-custom-trigger-icon:before,
.testing-custom-trigger-icon:after {
    content: "";
    position: absolute;
    top: 4px;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: #8a94a6;
    transition: transform .18s ease;
}
.testing-custom-trigger-icon:before { left: 0; transform: rotate(45deg); }
.testing-custom-trigger-icon:after { right: 0; transform: rotate(-45deg); }
.testing-custom-select.is-open .testing-custom-trigger-icon:before { transform: rotate(-45deg); }
.testing-custom-select.is-open .testing-custom-trigger-icon:after { transform: rotate(45deg); }
.testing-custom-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    bottom: auto;
    z-index: 120;
    min-width: 100%;
    width: max-content;
    max-width: min(620px, calc(100vw - 40px));
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d7dde7;
    border-radius: 22px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, .14);
    padding: 10px;
    box-sizing: border-box;
    overscroll-behavior: contain;
}
.testing-custom-select.is-open > .testing-custom-menu { display: block; }
/*
 * Открытое меню — прямой ребёнок body: так ни overflow, ни stacking context
 * карточки не могут положить его под соседнюю секцию. 9000 выше карточек и
 * sticky-лент, но ниже глобальных модалок сайта (9999+) и кабинета (99990+).
 */
body > .testing-custom-menu.is-th-custom-select-portal {
    display: block;
    z-index: 9000;
}
.testing-custom-option {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 16px;
    color: #17335c;
    font-size: 17px;
    line-height: 1.35;
    cursor: pointer;
    white-space: nowrap;
}
/* `is-active` — пункт под стрелками; выглядит как наведённый мышью. */
.testing-custom-option:hover,
.testing-custom-option.is-active { background: #eff6ff; }
.testing-custom-option.is-selected {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    font-weight: 700;
}

#cabinet-profile .cabinet-edit-shell[data-edit-kind="country"] {
    overflow: visible;
}
#cabinet-profile .cabinet-edit-shell[data-edit-kind="country"] .cabinet-country-display {
    cursor: default;
}
#cabinet-profile .cabinet-edit-shell[data-edit-kind="country"].is-active-edit .cabinet-country-display {
    cursor: pointer;
}
#cabinet-profile .cabinet-edit-shell[data-edit-kind="country"].is-open {
    z-index: 80;
}
#cabinet-profile .cabinet-edit-shell[data-edit-kind="country"] > .testing-custom-menu {
    min-width: 100%;
}

body.auth-page button.testing-custom-trigger {
    min-height: 54px;
    height: 54px;
    border: none;
    border-bottom: 2px solid #6a6a6a;
    border-radius: 0;
    background: transparent;
    padding: 0 8px;
    font-size: 18px;
    font-weight: 400;
    color: #111;
}
body.auth-page button.testing-custom-trigger:hover,
body.auth-page button.testing-custom-trigger:focus,
body.auth-page .testing-custom-select.is-open > button.testing-custom-trigger {
    border-bottom-color: var(--accent, #d7962f);
    box-shadow:
        0 8px 20px rgba(215, 150, 47, .18),
        0 2px 6px rgba(0, 0, 0, .06);
    background: rgba(215, 150, 47, .04);
    color: #111;
}

@media (max-width: 700px) {
    button.testing-custom-trigger {
        min-height: 44px;
        font-size: 14px;
        border-radius: 18px;
        padding: 0 46px 0 16px;
    }
    .testing-custom-menu {
        border-radius: 18px;
        max-width: calc(100vw - 32px);
    }
    .testing-custom-option {
        min-height: 44px;
        font-size: 15px;
    }
}
