/*
 * MAPEL country list, design-and-build-state section 4.5. B1 is LimeSurvey's own
 * bootstrap_dropdown list with its search on. scripts/mapel-country.js marks it
 * mapel-country. Drawn in the tokens of sections 4.1 and 4.2, so both modes apply.
 */
body.mapel .ls-answers.answer-item:has(> .bootstrap-select.mapel-country) {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

/* The open list lies over the cards below it, so its card does not clip it */
body.mapel .question-container:has(.bootstrap-select.mapel-country) {
    position: relative;
    z-index: 20;
    overflow: visible;
}

body.mapel .bootstrap-select.mapel-country {
    width: 100% !important;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: var(--mapel-font);
}

body.mapel .bootstrap-select.mapel-country > .dropdown-toggle {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--mapel-card);
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--mapel-text);
    box-shadow: none;
    text-align: left;
}

body.mapel .bootstrap-select.mapel-country > .dropdown-toggle.bs-placeholder,
body.mapel .bootstrap-select.mapel-country > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
    color: var(--mapel-muted);
}

body.mapel .bootstrap-select.mapel-country > .dropdown-toggle:focus,
body.mapel .bootstrap-select.mapel-country.show > .dropdown-toggle {
    border-color: var(--mapel-primary);
    outline: 2px solid var(--mapel-primary);
    outline-offset: 0;
}

body.mapel .bootstrap-select.mapel-country > .dropdown-toggle::after {
    border-top-color: var(--mapel-muted);
    margin-left: 12px;
}

body.mapel .bootstrap-select.mapel-country .dropdown-menu {
    width: 100%;
    min-width: 100% !important;
    background-color: var(--mapel-card);
    border: 1px solid var(--mapel-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 8px 0;
    margin-top: 6px;
}

body.mapel .bootstrap-select.mapel-country .bs-searchbox {
    padding: 4px 10px 8px;
}

/* The search box, at 16px, below which iOS Safari zooms the page on focus */
body.mapel .bootstrap-select.mapel-country .bs-searchbox input.form-control {
    min-height: 0;
    height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
}

body.mapel .bootstrap-select.mapel-country .dropdown-menu li a.dropdown-item {
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--mapel-text);
    white-space: normal;
}

body.mapel .bootstrap-select.mapel-country .dropdown-menu li a.dropdown-item:hover,
body.mapel .bootstrap-select.mapel-country .dropdown-menu li a.dropdown-item.active,
body.mapel .bootstrap-select.mapel-country .dropdown-menu li a.dropdown-item:focus {
    background-color: var(--mapel-band);
    color: var(--mapel-heading);
}

body.mapel .bootstrap-select.mapel-country .dropdown-menu li.selected a.dropdown-item {
    background-color: var(--mapel-primary);
    color: var(--mapel-on-primary);
}

body.mapel .bootstrap-select.mapel-country .no-results {
    padding: 10px 14px;
    margin: 0;
    background: transparent;
    font-size: 15px;
    color: var(--mapel-muted);
}

body.mapel .bootstrap-select.mapel-country .bs-searchbox input.form-control:focus {
    border-color: var(--mapel-primary);
    outline: 2px solid var(--mapel-primary);
    outline-offset: 0;
    box-shadow: none;
}
