/* UI select (js/ui-select.js): phone/tablet dropdowns that open as a list under the field, like on a laptop. */

/* The real <select> stays in the form (values, validation, scripts) but out of sight */
select.uis-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

/* The button keeps the select's own classes (form-select, formal-input, rounded-pill, ...) */
.uis-btn {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.uis-btn.uis-plain {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-width: 120px;
    min-height: 38px;
    padding: 6px 34px 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center / 12px 10px;
    color: #212529;
}
/* plain-styled fields (formal-input) get the same arrow as Bootstrap's form-select */
.uis-btn.formal-input:not(.form-select) {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 10px;
}
.uis-btn .uis-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uis-btn.uis-placeholder .uis-text {
    color: #6c757d;
}
.uis-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.uis-btn.is-open,
.uis-btn:focus-visible {
    border-color: #7b1113 !important;
    box-shadow: 0 0 0 3px rgba(123, 17, 19, .15) !important;
    outline: none;
}
.uis-btn.is-invalid {
    border-color: #dc3545 !important;
}

/* The list */
.uis-panel {
    position: fixed;
    z-index: 2100;   /* above drawers (1045), modals (1055) and the confirm dialog (2000) */
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    overflow: hidden;
    font-family: inherit;
    animation: uisIn .12s ease-out;
}
.uis-panel.is-up {
    animation-name: uisInUp;
}
.uis-search {
    flex: 0 0 auto;
    margin: 8px;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 999px;
    font-size: 16px;   /* 16px: no iPhone zoom-in */
    outline: none;
}
.uis-search:focus {
    border-color: #7b1113;
}
.uis-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 4px 0;
}
.uis-option {
    padding: 11px 14px;
    min-height: 44px;
    font-size: 14px;
    line-height: 1.35;
    color: #212529;
    cursor: pointer;
    overflow-wrap: anywhere;
}
.uis-option:active,
.uis-option:focus {
    background: #f4f5f7;
    outline: none;
}
.uis-option.is-selected {
    background: #f6e7e7;
    color: #7b1113;
    font-weight: 700;
}
.uis-option.is-empty {
    color: #6c757d;
}
.uis-option.is-disabled {
    color: #adb5bd;
    cursor: not-allowed;
    background: none;
}
.uis-group {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #6c757d;
}
.uis-none {
    padding: 14px;
    font-size: 13px;
    color: #6c757d;
    text-align: center;
}

@keyframes uisIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes uisInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .uis-panel { animation: none; }
}
