/* ============================================================================
   search-menu.css — instant search-menu dropdown (buscador-menu, 2026-07-24)

   Three host contexts share the SAME .sr-panel/.sr-group/.sr-item rules
   (templates/_search_menu_results.html): the desktop .hdr-search dropdown
   (absolute, below the input), the 820-1350px full-screen overlay (.sr-mobile,
   triggered by .hdr-search-icon), and the <=820px burger drawer's own search
   (inline, .sr-panel-inline). Marea doctrine: hairlines (var(--line)/
   var(--line-2)), var(--surface) fields, mono group labels, serif item names,
   ONE burgundy accent on hover/active — no new colors, no heavy shadows
   beyond the same soft drop the header's existing .nav-menu dropdown uses.
   ============================================================================ */

/* .hdr-search-wrap/.hdr-search-mobile exist ONLY to give the desktop input
   and the mobile icon their own Alpine x-data scope — display:contents keeps
   them out of the .hdr-actions flex box entirely (zero width, zero extra
   `gap`), so the header's verified zero-overflow law at 320/390/1280/1330/
   1360px is untouched: children lay out exactly as if there were no wrapper. */
.hdr-search-wrap,.hdr-search-mobile{display:contents}
.hdr-search{position:relative}

.sr-panel{position:absolute;top:calc(100% + 10px);left:0;z-index:80;width:380px;max-width:calc(100vw - 40px);
  max-height:70vh;overflow-y:auto;background:var(--surface);border:1px solid var(--line-2);
  box-shadow:0 14px 40px -18px rgba(26,21,24,.4);padding:8px}
/* Inline variant (mobile overlay + burger drawer): no floating box, the
   panel just occupies normal document flow under the input. */
.sr-panel-inline{position:static;width:auto;max-width:none;border:0;box-shadow:none;padding:0;background:none}

.sr-group{padding:6px 0}
.sr-group + .sr-group{border-top:1px solid var(--line);margin-top:4px}
.sr-group-h{padding:8px 12px 4px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--warm-grey)}

.sr-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 12px;
  min-height:44px;color:var(--ink);transition:background var(--dur-fast,.2s) var(--ease-out,ease),color var(--dur-fast,.2s) var(--ease-out,ease)}
.sr-item:hover,.sr-item.is-active{background:var(--cream-2);color:var(--burgundy)}
/* El glifo del herbario abre la fila (notas y familias). Flex simple, SIN columna
   reservada: aquí las filas son heterogéneas (productos con etiqueta de estado,
   casas sin figura), y una sangría fantasma se leería como desalineación en vez de
   como orden — lo contrario que en el panel de filtros, donde la lista es homogénea
   y la columna fija sí alinea. */
.sr-item-glifo{width:14px;height:14px;flex:0 0 auto;margin-right:0;opacity:.85}
.sr-item:hover .sr-item-glifo,.sr-item.is-active .sr-item-glifo{opacity:1}
.sr-item-main{display:flex;flex-direction:column;gap:2px;min-width:0;margin-right:auto}
.sr-item-label{font-size:15px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr-item-sub{font-size:11px;color:var(--warm-grey);letter-spacing:.03em}
.sr-item.is-active .sr-item-sub,.sr-item:hover .sr-item-sub{color:var(--burgundy)}
.sr-item-tag{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--warm-grey);flex:0 0 auto}
.sr-item-count{font-size:11px;color:var(--warm-grey);flex:0 0 auto}

.sr-viewall{display:block;margin-top:4px;padding:11px 12px;border-top:1px solid var(--line);
  font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--burgundy);
  transition:background var(--dur-fast,.2s) var(--ease-out,ease)}
.sr-viewall:hover,.sr-viewall.is-active{background:var(--cream-2)}

.sr-loading{padding:16px 12px;color:var(--warm-grey);font-size:12px;letter-spacing:.03em}
.sr-empty{padding:16px 12px;font-size:12px;letter-spacing:.03em}
.sr-empty p{margin-bottom:6px;color:var(--ink);font-size:13px}
.sr-empty a{color:var(--burgundy);border-bottom:1px solid var(--burgundy);padding-bottom:1px}

/* ---------- mobile full-screen overlay (820-1350px .hdr-search-icon tap) ---------- */
.sr-mobile{position:fixed;inset:0;z-index:65;background:var(--bg);display:flex;flex-direction:column;padding:20px 24px}
.sr-mobile-top{display:flex;align-items:center;gap:14px;flex:0 0 auto}
.sr-mobile-form{flex:1;min-width:0}
.sr-mobile-form input{width:100%;font-family:var(--mono);font-size:16px;padding:13px 14px;
  border:1px solid var(--line-2);background:var(--surface);min-height:44px}
.sr-mobile-form input:focus{outline:2px solid var(--burgundy);outline-offset:2px}
.sr-mobile .sr-panel-inline{margin-top:16px;flex:1;overflow-y:auto}

/* ---------- burger drawer's own search (<=820px) ---------- */
.drawer .sr-panel-inline{margin-top:10px;max-height:45vh;overflow-y:auto}

@media(prefers-reduced-motion:reduce){
  .sr-item,.sr-viewall{transition:none}
}
