/* ============================================================
   mb-nav-search.css  — Searchable Nav Dropdowns
   ============================================================ */

.mbns-wrap { position: relative; }
.mbns-wrap--libro { min-width: 180px; max-width: 240px; }
.mbns-wrap--num   { flex: 1; min-width: 52px; max-width: 62px; }

/* ── Ocultar en modo SY: aplica a cualquier mbns-wrap (libro y num) ── */
.mb-libro-hidden {
  display: none !important;
}

/* ── Control ─────────────────────────────────────────────── */
.mbns-control {
    display: flex;
    align-items: center;
    background: var(--mb-bg, #fff);
    border: 1.5px solid var(--mb-indigo-light, #e6eef5);
    border-radius: 999px;
    height: 38px;
    cursor: text;
    transition: all 0.2s;
}
.mbns-wrap--libro .mbns-control { padding: 0 14px; gap: 6px; }
.mbns-wrap--num .mbns-control   { padding: 0 6px 0 8px; gap: 2px; }

.mbns-control:focus-within {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
    outline: none;
}

/* ── Icons — indigo when active, gray only when disabled ── */
.mbns-icon {
    flex-shrink: 0;
    transition: color 0.18s;
    color: var(--mb-indigo-mid, #2c4969);
}
.mbns-control:focus-within .mbns-icon { color: #0ea5e9; }

/* Disabled state (whole control grayed out) */
.mbns-wrap--disabled .mbns-control {
    background: var(--mb-bg-soft, #f2f4f7);
    border-color: #e2e8f0;
    cursor: not-allowed;
}
.mbns-wrap--disabled .mbns-icon { color: #cbd5e1; }
.mbns-wrap--disabled .mbns-chevron { color: #cbd5e1; }

/* ── Input ───────────────────────────────────────────────── */
.mbns-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Inter', sans-serif;
    color: var(--mb-indigo, #1b3045);
    min-width: 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
}
.mbns-wrap--libro .mbns-input { text-align: left; }
.mbns-wrap--num .mbns-input   { text-align: center; }

.mbns-input::placeholder { color: #94a3b8; font-weight: 400; }
.mbns-input:disabled { cursor: not-allowed; opacity: 0.5; }

/* ── Chevron ─────────────────────────────────────────────── */
.mbns-chevron {
    color: var(--mb-indigo-mid, #2c4969);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.18s;
    pointer-events: none;
}
.mbns-wrap--libro .mbns-chevron { font-size: 0.75rem; }
.mbns-wrap--num .mbns-chevron   { font-size: 0.65rem; }

/* ── Dropdown ────────────────────────────────────────────── */
.mbns-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    z-index: 1200;
    background: var(--mb-bg, #fff);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: mbns-fadeIn 0.15s ease;
}
.mbns-wrap--libro .mbns-dropdown { left: 0; right: 0; min-width: 220px; }
.mbns-wrap--num .mbns-dropdown   { left: 50%; transform: translateX(-50%); min-width: 80px; }
@keyframes mbns-fadeIn {
    from { opacity: 0; margin-top: -4px; }
    to   { opacity: 1; margin-top: 0; }
}

/* ── List ────────────────────────────────────────────────── */
.mbns-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.mbns-list::-webkit-scrollbar { width: 6px; }
.mbns-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ── Items ───────────────────────────────────────────────── */
.mbns-item {
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.1s;
    outline: none;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}
.mbns-wrap--libro .mbns-item { padding: 8px 16px; font-size: 0.85rem; gap: 8px; justify-content: flex-start; }
.mbns-wrap--num .mbns-item   { padding: 6px 12px; font-size: 0.9rem; font-weight: 500; justify-content: center; }

.mbns-item:hover, .mbns-item:focus { background: #f1f5f9; color: #0f172a; }
.mbns-item--active { background: #e0f2fe; font-weight: 600; color: #0369a1; }
.mbns-wrap--libro .mbns-item--active::before { content: '▸'; font-size: 0.7rem; color: #0ea5e9; flex-shrink: 0; }

.mbns-item mark { background: #fef08a; color: #854d0e; border-radius: 3px; padding: 0 1px; font-weight: 600; }
.mbns-no-results { cursor: default; color: #94a3b8; font-style: italic; font-size: 0.8rem; justify-content: center; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .mbns-wrap--libro { min-width: 130px; max-width: 160px; }
    .mbns-wrap--libro .mbns-dropdown { min-width: 180px; }
    .mbns-wrap--num { min-width: 46px; max-width: 58px; }
    .mbns-wrap--libro .mbns-control { padding: 0 10px; }
}
