/* Tostao · Sitio — buscador: sugerencias en vivo (panel de la cabecera y cajón del móvil).
   Se carga en todas las páginas porque la lupa vive en la cabecera. Todo cuelga de .ts-w; clases con prefijo ts-b-.
   La página de resultados tiene su propia hoja (buscador-resultados.css). Cortes: 960 (tableta) y 600 (móvil). */

/* ---- la lupa de la cabecera: objetivo táctil de 44 px ---- */
.ts-w .ts-ico[data-ts-buscar] { width: 44px; height: 44px; }

/* ---- el panel que se abre bajo la cabecera: crece con las sugerencias y, si no caben, se desplaza por dentro ---- */
.ts-w .ts-buscador { max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); overflow-y: auto; overscroll-behavior: contain; }
.ts-w .ts-buscador form { align-items: center; }
.ts-w .ts-buscador input[type="search"] { min-height: 46px; }
.ts-w .ts-buscador .ts-pill { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
/* El panel es blanco: el anillo de foco amarillo del reinicio general no se vería; aquí va en granate. */
.ts-w .ts-buscador :focus-visible, .ts-w .ts-b-m :focus-visible { outline-color: var(--ts-granate); }
/* La «x» para vaciar el campo, en granate (la del navegador sale azul). */
.ts-w .ts-buscador input[type="search"]::-webkit-search-cancel-button, .ts-w .ts-b-mform input[type="search"]::-webkit-search-cancel-button, .ts-w .ts-b-form input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-left: 6px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' fill='none' stroke='%235B1117' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat; }

/* ---- desplegable de sugerencias ---- */
.ts-w .ts-b-sug { max-width: 720px; margin: 14px auto 2px; color: var(--ts-granate); font-family: var(--ts-fuente); }
.ts-w .ts-b-sug[hidden] { display: none; }
.ts-w .ts-b-msg { margin: 0 0 10px; padding: 0 6px; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ts-suave); }
.ts-w .ts-b-msg[hidden] { display: none; }
.ts-w .ts-b-lista { border: 1px solid var(--ts-linea); border-radius: 20px; background: #fff; overflow: hidden; }
.ts-w .ts-b-gt { padding: 14px 20px 6px; font: 800 11px/1.2 var(--ts-fuente); letter-spacing: .14em; text-transform: uppercase; color: var(--ts-suave); }
.ts-w .ts-b-lista:empty { display: none; } /* con un aviso de error la lista queda vacía: sin la raya del borde */
.ts-w .ts-b-g + .ts-b-g { border-top: 1px solid var(--ts-linea); }

.ts-w .ts-b-lista .ts-b-op { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 20px; color: var(--ts-granate); text-decoration: none; background: #fff; cursor: pointer; }
.ts-w .ts-b-lista .ts-b-op:hover, .ts-w .ts-b-lista .ts-b-op:visited { color: var(--ts-granate); }
.ts-w .ts-b-lista .ts-b-op:hover { background: var(--ts-crema-claro); }
.ts-w .ts-b-lista .ts-b-op[aria-selected="true"] { background: var(--ts-crema-claro); outline: 2px solid var(--ts-granate); outline-offset: -2px; border-radius: 14px; }

.ts-w .ts-b-foto { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--ts-gris); overflow: hidden; display: grid; place-items: center; }
.ts-w .ts-b-foto img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; display: block; border-radius: 0; }
.ts-w .ts-b-foto.ts-b-sinfoto { background: var(--ts-crema-claro); }
.ts-w .ts-b-foto svg { width: 24px; height: 24px; stroke: var(--ts-granate); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.ts-w .ts-b-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ts-w .ts-b-txt b { font-size: 14.5px; line-height: 1.3; font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ts-w .ts-b-txt small { font-size: 12.5px; line-height: 1.35; color: var(--ts-suave); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-w .ts-b-pr { flex: none; font-size: 14px; font-weight: 800; white-space: nowrap; }

.ts-w .ts-b-lista .ts-b-todos { justify-content: space-between; min-height: 56px; border-top: 1px solid var(--ts-linea); background: var(--ts-crema-claro); font-weight: 800; font-size: 14px; }
.ts-w .ts-b-lista .ts-b-todos:hover { background: var(--ts-crema); }
.ts-w .ts-b-lista .ts-b-todos[aria-selected="true"] { background: var(--ts-crema); }
.ts-w .ts-b-todos-t { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.ts-w .ts-b-todos-i svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ts-w .ts-b-lista:not(:has(.ts-b-g)) .ts-b-todos { border-top: 0; }

/* ---- búsqueda del cajón del móvil ---- */
.ts-w .ts-b-m { padding: 6px 4px 12px; }
.ts-w .ts-b-mform { display: flex; gap: 8px; align-items: center; margin: 0; }
.ts-w .ts-b-mform input[type="search"] { flex: 1; min-width: 0; min-height: 48px; border: 1.5px solid var(--ts-granate); border-radius: 999px; padding: 12px 20px; font: 500 16px/1.2 var(--ts-fuente); color: var(--ts-granate); background: #fff; appearance: none; -webkit-appearance: none; box-shadow: none; margin: 0; }
.ts-w .ts-b-mform input[type="search"]::placeholder { color: var(--ts-suave); opacity: 1; }
.ts-w .ts-b-mform .ts-b-mbtn { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--ts-granate); color: var(--ts-amarillo); display: grid; place-items: center; }
.ts-w .ts-b-mform .ts-b-mbtn:hover { background: var(--ts-granate-osc); }
.ts-w .ts-b-mform .ts-b-mbtn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ts-w .ts-cajon .ts-b-sug { max-width: none; margin: 12px 0 4px; }

/* ---- tableta y móvil ---- */
@media (max-width: 960px) {
	.ts-w .ts-buscador { max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); }
}
@media (max-width: 600px) {
	.ts-w .ts-buscador { padding: 14px 14px 16px; }
	.ts-w .ts-buscador form { gap: 8px; }
	.ts-w .ts-buscador input[type="search"] { padding: 12px 16px; font-size: 16px; }
	.ts-w .ts-buscador .ts-pill { padding-left: 18px; padding-right: 18px; }
	.ts-w .ts-b-lista { border-radius: 16px; }
	.ts-w .ts-b-lista .ts-b-op { padding: 8px 14px; gap: 12px; }
	.ts-w .ts-b-gt { padding: 12px 14px 4px; }
	.ts-w .ts-b-foto { width: 44px; height: 44px; }
	.ts-w .ts-b-txt b { font-size: 14px; }
	.ts-w .ts-b-pr { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
	.ts-w .ts-b-lista, .ts-w .ts-b-lista * { transition: none !important; animation: none !important; }
}
