:is(modal-select, modal-select-option-group)::part(group-options) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 0.5rem;
    row-gap: 0.75rem;
    flex-grow: 1;
    overflow: auto;
}

/* metto l'overflow solo sulla select */
/* :is(modal-select)::part(group-options) {
    overflow-y: auto;
} */

modal-select-option {
    cursor: pointer;
    padding: .25rem .5rem;
    border: 1px solid var(--bs-gray-200);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: clamp(120px, 20vw, 200px);
    height: clamp(30px, 5vh, 70px);
    align-content: center;
    position: relative;
}

modal-select-option[value=""] {
    width: clamp(100px, 110px, 120px);
    display: block;
    height: 100%;
}

modal-select-option[disabled] {
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
    user-select: none;
}


modal-select-option[filtrato="false"] {
    display: none;
}

modal-select-option[selected] {
    background-color: hsla(from var(--color-active-theme) h s l / 0.1);
    color: var(--color-active-theme);
    border-color: var(--color-active-theme);
    font-weight: 600;
    border-width: 2px;
}

modal-select-option[selected]::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--color-active-theme);
}

modal-select-option:hover {
    background-color: #f7f7f7;
}

/* le option group che non hanno figli non filtrati (perché non attivo il filtro) o filtrati a "true" allora li nascondo */
modal-select-option-group:not(:has(modal-select-option:not([filtrato="false"]))) {
    display: none;
}