/* Прелоадер, пока Tom Select не инициализирован */
.moi-select-host {
    position: relative;
    width: 100%;
    min-height: 42px;
}

.moi-select-host--tall {
    min-height: 110px;
}

.moi-select-host--loading > select:not([data-ts-ready]) {
    visibility: hidden;
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.moi-select-host--loading .ts-wrapper {
    visibility: hidden;
}

.moi-select-host__loader {
    display: none;
}

.moi-select-host--loading .moi-select-host__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 10px;
    background: rgba(248, 250, 255, 0.92);
    pointer-events: none;
}

html[data-theme='dark'] .moi-select-host--loading .moi-select-host__loader {
    background: rgba(26, 31, 63, 0.92);
}

.moi-select-host__loader::after {
    content: '';
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: #5a67ff;
    animation: moi-select-spin 0.75s linear infinite;
}

.field.moi-field-select-loading {
    position: relative;
    min-height: 42px;
}

.field.moi-field-select-loading:has(select[multiple]) {
    min-height: 110px;
}

.field.moi-field-select-loading > select:not([data-ts-ready]) {
    visibility: hidden;
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.field.moi-field-select-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: #5a67ff;
    animation: moi-select-spin 0.75s linear infinite;
    z-index: 2;
    pointer-events: none;
}

.field.moi-field-select-loading:has([data-ts-ready])::after,
.field.moi-field-select-loading:has(.ts-wrapper)::after {
    display: none;
}

@keyframes moi-select-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.moi-select-host--loading .moi-select-host__loader::after {
    animation-name: moi-select-spin-plain;
}

@keyframes moi-select-spin-plain {
    to {
        transform: rotate(360deg);
    }
}
