/* ============================================================
   Custom dropdown (wraps a real <select> for full form compatibility)
   ============================================================ */

.custom-select {
    position: relative;
    margin-bottom: 18px;
}

/* The real <select> stays in the DOM (so forms/FormData still work) but is
   visually hidden - the widget below drives it. */
.cs-native-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.cs-trigger {
    width: 100%;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px;
    box-sizing: border-box;
}

.cs-trigger:hover { border-color: #cbd5e1; }
.cs-trigger.open {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cs-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-caret {
    color: #94a3b8;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.cs-trigger.open .cs-caret { transform: rotate(180deg); }

.cs-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0,0,0,0.05);
    max-height: 240px;
    overflow-y: auto;
    z-index: 300;
    display: none;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
}
.cs-list.open { display: block; }

.cs-option {
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #334155;
}
.cs-option:hover { background: #f1f5f9; }
.cs-option.selected { background: #eff6ff; color: #2563eb; font-weight: 600; }
