/*
 * Selector con búsqueda. Replica el aspecto del Select2 del sistema para que
 * la experiencia sea la misma dentro y fuera del panel.
 */

.ws { position: relative; }

/* El <select> real queda accesible para el formulario pero fuera de la vista. */
.ws__nativo {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.ws__campo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    min-height: 48px;
    padding: .7rem .9rem;
    border: 1px solid var(--web-line);
    border-radius: var(--web-radius-sm);
    background: #fff;
    color: var(--web-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ws__campo:hover { border-color: var(--web-accent); }
.ws.is-abierto .ws__campo,
.ws__campo:focus-visible {
    border-color: var(--web-primary);
    box-shadow: 0 0 0 4px rgba(14, 124, 123, .14);
    outline: none;
}

.ws__texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws__texto--vacio { color: #8A94A1; }

.ws__flecha { flex: 0 0 auto; color: var(--web-body); transition: transform .2s ease; }
.ws.is-abierto .ws__flecha { transform: rotate(180deg); }

/* ── Panel desplegable ───────────────────────────────────────────────────── */
.ws__panel {
    position: absolute;
    z-index: 40;
    inset: calc(100% + 6px) 0 auto 0;
    padding: .5rem;
    border: 1px solid var(--web-line);
    border-radius: var(--web-radius-sm);
    background: #fff;
    box-shadow: var(--web-shadow);
    animation: wsAbrir .15s ease;
}

@keyframes wsAbrir {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.ws__buscar {
    width: 100%;
    min-height: 40px;
    padding: .5rem .75rem;
    margin-bottom: .4rem;
    border: 1px solid var(--web-line);
    border-radius: 8px;
    font: inherit;
    color: var(--web-ink);
}
.ws__buscar:focus { border-color: var(--web-primary); outline: none; }

.ws__lista {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 15rem;
    overflow-y: auto;
    scrollbar-width: thin;
}

.ws__opcion {
    padding: .55rem .7rem;
    border-radius: 8px;
    font-size: var(--fs-sm);
    color: var(--web-ink);
    cursor: pointer;
}
.ws__opcion.is-resaltada { background: var(--web-primary-soft); }
.ws__opcion.is-elegida {
    background: var(--web-primary);
    color: #fff;
    font-weight: 700;
}

.ws__vacio { margin: .5rem .25rem 0; font-size: var(--fs-sm); color: var(--web-body); }

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