.wjpf-country-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

.wjpf-country-select-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    min-height: calc(2.25rem + 2px);
    padding: .375rem 2.25rem .375rem .75rem;
    overflow: hidden;
    color: #212529;
    text-align: left;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}

.wjpf-country-select-button::after {
    position: absolute;
    top: 50%;
    right: .75rem;
    width: 0;
    height: 0;
    margin-top: -.1rem;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
}

.wjpf-country-select-button:hover,
.wjpf-country-select-button:focus {
    z-index: 3;
    color: #212529;
    background: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .15);
}

.wjpf-country-select.is-open .wjpf-country-select-button::after {
    transform: rotate(180deg);
}

.wjpf-country-select-button:disabled {
    color: #6c757d;
    cursor: default;
    background: #e9ecef;
    opacity: 1;
}

.wjpf-country-select-flag,
.wjpf-country-option-flag {
    width: 1.55rem;
    height: 1.05rem;
    object-fit: cover;
    flex: 0 0 auto;
}

.wjpf-country-select-empty {
    width: 1.55rem;
    flex: 0 0 auto;
    color: #6c757d;
    text-align: center;
}

.wjpf-country-select-label,
.wjpf-country-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wjpf-country-select-menu {
    position: absolute;
    z-index: 1095;
    top: calc(100% + .2rem);
    left: 0;
    display: none;
    width: max(100%, 16rem);
    max-width: min(28rem, calc(100vw - 2rem));
    padding: .4rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.wjpf-country-select.is-open .wjpf-country-select-menu {
    display: block;
}

.wjpf-country-select-search {
    margin-bottom: .35rem;
}

.wjpf-country-select-options {
    max-height: 19rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.wjpf-country-option {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .45rem .65rem;
    color: #212529;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: .35rem;
}

.wjpf-country-option:hover,
.wjpf-country-option:focus {
    color: #1e2125;
    background: #e9ecef;
    outline: 0;
}

.wjpf-country-option.is-selected {
    color: #0a58ca;
    background: #e7f1ff;
}

.wjpf-country-option:disabled {
    color: #6c757d;
    background: transparent;
    opacity: .65;
}

.wjpf-country-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}

.form-floating > .wjpf-country-select .wjpf-country-select-button {
    min-height: calc(3.5rem + 2px);
    padding-top: 1.35rem;
    padding-bottom: .3rem;
}

.form-floating > .wjpf-country-select + .wjpf-country-select-native ~ label {
    z-index: 4;
    height: auto;
    padding-top: .7rem;
    pointer-events: none;
    transform: scale(.85) translateY(-.5rem) translateX(.15rem);
    opacity: .65;
}

.input-group > .wjpf-country-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .wjpf-country-select:not(:last-child) .wjpf-country-select-button {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.wjpf-country-select.is-invalid .wjpf-country-select-button,
.was-validated .wjpf-country-select:has(+ select:invalid) .wjpf-country-select-button {
    padding-right: 4.25rem;
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 2.25rem center;
    background-size: 1rem 1rem;
}

.wjpf-country-select.is-valid .wjpf-country-select-button,
.was-validated .wjpf-country-select:has(+ select:valid) .wjpf-country-select-button {
    padding-right: 4.25rem;
    border-color: #198754;
}

.wjpf-country-legacy-flag,
.wjpf-country-legacy-flag-holder {
    display: none !important;
}

@media (max-width: 575.98px) {
    .wjpf-country-select-menu {
        width: 100%;
        max-width: calc(100vw - 2rem);
    }
}
