/**
 * Product attribute Select2 — loads after WooCommerce select2.css.
 * Dropdown is on body; theme is mirrored on body[data-zerti-bs-theme] from #zertiAdmin.
 */

/* —— Dark mode dropdown (attribute values) —— */
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown {
    background-color: #212529 !important;
    border-color: #495057 !important;
    color: #dee2e6 !important;
}

body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results,
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__options,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__options {
    background-color: #212529 !important;
    color: #dee2e6 !important;
}

body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option {
    color: #dee2e6 !important;
    background-color: transparent !important;
}

/* WC default: selected rows get #ddd background; keep dark panel + readable text */
body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option[aria-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option[data-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option--selected,
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option[aria-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option[data-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--selected,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-container--default .select2-dropdown .select2-results__option[aria-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-container--default .select2-dropdown .select2-results__option[data-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-container--default .select2-dropdown .select2-results__option--selected,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option[aria-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option[data-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--selected {
    background-color: color-mix(in srgb, var(--zerti-brand, #712cf9) 34%, #212529) !important;
    color: #f8f9fa !important;
}

body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option--highlighted,
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-container--default .select2-dropdown .select2-results__option--highlighted,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted {
    background-color: color-mix(in srgb, var(--zerti-brand, #712cf9) 48%, #343a40) !important;
    color: #fff !important;
}

body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option--highlighted[aria-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-container--default .select2-dropdown .select2-results__option--highlighted[data-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted[aria-selected='true'],
body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted.select2-results__option--selected,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-container--default .select2-dropdown .select2-results__option--highlighted[aria-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted[aria-selected='true'],
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-results__option--highlighted.select2-results__option--selected {
    background-color: color-mix(in srgb, var(--zerti-brand, #712cf9) 55%, #343a40) !important;
    color: #fff !important;
}

body[data-zerti-bs-theme='dark'] .select2-dropdown.zerti-admin-select2-dropdown .select2-search--dropdown .select2-search__field,
body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='dark']) .select2-dropdown.zerti-admin-select2-dropdown .select2-search--dropdown .select2-search__field {
    background-color: #343a40 !important;
    border-color: #495057 !important;
    color: #dee2e6 !important;
}
