/**
 * Listas desplegables con el diseño del tema (assets/js/theme-select.js) y el
 * aspecto cerrado de los <select> en las páginas rediseñadas y el modal.
 * 1rem = 10px en este tema → px.
 */

/* ---------- <select> cerrado ---------- */
.hm select,
.lsm select {
    -webkit-appearance: none;
    appearance: none;
    min-height: 48px;
    padding: 0 44px 0 16px !important;
    border: 1.5px solid rgb(23 57 59 / .16) !important;
    border-radius: 14px !important;
    background-color: #fff !important;
    background-image: url("../svg/chevron-down-ink.svg") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    color: #17393b !important;
    font-family: "Archivo", "Arial Narrow", system-ui, sans-serif !important;
    font-size: 15px !important;
    font-weight: 500;
    font-synthesis: none;
    text-overflow: ellipsis;
    box-shadow: none !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.hm select:hover,
.lsm select:hover {
    border-color: rgb(23 57 59 / .4) !important;
}

.hm select:focus,
.lsm select:focus,
.hm select.is-tsel-open,
.lsm select.is-tsel-open {
    outline: none;
    border-color: #52caa4 !important;
    box-shadow: 0 0 0 4px rgb(82 202 164 / .22) !important;
}

/* Flechas propias del tema/vue-select que quedarían duplicadas */
.hm .o-input:has(> select)::after,
.hm .o-input:has(> select)::before {
    display: none !important;
}

/* ---------- Lista abierta ---------- */
.tsel {
    position: fixed;
    z-index: 100000; /* por encima del modal (9000) y de los autocompletados */
    display: flex;
    flex-direction: column;
    max-height: var(--tsel-max, 320px);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 0 0 1px rgb(23 57 59 / .1), 0 24px 48px -16px rgb(15 39 41 / .4);
    font-family: "Archivo", "Arial Narrow", system-ui, sans-serif;
    font-synthesis: none;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: 50% 0;
    transition: opacity .18s ease, transform .22s cubic-bezier(.2, .7, .1, 1);
}

.tsel.is-up {
    transform-origin: 50% 100%;
    transform: translateY(6px) scale(.98);
}

.tsel.is-open {
    opacity: 1;
    transform: none;
}

.tsel[hidden] {
    display: none;
}

.tsel__search {
    flex: none;
    margin: 8px 8px 0;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid rgb(23 57 59 / .16);
    border-radius: 10px;
    background: #f7f1e8;
    color: #17393b;
    font: inherit;
    font-size: 14px;
    outline: none;
}

.tsel__search:focus {
    border-color: #52caa4;
    background: #fff;
}

.tsel__search[hidden] {
    display: none;
}

.tsel__list {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 6px;
    overflow: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgb(23 57 59 / .28) transparent;
}

.tsel__opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #17393b;
    font-size: 14.5px;
    line-height: 1.3;
    cursor: pointer;
}

.tsel__opt[hidden] {
    display: none;
}

.tsel__opt.is-placeholder {
    color: #4b6264;
}

.tsel__opt.is-active {
    background: #e2f3ea;
}

.tsel__opt.is-selected {
    font-weight: 600;
}

.tsel__check {
    flex: none;
    color: #1f7a60;
    opacity: 0;
}

.tsel__opt.is-selected .tsel__check {
    opacity: 1;
}

.tsel__opt.is-disabled {
    opacity: .45;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .tsel { transition: none; }
}
