/* ============================================================================
   searchable-select.css — .ss-* searchable select + dropdown user-select
   Split from app.css; LayoutAssetService::coreStylesheets
   ============================================================================ */

.ss-wrap { position: relative; width: 100%; min-width: 0; }
.ss-wrap,
.ss-control,
.ss-toggle,
.ss-panel,
.ss-panel *,
.ss-option,
.ss-option-label,
.ss-quick-create,
.ss-empty,
.ss-mark,
.product-search-panel,
.product-search-panel *,
.product-search-empty,
.product-search-item,
.product-search-item-meta,
.product-search-quick-create,
.topbar-search-dropdown,
.topbar-search-dropdown *,
.topbar-search-empty,
.topbar-search-loading,
.topbar-search-group-label,
.topbar-search-item,
.dropdown-menu,
.dropdown-menu *,
.einv-dropdown-menu,
.einv-dropdown-menu *,
[data-live-search-results],
[data-live-search-results] *,
[role="listbox"],
[role="listbox"] *,
[role="option"],
.merp-stock-pick-list,
.merp-stock-pick-list *,
.merp-stock-pick-empty,
.ops-suggest,
.ops-suggest *,
.ops-suggest-empty,
.crm-contact-search-panel,
.crm-contact-search-panel *,
.crm-contact-search-empty,
.mws-gib-results,
.mws-gib-results *,
.mws-gib-empty,
.merp-cmdbar__overflow-menu,
.merp-cmdbar__overflow-menu *,
.topbar-notifications-empty,
.topbar-notifications-empty *,
.merp-drp-pop,
.merp-drp-pop *:not(input):not(textarea):not(select) {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}
.ss-empty::selection,
.product-search-empty::selection,
.topbar-search-empty::selection,
.topbar-search-group-label::selection,
.ss-option-label::selection,
.ops-suggest-empty::selection,
.crm-contact-search-empty::selection,
.mws-gib-empty::selection,
.merp-stock-pick-empty::selection,
.topbar-notifications-empty::selection {
    background: transparent !important;
    color: inherit !important;
}
.ss-native {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    opacity: 0 !important; pointer-events: none !important;
    inset-inline-start: 0; inset-block-start: 0;
}
.ss-control { position: relative; display: flex; align-items: stretch; }
.ss-input { padding-right: 40px; -webkit-user-select: text !important; user-select: text !important; }
.ss-input::placeholder { color: #94a3b8; }
.ss-input:focus::placeholder { color: transparent; opacity: 0; }
.ss-toggle {
    position: absolute; inset-inline-end: 2px; inset-block: 2px;
    width: 32px; padding: 0; border: 0; line-height: 0;
    background: transparent; color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease, transform .18s ease;
}
.ss-toggle:hover { color: #0f172a; background: #e8eaed; }
.ss-chevron { display: block; transition: transform .18s cubic-bezier(0.22, 1, 0.36, 1); }
.ss-wrap.is-open .ss-chevron { transform: rotate(180deg); }
.ss-wrap.is-open .ss-toggle { color: var(--merp-primary, #4b59a7); }
.ss-panel {
    position: fixed;
    z-index: 5200; max-height: 320px; overflow: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: none;
    padding: 6px;
    scrollbar-width: thin;
}
.ss-panel.ss-panel-portal { z-index: 10000; }
.ss-wrap.is-open { position: relative; z-index: 2; }
.ss-panel[hidden] { display: none; }
.ss-option {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 38px; padding: 8px 10px;
    border: 0; border-radius: 8px; background: transparent;
    color: #0f172a; cursor: pointer; font: inherit; font-size: 13px;
    text-align: left;
    transition: background .12s ease, color .12s ease;
}
.ss-option-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-mark {
    background: color-mix(in srgb, var(--merp-primary, #4b59a7) 18%, transparent);
    color: inherit;
    padding: 0 1px;
    border-radius: 3px;
    font-weight: 650;
}
.ss-option:hover, .ss-option.is-active { background: #e8eaed; color: #111827; }
.ss-option.is-selected { font-weight: 600; }
.ss-option.is-selected::after {
    content: "";
    width: 16px; height: 16px; flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.5l4 4 7-8'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.5l4 4 7-8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ss-empty { padding: 14px 10px; color: #64748b; font-size: 13px; text-align: center; }
.ss-quick-create {
    position: sticky; bottom: 0;
    width: 100%; min-height: 38px;
    margin-top: 4px; padding: 8px 10px;
    border: 0; border-radius: 8px;
    background: #f3f4f6; color: #111827;
    cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
    text-align: left;
}
.ss-quick-create:hover { background: #e8eaed; }
.ss-wrap.is-invalid .ss-input,
.ss-wrap.is-invalid .ss-trigger { border-color: #dc2626; }
.ss-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: var(--ctl-h, 40px);
    min-height: var(--ctl-h, 40px);
    margin: 0;
    padding: 0 10px 0 12px;
    border: 1px solid var(--ctl-line, #e5e7eb);
    border-radius: 10px;
    background: var(--ctl-field, #fff);
    color: var(--merp-text, #111827);
    font: inherit;
    font-size: 13.5px;
    font-weight: 550;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}
.ss-trigger:hover { border-color: #cbd5e1; background: #f8fafc; }
.ss-wrap.is-open .ss-trigger {
    border-color: var(--merp-primary, #4b59a7);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--merp-primary, #4b59a7) 18%, transparent);
}
.ss-trigger-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ss-trigger .ss-chevron { flex: 0 0 auto; color: #64748b; }
.ss-wrap.is-placeholder .ss-trigger-label { color: #64748b; font-weight: 500; }
.ss-menu-search-wrap {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 4px 6px;
    background: var(--merp-surface, #fff);
}
.ss-menu-search {
    width: 100%;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--ctl-line, #e5e7eb);
    border-radius: 8px;
    background: var(--ctl-field, #fff);
    color: inherit;
    font: inherit;
    font-size: 13px;
    -webkit-user-select: text !important;
    user-select: text !important;
}
.ss-menu-search:focus {
    outline: none;
    border-color: var(--merp-primary, #4b59a7);
}
.ss-menu-list { display: flex; flex-direction: column; gap: 2px; }
html[data-theme="dark"] .ss-trigger {
    background: var(--ctl-field, #1f2937);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme="dark"] .ss-trigger:hover { background: #273449; }
html[data-theme="dark"] .ss-menu-search-wrap { background: var(--merp-surface, #1f2937); }
html[data-theme="dark"] .ss-menu-search {
    background: #111827;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.12);
}
.ss-wrap.is-disabled .ss-input, .ss-wrap.is-disabled .ss-toggle {
    background: #f1f5f9; color: #64748b; cursor: not-allowed;
}
