/* Select nativo antes do MultiSelect carregar: mesmo visual do campo fechado, sem a lista */
select[multiple][name="opcao"] {
    display: block;
    width: 100%;
    height: 57px;
    overflow: hidden;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399a1af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 16px;
    border: 1px solid color-mix(in srgb, var(--bg) 15%, transparent);
    color: transparent;
    pointer-events: none;
}

select[multiple][name="opcao"] option {
    display: none;
}

.multi-select {
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    user-select: none;
}

.multi-select .multi-select-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-height: 57px;
    padding: 10px 44px;
    background-color: var(--white);
    border: 1px solid color-mix(in srgb, var(--bg) 15%, transparent);
    outline: none;
    cursor: pointer;
    font-size: inherit;
    line-height: 1.4;
    color: var(--text);
    transition: border-color 0.3s;
}

.multi-select .multi-select-header::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2399a1af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.3s;
}

.multi-select .multi-select-header.multi-select-header-active {
    border-color: var(--theme);
}

.multi-select .multi-select-header.multi-select-header-active::after {
    transform: translateY(-50%) rotate(180deg);
}

.multi-select .multi-select-header.multi-select-header-active + .multi-select-options {
    display: flex;
}

.multi-select .multi-select-header .multi-select-header-placeholder {
    color: color-mix(in srgb, var(--text) 55%, transparent);
    font-weight: 400;
}

.multi-select .multi-select-header .multi-select-header-option {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background-color: color-mix(in srgb, var(--bg) 8%, transparent);
    font-size: 14px;
    line-height: 1.5;
    color: var(--header);
}

.multi-select .multi-select-header .multi-select-header-max:empty {
    display: none;
}

.multi-select .multi-select-options {
    display: none;
    flex-flow: column;
    box-sizing: border-box;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 18rem;
    margin-top: 4px;
    padding: 4px;
    background-color: var(--white);
    border: 1px solid color-mix(in srgb, var(--bg) 15%, transparent);
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
    overflow-x: hidden;
    overflow-y: auto;
}

.multi-select .multi-select-options::-webkit-scrollbar {
    width: 5px;
}

.multi-select .multi-select-options::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--bg) 25%, transparent);
}

.multi-select .multi-select-options .multi-select-option {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.3;
    color: var(--text);
    transition: background-color 0.3s;
}

.multi-select .multi-select-options .multi-select-option .multi-select-option-radio {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    background-color: var(--white);
    border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent);
    transition: background-color 0.3s, border-color 0.3s;
}

.multi-select .multi-select-options .multi-select-option .multi-select-option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio {
    background-color: var(--theme);
    border-color: var(--theme);
}

.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio::after {
    content: "";
    display: block;
    width: 4px;
    height: 8px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-text {
    color: var(--header);
}

.multi-select .multi-select-options .multi-select-option:hover {
    background-color: color-mix(in srgb, var(--bg) 6%, transparent);
}

.form-aviso {
    margin: 0;
    color: #b45309;
    font-size: 15px;
    line-height: 1.4;
}

@media (max-width: 991px) {
    select[multiple][name="opcao"] {
        height: 47px;
    }

    .multi-select .multi-select-header {
        min-height: 47px;
        padding: 8px 40px 8px 38px;
        font-size: 15px;
    }
}
