/* ─────────────────────────────────────────────────────────────────────────────
   ia-search-layer.css  v1  ·  Buscador en capa de la cabecera  ·  posterandpanel.com  ·  NUMON
   Caja de la cabecera y capa de resultados (js/ia-search-layer.js). Todo va bajo .bc- para no
   tocar el resto de la web. La tarjeta es la del asistente (css/ia-search.css): mismos
   colores (#007A53 para texto y botones, #84BD00 solo de fondo con texto oscuro).
   Escritorio: la capa empieza bajo la caja, con los filtros a la izquierda. Móvil
   (< 768 px): pantalla entera, caja arriba y filtros tras «Filtrar». La web no es
   responsive hasta los sprints 3 y 4: el modo móvil se vuelve a probar con el responsive.
   Tarea: GENERICS/Claude/2026_10_21_buscador-en-capa-con-asistente (maqueta aprobada).
   Al final, el botón flotante del asistente (includes/ia-search-layer.php).
   v1.1 · 2026-10-21 · botón flotante del asistente
   v1 · 2026-10-21 · NUMON
   ───────────────────────────────────────────────────────────────────────────── */

:root {
	--bc-verde: #007A53;
	--bc-verde-osc: #005f40;
	--bc-lima: #84BD00;
	--bc-lima-osc: #74a600;
	--bc-tinta-lima: #1f2a00;
	--bc-texto: #363635;
	--bc-gris: #66676a;
	--bc-suave: #f2f4ef;
	--bc-borde: #dde2d6;
	--bc-marca: #e3f0c2;
}
.bc-caja, .bc-capa, .bc-fondo { box-sizing: border-box; }
.bc-caja *, .bc-capa * { box-sizing: border-box; }

/* ── La caja de la cabecera ── */
header .row_1 #formBusc { position: relative; z-index: 1002; }   /* la caja queda por encima del fondo de la capa */
header .row_1 .container div.bc-caja { margin: 0; }
.bc-caja { position: relative; display: flex; align-items: center; width: 460px; height: 44px; background: #fff; border: 1px solid #d2d2d2; border-radius: 6px; }
.bc-caja:focus-within { border-color: var(--bc-verde); box-shadow: 0 0 0 1px var(--bc-verde); }
.bc-caja .bc-lupa { flex: 0 0 auto; width: 18px; height: 18px; margin: 0 8px 0 13px; color: var(--bc-gris); }
header .row_1 .bc-caja input, .bc-caja input { flex: 1; min-width: 0; width: auto; height: 42px; padding: 0 8px 0 0; border: 0; background: transparent; font-size: 15px; color: var(--bc-texto); outline: 0; }
.bc-caja input::-webkit-search-cancel-button { display: none; }
/* Asistente en la cabecera de la capa: con borde y sin relleno, para que se lea como «otra opción» y no como «Buscar» */
.bc-btn-asistente { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: 1px solid var(--bc-verde); border-radius: 999px; background: #fff; color: var(--bc-verde); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.bc-btn-asistente:hover, .bc-btn-asistente:focus { background: var(--bc-verde); color: #fff; text-decoration: none; }
.bc-btn-asistente:focus-visible { outline: 2px solid var(--bc-texto); outline-offset: 2px; }
.bc-btn-asistente svg { width: 17px; height: 17px; }
.bc-btn-asistente[hidden] { display: none; }
.bc-btn-asistente .bc-corto { display: none; }

/* ── Fondo y capa ── */
.bc-fondo { position: fixed; inset: 0; z-index: 1000; background: rgba(30, 32, 28, .45); }
.bc-capa { position: fixed; z-index: 1001; left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 1170px; bottom: 16px;
	display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; color: var(--bc-texto); font-size: 14px; }
.bc-fondo[hidden], .bc-capa[hidden] { display: none; }
.bc-capa.bc-capa-sin { bottom: auto; }   /* sin resultados, la capa solo tiene el alto del mensaje */
html.bc-abierta, html.bc-abierta body { overflow: hidden; }   /* con la capa abierta, la página de detrás no se desplaza */

.bc-cab { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--bc-borde); }
.bc-cab-movil { display: none; }
.bc-titulo { flex: 1; margin: 0; font-size: 16px; font-weight: 600; color: var(--bc-texto); }
.bc-titulo b { color: var(--bc-verde); }
.bc-capa.bc-cargando .bc-resultados { opacity: .55; transition: opacity .15s; }   /* mientras llega la respuesta nueva */
.bc-cerrar { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--bc-gris); font-size: 26px; line-height: 1; cursor: pointer; }
.bc-cerrar:hover, .bc-cerrar:focus-visible { background: var(--bc-suave); color: var(--bc-texto); }
.bc-btn-filtrar { display: none; }

.bc-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.bc-cuerpo.bc-sin { grid-template-columns: minmax(0, 1fr); }
.bc-cuerpo.bc-sin .bc-filtros { display: none; }

/* ── Filtros ── */
.bc-filtros { overflow-y: auto; padding: 16px 16px 20px 20px; border-right: 1px solid var(--bc-borde); background: #fbfcfa; }
.bc-filtros h3 { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--bc-gris); }
.bc-filtros h3 + ul { margin-bottom: 18px; }
.bc-filtros ul { margin: 0; padding: 0; }
.bc-filtros li { list-style: none; }
.bc-filtro { display: flex; width: 100%; gap: 8px; align-items: baseline; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--bc-texto); font-size: 14px; text-align: left; cursor: pointer; }
.bc-filtro:hover { background: var(--bc-suave); }
.bc-filtro:focus-visible { outline: 2px solid var(--bc-verde); outline-offset: -2px; }
.bc-filtro span { flex: 1; }
.bc-filtro em { font-style: normal; font-size: 12px; color: var(--bc-gris); }
.bc-filtro[aria-pressed="true"] { background: var(--bc-verde); color: #fff; font-weight: 600; }
.bc-filtro[aria-pressed="true"] em { color: #fff; }
.bc-subs { margin: 2px 0 6px 12px !important; padding-left: 8px !important; border-left: 2px solid var(--bc-borde); }
.bc-subs .bc-filtro { font-size: 13px; padding: 5px 8px; }
.bc-subs .bc-filtro[aria-pressed="true"] { background: var(--bc-lima); color: var(--bc-tinta-lima); }
.bc-subs .bc-filtro[aria-pressed="true"] em { color: var(--bc-tinta-lima); }
.bc-check { display: flex; gap: 8px; align-items: center; margin: 0; padding: 6px 8px; font-size: 14px; font-weight: 400; cursor: pointer; }
.bc-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--bc-verde); }
.bc-check em { font-style: normal; font-size: 12px; color: var(--bc-gris); }
.bc-quitar { margin: 4px 0 0 8px; padding: 0; border: 0; background: none; color: var(--bc-verde); font-size: 13px; text-decoration: underline; cursor: pointer; }
.bc-quitar[hidden] { display: none; }
.bc-filtros .bc-ver { display: none; }

/* ── Resultados: la tarjeta del asistente ── */
.bc-resultados { overflow-y: auto; padding: 18px 20px 24px; }
.bc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 0; padding: 0; }
.bc-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--bc-borde); border-radius: 12px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.bc-card:hover, .bc-card.bc-activo { border-color: var(--bc-verde); box-shadow: 0 0 0 1px var(--bc-verde); }
.bc-card-foto { position: relative; display: block; flex: 0 0 auto; height: 0; padding-top: 75%; background: #fafafa; overflow: hidden; }   /* marco fijo 4:3: todas las fotos del mismo tamaño */
.bc-card-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.bc-card-cuerpo { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 14px 14px; }
.bc-card-familia { margin: 0; font-size: 12px; color: var(--bc-gris); text-transform: uppercase; letter-spacing: .02em; }
.bc-card h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; }
.bc-card h3 a { color: var(--bc-texto); text-decoration: none; }
.bc-card h3 a:hover { color: var(--bc-verde); text-decoration: underline; }
.bc-card mark { padding: 0 1px; border-radius: 2px; background: var(--bc-marca); color: inherit; }
.bc-card-titular { margin: 0; font-size: 13px; color: var(--bc-gris); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-card-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.bc-btn { display: inline-block; padding: 7px 12px; border: 0; border-radius: 999px; background: var(--bc-verde); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.bc-btn:hover, .bc-btn:focus { background: var(--bc-verde-osc); color: #fff; text-decoration: none; }
.bc-btn:focus-visible { outline: 2px solid var(--bc-texto); outline-offset: 2px; }
.bc-btn-tienda { background: var(--bc-lima); color: var(--bc-tinta-lima); }
.bc-btn-tienda:hover, .bc-btn-tienda:focus { background: var(--bc-lima-osc); color: var(--bc-tinta-lima); }

/* ── Sin resultados ── */
.bc-vacio { max-width: 560px; margin: 40px auto; text-align: center; }
.bc-vacio p { margin: 0 0 18px; font-size: 16px; }
.bc-vacio-asistente { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 24px; border-radius: 12px; background: var(--bc-suave); }
.bc-vacio-asistente svg { width: 40px; height: 40px; color: var(--bc-verde); }
.bc-vacio-asistente h3 { margin: 0; font-size: 20px; font-weight: 700; color: var(--bc-verde); }
.bc-vacio-asistente p { margin: 0; font-size: 14px; color: var(--bc-gris); }
.bc-vacio-asistente .bc-btn { padding: 10px 18px; font-size: 15px; }

/* ── Pie: el asistente a un clic ── */
.bc-pie { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--bc-borde); background: var(--bc-suave); }
.bc-pie a { color: var(--bc-verde); font-size: 15px; font-weight: 600; text-decoration: none; }
.bc-pie a:hover, .bc-pie a.bc-activo { text-decoration: underline; }
.bc-pie span { color: var(--bc-texto); font-weight: 400; }
.bc-pie[hidden] { display: none; }

.bc-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Móvil (< 768 px): pantalla entera, caja arriba, filtros tras un botón, tarjeta en horizontal ── */
@media (max-width: 767px) {
	.bc-capa { inset: 0; left: 0; transform: none; z-index: 1003; width: 100%; max-width: none; border-radius: 0; top: 0 !important; bottom: 0; }
	.bc-capa.bc-capa-sin { bottom: 0; }
	.bc-cab { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
	.bc-cab-movil { display: flex; width: 100%; gap: 8px; align-items: center; }
	.bc-cab-movil .bc-caja { flex: 1; width: auto; }
	.bc-btn-asistente { height: 30px; padding: 0 10px; font-size: 13px; gap: 5px; }
	.bc-btn-asistente .bc-largo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.bc-btn-asistente .bc-corto { display: inline; }
	.bc-titulo { flex-basis: 100%; }
	.bc-cab-movil input { font-size: 16px; } /* evita el zoom de iOS */
	.bc-cab > .bc-cerrar { display: none; }
	.bc-titulo { font-size: 14px; }
	.bc-btn-filtrar { display: inline-block; flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--bc-verde); border-radius: 999px; background: #fff; color: var(--bc-verde); font-size: 13px; font-weight: 600; cursor: pointer; }
	.bc-btn-filtrar[aria-expanded="true"] { background: var(--bc-verde); color: #fff; }
	.bc-cuerpo { grid-template-columns: minmax(0, 1fr); position: relative; }
	.bc-filtros { display: none; position: absolute; inset: 0; z-index: 2; border-right: 0; }
	.bc-filtros.bc-abiertos { display: block; }
	.bc-filtros .bc-ver { display: block; width: 100%; margin-top: 18px; padding: 10px; font-size: 15px; text-align: center; }
	.bc-resultados { padding: 12px; }
	.bc-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.bc-card { flex-direction: row; }
	.bc-card-foto { flex: 0 0 104px; align-self: flex-start; height: 104px; padding-top: 0; }   /* en móvil, cuadrado fijo */
	.bc-card-cuerpo { padding: 10px 12px; gap: 4px; }
	.bc-card h3 { font-size: 15px; }
	.bc-card-familia { font-size: 11px; }
	.bc-card-titular { -webkit-line-clamp: 1; }
	.bc-btn { padding: 6px 10px; font-size: 12px; }
	.bc-pie { padding: 10px 12px; }
	.bc-pie a { font-size: 14px; text-align: center; }
	.bc-vacio { margin: 24px 12px; }
}


/* ── Botón flotante del asistente (abajo a la derecha, todas las páginas menos t-search) ── */
.bc-flotante { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; height: 56px; padding: 0 16px; border-radius: 999px; background: var(--bc-verde); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); text-decoration: none; font-size: 15px; font-weight: 600; }
.bc-flotante:hover, .bc-flotante:focus { background: var(--bc-verde-osc); color: #fff; text-decoration: none; }
.bc-flotante:focus-visible { outline: 2px solid var(--bc-texto); outline-offset: 3px; }
.bc-flotante svg { flex: 0 0 auto; width: 24px; height: 24px; }
.bc-flotante span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .25s, margin .25s; }   /* el texto se despliega al pasar el ratón */
.bc-flotante:hover span, .bc-flotante:focus span { max-width: 260px; margin-left: 10px; }
html.bc-abierta .bc-flotante { display: none; }   /* con la capa abierta, el asistente ya está arriba de la capa */
@media (max-width: 767px) {
	.bc-flotante { right: 16px; bottom: 16px; height: 52px; padding: 0 14px; }
	.bc-flotante:hover span, .bc-flotante:focus span { max-width: 0; margin-left: 0; }   /* en móvil, solo el círculo */
}
@media (prefers-reduced-motion: reduce) {
	.bc-flotante span { transition: none; }
}
