/* ==========================================================================
   Demand Panel — el BUSCADOR (js/buscar.js; pedido del dueño, 2026-11-26). Prefijo bq-. Sólo variables de
   marca/tokens.css + app.css: claro y oscuro salen solos. Propiedades lógicas: en árabe se espeja solo.
   Regla del dueño "nada se mueve": la ventana tiene un tamaño FIJO (escribir cambia la lista de adentro, que scrollea),
   la ✕ de borrar está siempre (deshabilitada sin texto) y el ↵ de cada fila tiene su lugar reservado.
   ========================================================================== */

/* ── El campo del header ── */
.bq-trig { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding-inline: 10px 6px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: text; transition: border-color var(--dur), box-shadow var(--dur); }
.bq-trig:hover { border-color: var(--accent); }
.bq-trig:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.bq-trig .bq-trig-i { width: 16px; height: 16px; flex-shrink: 0; }
.bq-trig-t { flex: 1; min-width: 0; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-kbd, .bq kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font: 600 11px/1 var(--mono); white-space: nowrap; direction: ltr; flex-shrink: 0; }
/* Teléfono: un ícono, como los demás del header (sin atajo: no hay teclado). */
@media (max-width: 899px) {
  .bq-trig { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--text-2); cursor: pointer; }
  .bq-trig .bq-trig-i { width: 20px; height: 20px; }
  .bq-trig-t, .bq-trig .bq-kbd { display: none; }
  .bq-trig:hover { background: var(--surface-2); color: var(--text); }
}

/* ── La ventana ── */
html.bq-open { overflow: hidden; scrollbar-gutter: stable; }
.bq { position: fixed; inset: 0; z-index: 120; display: none; }
.bq:not(:empty) { display: block; }
.bq-velo { position: absolute; inset: 0; background: rgba(7, 8, 12, .55); opacity: 0; transition: opacity .15s; }
.bq.in .bq-velo { opacity: 1; }
.bq-panel { position: absolute; inset-inline: 0; margin-inline: auto; top: 12vh; width: min(640px, calc(100vw - 32px)); height: min(520px, calc(100dvh - 12vh - 24px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; transform: translateY(-6px) scale(.985); transition: opacity .15s, transform .15s; }
.bq.in .bq-panel { opacity: 1; transform: none; }
.bq-campo { display: flex; align-items: center; gap: 10px; height: 56px; padding-inline: 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.bq-campo .bq-lupa { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.bq-campo input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 16px; } /* 16 px: el teléfono no hace zoom al enfocar */
.bq-campo input::placeholder { color: var(--muted); }
.bq-x, .bq-esc { display: inline-grid; place-items: center; height: 32px; border-radius: 8px; color: var(--muted); flex-shrink: 0; }
.bq-x { width: 32px; }
.bq-x:hover:not(:disabled), .bq-esc:hover { background: var(--surface-2); color: var(--text); }
.bq-x:disabled { visibility: hidden; } /* el lugar queda: aparecer al escribir no corre nada */
.bq-esc { padding-inline: 4px; }
.bq-esc .bq-esc-x { display: none; width: 20px; height: 20px; }
.bq-lista { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 10px; scroll-padding-block: 34px 8px; }
.bq-g + .bq-g { margin-top: 4px; }
.bq-gh { position: sticky; top: -6px; z-index: 1; padding: 10px 10px 6px; background: var(--surface); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bq-o { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.bq-o.on { background: var(--accent-soft); }
.bq-oi { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.bq-oi .ic { width: 16px; height: 16px; }
.bq-o.on .bq-oi { color: var(--accent-ink); border-color: var(--accent-ring); }
.bq-ot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bq-ot b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-ot small { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-ot small span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bq-ot small .ic { width: 12px; height: 12px; flex-shrink: 0; }
.bq-ot mark { background: transparent; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent-ring); }
.bq-enter { visibility: hidden; }
.bq-o.on .bq-enter { visibility: visible; }
/* Deshabilitada: en su lugar, gris, con el motivo en vez del camino (regla del dueño: no se esconde). */
.bq-o.bq-o-off { cursor: not-allowed; }
.bq-o.bq-o-off .bq-ot b, .bq-o.bq-o-off .bq-oi { opacity: .55; }
.bq-o.bq-o-off .bq-enter { visibility: hidden; }
.bq-dis { color: var(--amber) !important; }
.bq-o.bq-no { animation: bq-no .3s; }
@keyframes bq-no { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.bq-vacio { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--text-2); }
.bq-vacio .bq-vacio-i { width: 28px; height: 28px; color: var(--muted); }
.bq-vacio b { color: var(--text); font-size: 15px; overflow-wrap: anywhere; }
.bq-vacio p { max-width: 380px; font-size: 13px; color: var(--muted); }
.bq-pie { display: flex; align-items: center; gap: 16px; height: 40px; padding-inline: 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.bq-pie > span { display: inline-flex; align-items: center; gap: 6px; }
.bq-pie kbd { height: 20px; padding: 0 5px; }
.bq-n { margin-inline-start: auto; }

/* Teléfono: hoja casi a pantalla completa, sin el pie de teclas; la ✕ cierra (no hay Esc). */
@media (max-width: 899px) {
  .bq-panel { top: 8px; width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: 640px; border-radius: 14px; }
  .bq-esc kbd { display: none; }
  .bq-esc .bq-esc-x { display: block; }
  .bq-esc { width: 40px; height: 40px; }
  .bq-x { width: 40px; height: 40px; }
  .bq-pie { display: none; }
  .bq-o { min-height: 52px; }
  .bq-enter { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bq-velo, .bq-panel { transition: none; }
  .bq-panel { transform: none; }
  .bq-o.bq-no { animation: none; }
}

/* ── Lo encontrado: la tarjeta (o el subtítulo) se marca un momento al llegar. Sólo contorno y sombra: no ocupa lugar. ── */
.bq-foco { scroll-margin-block: calc(var(--top) + 16px) 96px; outline: 2px solid var(--accent); outline-offset: 3px; animation: bq-foco 2.4s ease-out forwards; }
@keyframes bq-foco { 0%, 55% { outline-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-ring); } 100% { outline-color: transparent; box-shadow: 0 0 0 0 transparent; } }
.bq-foco-t:focus { outline: none; }
.bq-foco.bq-foco-t:focus { outline: 2px solid var(--accent); }
@media (prefers-reduced-motion: reduce) { .bq-foco { animation: none; } }
