/* HDM header instant search (Typesense AJAX) — replaces FiboSearch.
   Scoped to .hdm-hsearch so it never leaks into the rest of the page. */

.hdm-hsearch {
  position: relative;
  width: 100%;
  font-family: inherit;
}

/* The header top bar and the nav are both z-index:32; the search dropdown lives
   inside the top bar's stacking context, so the (later-in-DOM) nav painted over
   it. Lift the top bar's stacking context above the nav so the dropdown wins. */
.hdm-hdr-top { z-index: 40; }

/* --- input row (white pill) --- */
.hdm-hsearch__form {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
/* Doubled context (0,2,0) so it beats the theme's input[type="search"]
   rules (0,1,1) — Shoptimizer reserves 43px left padding for its own
   magnifier icon, plus a border and a 40px height we don't want. */
.hdm-hsearch .hdm-hsearch__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 14px;
  height: 44px;
  font-size: 0.95rem;
  color: #1a2433;
}
.hdm-hsearch .hdm-hsearch__input::placeholder { color: #8a93a0; }
/* Doubled context (0,2,0) so the header's ".hdm-hdr button" reset (0,1,1)
   can't strip the blue box. */
.hdm-hsearch .hdm-hsearch__btn {
  flex: 0 0 auto;
  width: 48px;
  border: 0;
  cursor: pointer;
  background: #1763d6;            /* header blue accent */
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hdm-hsearch .hdm-hsearch__btn:hover { background: #1257bd; }
.hdm-hsearch .hdm-hsearch__btn svg { width: 20px; height: 20px; fill: currentColor; }

/* --- dropdown panel --- */
.hdm-hsearch__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 30, 55, 0.18);
  border: 1px solid #e8ebef;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  text-align: left;
}
.hdm-hsearch__loading,
.hdm-hsearch__empty {
  padding: 16px;
  color: #6b7280;
  font-size: 0.85rem;
}

.hdm-hsearch__sec { padding: 4px 0; }
.hdm-hsearch__sec + .hdm-hsearch__sec { border-top: 1px solid #eef1f4; }
.hdm-hsearch__sec-h {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3af;
  padding: 8px 12px 4px;
}

/* category row */
.hdm-hsearch__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a2433;
}
.hdm-hsearch__cat:hover { background: #f3f6fb; }
.hdm-hsearch__cat-name { font-size: 0.9rem; font-weight: 600; }
.hdm-hsearch__cat-count {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: #6b7280;
  background: #eef1f4;
  border-radius: 999px;
  padding: 2px 9px;
}

/* product card (clean: thumb + title + price) */
.hdm-hsearch__prod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a2433;
}
.hdm-hsearch__prod:hover { background: #f3f6fb; }
.hdm-hsearch__pthumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #f7f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hdm-hsearch__pthumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hdm-hsearch__pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hdm-hsearch__ptitle {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hdm-hsearch__pprice { font-size: 0.9rem; font-weight: 700; color: #1763d6; }

/* footer */
.hdm-hsearch__all {
  display: block;
  text-align: center;
  padding: 11px;
  margin-top: 4px;
  border-top: 1px solid #eef1f4;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1763d6;
  text-decoration: none;
}
.hdm-hsearch__all:hover { background: #f3f6fb; }

/* ---------------- mobile overlay (hosts the full-screen compose page) ----- */
.hdm-hsearch-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #fff;
  padding: 0;
  flex-direction: column;
}
.hdm-hsearch-overlay .hdm-compose { flex: 1; min-height: 0; }
body.hdm-hsearch-open { overflow: hidden; }
body.hdm-hsearch-open .hdm-hsearch-overlay { display: flex; }
/* flex-start pins the close button to the TOP right — the widget column
   below it grows tall with results, and align-items:center used to drag
   the button down to the vertical middle of the list. */
.hdm-hsearch-overlay-top { display: flex; align-items: flex-start; gap: 10px; }
.hdm-hsearch-overlay .hdm-hsearch { flex: 1 1 auto; }
.hdm-hsearch-overlay .hdm-hsearch__input { height: 48px; }
/* Doubled class (0,2,0) so the header's ".hdm-hdr-m button" reset (0,1,1)
   can't strip the box — same trap as the transparent Ask pill. */
.hdm-hsearch-overlay__close.hdm-hsearch-overlay__close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 0;
  background: #B23A26;
  border-radius: 10px;
  font-size: 1.9rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
/* inside the overlay the panel is inline (full-height list), not a floating dropdown */
.hdm-hsearch-overlay .hdm-hsearch__panel {
  position: static;
  margin-top: 12px;
  box-shadow: none;
  border: 0;
  max-height: none;
  padding: 0;
}

/* ---------------- mobile full-width "Ask" pill (own row under actions) ------ */
@media (max-width: 999.98px) {
  /* Doubled class (0,2,0) so it beats the header button reset
     ".hdm-hdr-m button { background:none; border:0 }" (0,1,1) — otherwise the
     pill renders transparent + borderless and the sticky header shows a gap the
     hero scrolls through (the "overlap"). */
  .hdm-hdr-askbar.hdm-hdr-askbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 28px);
    margin: 10px 14px 12px;
    padding: 0 14px;
    height: 46px;
    background: #fff;
    border: 1.5px solid #bcd3f5;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
  }
  .hdm-hdr-askbar__ic { flex: 0 0 auto; display: flex; color: var(--hdmh-blue, #1763d6); }
  .hdm-hdr-askbar__ic svg,
  .hdm-hdr-askbar__ic .hdm-hdr-ic { width: 19px; height: 19px; }
  .hdm-hdr-askbar__ghost {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14.5px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hdm-hdr-askbar__tag {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--hdmh-blue, #1763d6);
    background: #eef4fe;
    border-radius: 999px;
    padding: 3px 10px;
  }
}

/* ------- desktop pill: magnifier left, green ask label, green go button ----
   The desktop $search_form(true) variant. Fully rounded pill, decorative
   magnifier on the left, a green "or ask a question" hint inside the pill,
   and a round green arrow as the submit. Overlay/mobile keeps the plain
   input + blue magnifier button. */
.hdm-hdr-search .hdm-hsearch__form {
  border-radius: 999px;
  align-items: center;
  padding: 0 4px 0 16px;
}
.hdm-hdr-search .hdm-hsearch__mag {
  width: 17px;
  height: 17px;
  color: #56627A;
  flex: 0 0 auto;
}
.hdm-hdr-search .hdm-hsearch__input { padding: 0 10px; }
/* Smaller hint type on desktop so a full example question fits the pill —
   text the shopper actually types stays at the regular size. */
.hdm-hdr-search .hdm-hsearch__input::placeholder { font-size: 12.5px; }
.hdm-hsearch__asklabel {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1E8E33;
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
  padding: 0 8px 0 4px;
  pointer-events: none;     /* a hint, not a control */
}
.hdm-hsearch__asklabel svg { flex: 0 0 auto; fill: currentColor; }
.hdm-hdr-search .hdm-hsearch__btn--go {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--hdmh-green, #37B44A);
}
.hdm-hdr-search .hdm-hsearch__btn--go:hover { background: #1E8E33; }
/* squeezed band: keep the pill usable, drop the hint */
@media (min-width: 1000px) and (max-width: 1150px) {
  .hdm-hsearch__asklabel { display: none; }
}

/* ------- desktop dropdown: starter questions + footer -------
   Rendered only for the non-overlay widget by header-search.js. The
   .hdm-hsearch__panel prefix keeps every interactive element at (0,2,0) so
   the theme's button resets and ".hdm-hdr button" can't strip them. */
.hdm-hsearch__tryh {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3af;
  padding: 12px 12px 6px;
}
.hdm-hsearch__try {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #EEF4FE;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 6px 8px;
  color: #1A2433;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.hdm-hsearch__try:hover { background: #E3EDFD; }
.hdm-hsearch__try svg { flex: 0 0 auto; color: #115FEB; }
.hdm-hsearch__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #eef1f4;
  margin-top: 6px;
  padding: 10px 6px 4px;
}
.hdm-hsearch__call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #56627A;
  font-size: 13.5px;
  text-decoration: none;
}
.hdm-hsearch__call b { color: #1A2433; font-weight: 800; }
.hdm-hsearch__call svg { color: #1E8E33; flex: 0 0 auto; }
.hdm-hsearch__panel .hdm-hsearch__gosearch {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: #1E8E33;
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  font-family: inherit;
  padding: 12px 26px;
  cursor: pointer;
}
.hdm-hsearch__panel .hdm-hsearch__gosearch:hover { background: #176F28; }
