/* 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);
}
.hdm-hsearch__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 14px;
  height: 44px;
  font-size: 0.95rem;
  color: #1a2433;
}
.hdm-hsearch__input::placeholder { color: #8a93a0; }
.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__btn:hover { background: #1257bd; }
.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 ---------------- */
.hdm-hsearch-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #fff;
  padding: 14px;
  flex-direction: column;
}
body.hdm-hsearch-open { overflow: hidden; }
body.hdm-hsearch-open .hdm-hsearch-overlay { display: flex; }
.hdm-hsearch-overlay-top { display: flex; align-items: center; gap: 10px; }
.hdm-hsearch-overlay .hdm-hsearch { flex: 1 1 auto; }
.hdm-hsearch-overlay__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  background: #f1f3f6;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  color: #1a2433;
  cursor: pointer;
}
/* 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;
}
