/* ── Custom Searchable Select — matches inventory_sorting_system_flask style ── */

.cs-wrap {
    position: relative;
}

.cs-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 34px 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    position: relative;
    transition: border-color .2s, box-shadow .2s;
    min-height: 40px;
    user-select: none;
    font-size: 14px;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    width: 100%;
}
.cs-trigger:hover { border-color: #94a3b8; }
.cs-trigger.open {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.cs-trigger::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
    color: #94a3b8;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform .2s;
    pointer-events: none;
}
.cs-trigger.open::after { transform: translateY(-50%) rotate(180deg); }

.cs-trigger-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.cs-trigger-text.cs-placeholder { color: #94a3b8; }

/* Dropdown panel */
.cs-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    z-index: 9999;
    max-height: 320px;
    flex-direction: column;
    overflow: hidden;
}
.cs-wrap.open .cs-dropdown { display: flex; }

/* Search input */
.cs-search {
    padding: 9px 14px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    background: #f8fafc;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
    width: 100%;
}
.cs-search:focus { background: #fff; }

/* Options list */
.cs-options {
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

.cs-option {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #0f172a;
    transition: background .1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-option:hover { background: #f0f7ff; }
.cs-option.selected {
    background: #dbeafe;
    color: #2563eb;
    font-weight: 600;
}
.cs-option.cs-option-empty {
    color: #94a3b8;
    font-style: italic;
}
.cs-no-results {
    padding: 12px 14px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}

/* Native selects (no data-cs): styled uniformly */
select:not([data-cs-init]) {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 9px 34px 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    transition: border-color .2s, box-shadow .2s;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}
select:not([data-cs-init]):focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
select:not([data-cs-init]):hover { border-color: #94a3b8; }
