/*
 * Padrão global Select2 desktop do Conecta PCSE.
 *
 * Repõe a personalização anterior ao refactor: campo compacto e reto, fundo
 * transparente, tipografia discreta e dropdown escuro do tema. A skin touch
 * permanece exclusiva de `pcse-select2.css` no mobile.
 */

@media (min-width: 768px) {
    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        .select2-container {
        box-sizing: border-box;
        display: inline-block;
        width: 100% !important;
        max-width: 100%;
        margin: 0;
        margin-top: 0 !important;
        padding-top: 0 !important;
        position: relative;
        vertical-align: middle;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--single {
        box-sizing: border-box;
        display: block;
        height: 30px !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.75) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--single
        .select2-selection__rendered {
        display: block;
        height: auto !important;
        padding-right: 42px !important;
        padding-left: 8px !important;
        overflow: hidden;
        color: rgba(255, 255, 255, 0.75) !important;
        font-size: 0.7rem !important;
        font-weight: 400 !important;
        line-height: 28px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--single
        .select2-selection__placeholder {
        color: rgba(255, 255, 255, 0.75) !important;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--single
        .select2-selection__clear {
        position: absolute;
        z-index: 1;
        top: 50%;
        right: 24px;
        min-width: 0;
        min-height: 0;
        padding: 0;
        color: #fff !important;
        font-size: 1em;
        font-weight: 700;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        transform: translateY(-50%);
        cursor: pointer;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--single
        .select2-selection__arrow {
        position: absolute;
        top: 50% !important;
        right: 4px !important;
        width: 20px !important;
        height: 100% !important;
        background-image: var(--bs-form-select-bg-img);
        background-position: center;
        background-repeat: no-repeat;
        background-size: 16px 12px;
        transform: translateY(-50%) !important;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--multiple {
        box-sizing: border-box;
        display: block;
        min-height: 32px !important;
        padding: 0 !important;
        overflow: visible;
        color: rgba(255, 255, 255, 0.75) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        cursor: text;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--multiple
        .select2-selection__rendered {
        display: inline;
        min-height: 0 !important;
        margin: 0;
        padding: 0 !important;
        list-style: none;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--multiple
        .select2-selection__choice {
        margin-top: 5px !important;
        margin-left: 5px !important;
        padding: 0 5px 0 20px !important;
        color: rgba(255, 255, 255, 0.75) !important;
        font-size: inherit !important;
        line-height: inherit !important;
        border: 1px solid rgba(255, 255, 255, 0.75) !important;
        border-radius: 0 !important;
        background: #343a40 !important;
        box-shadow: none !important;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--default, .select2-container--bootstrap-5)
        .select2-selection--multiple
        .select2-selection__choice__remove {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        padding: 0 4px !important;
        color: rgba(255, 255, 255, 0.75) !important;
        border: 0 !important;
        border-right: 1px solid rgba(255, 255, 255, 0.75) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        cursor: pointer;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        .select2-search--inline
        .select2-search__field {
        height: 18px !important;
        margin-top: 5px !important;
        margin-left: 5px !important;
        padding: 0 !important;
        color: inherit !important;
        font-family: sans-serif;
        font-size: 100% !important;
        line-height: normal !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    :is(#pcse-desktop-select2-standard, .app-content, .modal)
        :is(.select2-container--focus, .select2-container--open)
        :is(.select2-selection--single, .select2-selection--multiple) {
        border-color: rgba(255, 255, 255, 0.3) !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body > .select2-container--open .select2-dropdown,
    .select2-container--open .select2-dropdown {
        box-sizing: border-box;
        width: 100%;
        color: #fff;
        border: 1px solid #aaa !important;
        border-radius: 0 !important;
        background: #343a40 !important;
        box-shadow: none !important;
    }

    .select2-container--open .select2-search--dropdown {
        display: block;
        padding: 4px !important;
        background: #343a40 !important;
    }

    .select2-container--open .select2-search--dropdown .select2-search__field {
        box-sizing: border-box;
        width: 100%;
        min-height: 0 !important;
        padding: 8px !important;
        color: #fff !important;
        font-size: inherit !important;
        line-height: inherit !important;
        border: 1px solid #565656 !important;
        border-radius: 0 !important;
        background: #2d2f31 !important;
        box-shadow: none !important;
        outline: 0;
    }

    .select2-container--open .select2-results__options {
        max-height: 200px;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        list-style: none;
    }

    .select2-container--open .select2-results__option {
        min-height: 0;
        padding: 6px !important;
        color: #fff;
        font-size: inherit;
        line-height: inherit;
        border-radius: 0;
        background: transparent;
    }

    .select2-container--open
        .select2-results__option:is(
            [aria-selected="true"],
            .select2-results__option--selected
        ) {
        color: #fff !important;
        background: #2d2f31 !important;
    }

    .select2-container--open
        .select2-results__option:is(
            .select2-results__option--highlighted,
            .select2-results__option--highlighted[aria-selected]
        ) {
        color: #000 !important;
        background: #00ff9c !important;
    }
}
