/**
 * Shared Select2 look for location State/City (install wizard + SaaS company forms).
 * Dropdown is often attached under body, so these selectors are global.
 */

.location-smart-select + .select2-container,
.select2-container.location-select2-selection {
    width: 100% !important;
    display: block !important;
}

.select2-container--default.location-select2-selection .select2-selection--single,
body > .select2-container.location-select2-selection .select2-selection--single {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 0.875rem !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: none !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.select2-container--default.location-select2-selection .select2-selection--single .select2-selection__rendered {
    padding: 0 2rem 0 0 !important;
    line-height: 1.25 !important;
    font-size: 0.875rem !important;
    color: #0f172a !important;
}

.select2-container--default.location-select2-selection .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
}

.select2-container--default.location-select2-selection .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0.65rem !important;
    transform: none !important;
}

.select2-container--default.location-select2-selection .select2-selection--single .select2-selection__clear {
    margin-right: 1.5rem !important;
    font-size: 1rem !important;
    color: #94a3b8 !important;
    float: none !important;
}

.select2-container--default.location-select2-selection.select2-container--focus .select2-selection--single,
.select2-container--default.location-select2-selection.select2-container--open .select2-selection--single {
    border-color: #4099ff !important;
    box-shadow: 0 0 0 3px rgba(64, 153, 255, 0.14) !important;
    outline: none !important;
}

.select2-container--default.location-select2-selection .select2-selection--single:focus,
.select2-container--default.location-select2-selection .select2-selection__rendered:focus {
    outline: none !important;
    box-shadow: none !important;
}

body .select2-dropdown.location-select2-dropdown,
.select2-dropdown.location-select2-dropdown {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0 !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1) !important;
    background: #fff !important;
    z-index: 10050 !important;
    overflow: hidden;
    max-height: min(320px, 50vh);
}

body > .select2-container--open {
    z-index: 10050 !important;
}

.select2-dropdown.location-select2-dropdown .select2-search--dropdown {
    display: block !important;
    padding: 8px !important;
    background: #fff !important;
}

.select2-dropdown.location-select2-dropdown .select2-search--dropdown .select2-search__field {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 0.875rem !important;
    line-height: 1.25 !important;
    color: #0f172a !important;
    background: #fff !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.select2-dropdown.location-select2-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: #4099ff !important;
    box-shadow: 0 0 0 3px rgba(64, 153, 255, 0.14) !important;
    outline: none !important;
}

.select2-dropdown.location-select2-dropdown .select2-results {
    padding: 4px 0 !important;
}

.select2-dropdown.location-select2-dropdown .select2-results__option {
    padding: 9px 12px !important;
    font-size: 0.875rem !important;
    color: #0f172a !important;
}

.select2-container--default .select2-dropdown.location-select2-dropdown .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-dropdown.location-select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #4099ff !important;
    color: #fff !important;
}

.select2-container--default .select2-dropdown.location-select2-dropdown .select2-results__option[aria-selected="true"] {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.install-cc-field,
.cc-field,
.location-select-parent {
    position: relative;
}
