/*SEARCHER*/
/* ====== Disparador en header (lupa Avada) ====== */
.buscador-header{
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
  margin-left: .5rem;
  z-index: 60;
}
.buscador-header .bh-open{
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 9999px;
  background: #db304f ; cursor: pointer; line-height: 1;
  margin-top: -10px; margin-right: 3px;
}
.buscador-header .bh-open::before{
  content: "\f002";          /* icono Avada/FA */
  font-size: 14px;
  color:#fff;
}
/* Ocultar nativo SOLO si el JS inicializó (.bh-ready) */
.buscador-header.bh-ready .fusion-search-form,
.buscador-header.bh-ready .fusion-search-results-wrapper,
.buscador-header.bh-ready .fusion-search-button{
  display: none !important;
}

/* ====== Modal ====== */
.bh-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999999999;
  display: none;
}
.bh-overlay.is-open{ display:flex; }
.bh-modal{
  width: min(760px, calc(100vw - 32px));
  margin: 10vh auto 4vh;
  background:#fff; border-radius:14px;
  box-shadow:0 15px 40px rgba(0,0,0,.18);
  position:relative; padding:18px 18px 10px;
}
.bh-title{ margin:0 0 12px; font-size:18px; font-weight:600; }
.bh-close{
  position:absolute; top:10px; right:10px;
  border:0; background:transparent; cursor:pointer;
  width:36px; height:36px; border-radius:9999px; font-size:22px; line-height:1;
}
.bh-close:after{ content:"✕"; }
/* Fila input + botón */
.bh-modal .fusion-search-form-content{ display:flex; gap:10px; align-items:center; }
.bh-modal .fusion-search-field{ position:static !important; transform:none !important; width:auto !important; flex:1 1 auto; opacity:1 !important; pointer-events:auto !important; overflow:visible !important; }
.bh-modal .fusion-search-field input[type="search"]{
  width:100%; padding:.8rem 1rem; border-radius:10px;
  border:1px solid rgba(0,0,0,.15); background:#fff;
  font-size:16px; line-height:1.2; outline:none; box-shadow:0 6px 18px rgba(0,0,0,.06) inset;
}
.bh-modal .fusion-search-field input::placeholder{ opacity:.55; }
.bh-modal .fusion-search-button{ display:block !important; }
.bh-modal .fusion-search-submit{
  font-size:0; border:0; cursor:pointer; height:42px; padding:0 16px;
  border-radius:10px; background:#111; color:#fff;
}
.bh-modal .fusion-search-submit::after{ content:attr(data-label); font-size:15px; font-weight:600; }

/* Resultados (contenedor) */
.bh-modal .fusion-search-results-wrapper{
  position:relative !important; left:0; top:0; right:0;
  width:100% !important; max-height:min(60vh, 520px);
  overflow:auto; margin-top:10px; 
  display:block !important;
}
html.bh-lock, body.bh-lock{ overflow:hidden !important; }
@media (max-width:600px){
  .bh-modal{ margin:8vh auto 3vh; border-radius:12px; padding:14px 14px 8px; }
  .bh-title{ font-size:16px; margin-bottom:10px; }
  .bh-modal .fusion-search-field input[type="search"]{ font-size:15px; }
}

/* ====== Live search: fila, imagen, título (2 líneas), badge ====== */
.bh-modal .fusion-search-results{ padding:6px; }
.bh-modal .fusion-search-result{
  display:flex; align-items:center;
  padding:10px 12px; border-bottom:1px solid rgba(0,0,0,.06);
  text-decoration:none; border-radius:8px;
}
.bh-modal .fusion-search-result:last-child{ border-bottom:none; }
.bh-modal .fusion-search-result:hover{ background:rgba(0,0,0,.03); }
.bh-modal .fusion-search-image{ flex:0 0 56px; width:56px; height:56px; border-radius:8px; overflow:hidden; margin-right:12px; }
.bh-modal .fusion-search-image-tag{ width:100%; height:100%; object-fit:cover; display:block; }
.bh-modal .fusion-search-content{ flex:1 1 auto; min-width:0; display:flex; align-items:center; }
.bh-modal .fusion-search-post-title{
  flex:1 1 auto; min-width:0; font-size:16px; line-height:1.3; color:#222;
  overflow:hidden; max-height:2.6em; white-space:normal; word-break:break-word;
}
.bh-modal .fusion-search-post-type{
  margin-left:12px; padding:4px 8px; border-radius:9999px;
  font-size:12px; font-weight:600; text-transform:uppercase; white-space:nowrap;
  color:#0a7c66; background:rgba(10,124,102,.12); border:1px solid rgba(10,124,102,.35);
}
.bh-modal .fusion-search-image:empty{ display:none; }

/* Oculta el buscador nativo SOLO cuando el bloque está listo */
.buscador-header.bh-ready .fusion-search-form,
.buscador-header.bh-ready .fusion-search-results-wrapper,
.buscador-header.bh-ready .fusion-search-button{ display:none !important; }

@media (max-width: 767px){
    .buscador-header .bh-open{ width: 39px; height: 39px; margin-top: 0; margin-right: 0;}
    .buscador-header .bh-open:before{ font-size:23px;}
} 

/*END SEARCHER*/
