/* 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; }

/* ===== Inline PDP answer (item 5) ========================================= */
/* Flows at natural height inside the single-scroll compose body - no nested
   scroll, no max-height. */
.hdm-hsearch-answer { margin: 14px 0 0; }
.hdm-hsearch-answer .hdm-ia-q {
  margin: 0 0 12px; font-size: 14px; line-height: 1.4; color: #56627A;
  font-style: italic;
}
.hdm-hsearch-answer .hdm-ia-running {
  display: flex; align-items: center; gap: 10px;
  font-size: 14.5px; color: #56627A; padding: 6px 0;
}
.hdm-hsearch-answer .hdm-ia-spin {
  width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid #cfe0ff; border-top-color: #115FEB;
  animation: hdm-ia-spin 0.8s linear infinite;
}
@keyframes hdm-ia-spin { to { transform: rotate(360deg); } }
.hdm-hsearch-answer .hdm-ia-lead { font-size: 13px; font-weight: 700; color: #1E8E33; margin: 2px 0 6px; }
.hdm-hsearch-answer .hdm-ia-answer {
  font-size: 17px; line-height: 1.5; color: #1A2433;
  background: #f6f9ff; border: 1px solid #d8e4fb; border-radius: 14px;
  padding: 14px 16px;
}
.hdm-hsearch-answer .hdm-ia-picks { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.hdm-hsearch-answer .hdm-ia-see {
  display: flex; align-items: center; justify-content: center;
  margin-top: 14px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; background: #115FEB; color: #fff;
  font-size: 15px; font-weight: 800; text-decoration: none;
}
.hdm-hsearch-answer .hdm-ia-see:hover { background: #0C46B8; }

/* Universal overlay results (FB2-2): always-on summary + related pages. */
.hdm-hsearch-answer .hdm-ia-summary {
  font-size: 16px; line-height: 1.5; color: #1A2433; font-weight: 600;
  background: #f6f9ff; border: 1px solid #d8e4fb; border-radius: 14px;
  padding: 13px 15px; margin: 0 0 12px;
}
.hdm-hsearch-answer .hdm-ia-pick-p { color: #0C46B8; font-weight: 800; }
.hdm-hsearch-answer .hdm-ia-sugg-h { font-size: 12.5px; font-weight: 800; color: #56627A; text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.hdm-hsearch-answer .hdm-ia-sugg { display: flex; flex-direction: column; gap: 8px; }
.hdm-hsearch-answer .hdm-ia-sugcard {
  display: flex; flex-direction: column; gap: 2px; min-height: 48px; justify-content: center;
  padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 12px;
  text-decoration: none; background: #fff;
}
.hdm-hsearch-answer .hdm-ia-sugkind { font-size: 11px; font-weight: 700; color: #1E8E33; text-transform: uppercase; letter-spacing: .03em; }
.hdm-hsearch-answer .hdm-ia-sugname { font-size: 14.5px; font-weight: 600; color: #1A2433; line-height: 1.3; }

/* FB3-3: overlay mirrors /search - 3-step progress, rich pick cards, call. */
.hdm-hsearch-answer .hdm-ia-steps { display: flex; flex-direction: column; gap: 11px; margin: 10px 0 4px; }
.hdm-hsearch-answer .hdm-ia-step { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #8a93a0; }
.hdm-hsearch-answer .hdm-ia-step-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cfd8e3; flex: 0 0 auto; box-sizing: border-box; }
.hdm-hsearch-answer .hdm-ia-step[data-state="active"] { color: #1A2433; font-weight: 700; }
.hdm-hsearch-answer .hdm-ia-step[data-state="active"] .hdm-ia-step-dot { border-color: #115FEB; border-top-color: transparent; animation: hdm-ia-spin 0.8s linear infinite; }
.hdm-hsearch-answer .hdm-ia-step[data-state="done"] { color: #1E8E33; }
.hdm-hsearch-answer .hdm-ia-step[data-state="done"] .hdm-ia-step-dot { border-color: #1E8E33; background: #1E8E33; }
/* Rich "Our pick N" card - copied from the /search design (FB4-2) so the
   overlay product cards match the full results page exactly. */
.hdm-hsearch-answer .hdm-pick {
  background: #fff; border: 1px solid #DFE5EF; border-radius: 16px;
  box-shadow: 0 2px 12px rgba(16, 40, 90, .08);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative;
}
.hdm-hsearch-answer .hdm-pick-media {
  display: flex; align-items: center; justify-content: center; height: 140px;
  border: 1px solid #E4E7EC; border-radius: 12px; background: #fff; overflow: hidden;
}
.hdm-hsearch-answer .hdm-pick-img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.hdm-hsearch-answer .hdm-pick-noimg { display: block; width: 60%; height: 60%; border-radius: 8px; background: linear-gradient(135deg, #EDF0F5, #E0E5EC); }
.hdm-hsearch-answer .hdm-pick-rank { font-size: 12px; font-weight: 700; color: #0C46B8; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.hdm-hsearch-answer .hdm-pick-name { display: block; font-size: 16.5px; font-weight: 700; line-height: 1.3; color: #1A2433; text-decoration: none; }
.hdm-hsearch-answer .hdm-pick-price { font-size: 19px; font-weight: 800; color: #1E8E33; margin-top: 5px; }
.hdm-hsearch-answer .hdm-pick-reasons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hdm-hsearch-answer .hdm-pick-reason { display: flex; gap: 9px; font-size: 14.5px; line-height: 1.45; color: #1A2433; }
.hdm-hsearch-answer .hdm-pick-check { color: #37B44A; line-height: 0; margin-top: 2px; flex-shrink: 0; }
.hdm-hsearch-answer .hdm-pick-cta {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border-radius: 10px; border: 2px solid #1E8E33; color: #1E8E33;
  font-weight: 700; font-size: 15.5px; text-decoration: none;
}
/* Compact card - copied from the /search mini card. */
.hdm-hsearch-answer .hdm-mini {
  background: #fff; border: 1px solid #DFE5EF; border-radius: 14px;
  box-shadow: 0 2px 12px rgba(16, 40, 90, .08);
  padding: 12px; display: flex; gap: 14px; align-items: center; text-decoration: none;
}
.hdm-hsearch-answer .hdm-mini-media {
  width: 84px; height: 84px; flex-shrink: 0; border: 1px solid #E4E7EC;
  border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hdm-hsearch-answer .hdm-mini-img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.hdm-hsearch-answer .hdm-mini-body { min-width: 0; flex: 1; }
.hdm-hsearch-answer .hdm-mini-name {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; font-weight: 700; line-height: 1.3; color: #0C46B8;
}
.hdm-hsearch-answer .hdm-mini-spec { display: block; font-size: 13.5px; color: #56627A; margin: 3px 0 4px; }
.hdm-hsearch-answer .hdm-mini-price { display: block; font-size: 16px; font-weight: 800; color: #1A2433; }
.hdm-hsearch-answer .hdm-mini-chev { color: #56627A; flex-shrink: 0; line-height: 0; }
.hdm-hsearch-answer .hdm-ia-call { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; min-height: 48px; padding: 0 16px; border: 1px solid #cfe0cf; border-radius: 12px; background: #f0f8f1; color: #176F28; font-size: 14px; font-weight: 700; text-decoration: none; }
.hdm-hsearch-answer .hdm-ia-call b { color: #176F28; }

/* =========================================================================
   DESKTOP ON-PAGE ANSWER MODAL
   All rules scoped under body.hdm-srv-desktop so the mobile overlay styling
   and the existing desktop dropdown furniture are untouched. The modal is a
   CENTERED card behind a dimmed scrim (mirrors the mobile compose, desktop-
   sized) — not anchored under the pill, not the mobile full-screen overlay.
   ========================================================================= */

/* Visually-hidden utility for the dialog title + the aria-live status node. */
.hdm-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* The page scroll-lock is a MOBILE-only behavior. On desktop the popover never
   adds hdm-hsearch-open, but belt-and-suspenders: never lock scroll on desktop. */
body.hdm-srv-desktop.hdm-hsearch-open { overflow: auto; }

/* --- in-dropdown context selector (eligible pages only) ---
   The focus dropdown leads with the two-segment scope control on product /
   collection / blog pages. Reuses the shared .hdm-hdr-scope seg markup so the
   module-level setScope handler drives it. */
body.hdm-srv-desktop .hdm-hsearch__ctxsel {
  padding: 10px 6px 4px;
}
body.hdm-srv-desktop .hdm-hsearch__ctxsel-h {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3af;
  padding: 0 8px 7px;
}
body.hdm-srv-desktop .hdm-hsearch__ctxsel .hdm-hdr-scope {
  display: flex;
  gap: 6px;
  padding: 0 6px;
}
body.hdm-srv-desktop .hdm-hsearch__ctxsel .hdm-hdr-scope-seg {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  color: #1A2433;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hdm-srv-desktop .hdm-hsearch__ctxsel .hdm-hdr-scope-seg.is-on {
  border-color: #1E8E33;
  background: #E7F4EA;
  color: #176F28;
}
body.hdm-srv-desktop .hdm-hsearch__ctxsel .hdm-hdr-scope-seg:hover { background: #f3f6fb; }
body.hdm-srv-desktop .hdm-hsearch__ctxsel .hdm-hdr-scope-seg.is-on:hover { background: #DBEEDF; }

/* The dropdown's suggestion rows render as <button> in the desktop modal path
   (they prefill the bar + open the modal instead of navigating). Reset the
   button chrome so they match the <a> variant exactly. (0,2,0) so the theme's
   button resets cannot strip them. */
body.hdm-srv-desktop .hdm-hsearch__panel .hdm-hsearch__try {
  width: calc(100% - 12px);
  box-sizing: border-box;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

/* --- the scrim (dimmed backdrop behind the centered modal) --- */
body.hdm-srv-desktop .hdm-dpop-scrim {
  position: fixed;
  inset: 0;
  z-index: 99998;              /* below the modal, above the page + nav */
  background: rgba(12, 20, 38, 0.55);
}
body.hdm-srv-desktop .hdm-dpop-scrim[hidden] { display: none; }

/* Lock the page scroll behind the centered modal WHILE IT IS OPEN. A desktop-
   only class — NOT the mobile hdm-hsearch-open class — so the mobile path is
   never touched. */
body.hdm-srv-desktop.hdm-dpop-open { overflow: hidden; }

/* --- the centered modal card (mirrors the mobile compose, desktop-sized) --- */
body.hdm-srv-desktop .hdm-hsearch-dpop {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;              /* above the scrim; never tries to out-z the carts panel (100000) */
  width: min(720px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* the answer body scrolls, the sticky head + compose do not */
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(12, 20, 38, 0.34);
  text-align: left;
}
body.hdm-srv-desktop .hdm-hsearch-dpop[hidden] { display: none; }

/* sticky head — scope readout on the left, round close on the right */
body.hdm-srv-desktop .hdm-dpop-head {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #eef1f4;
}
body.hdm-srv-desktop .hdm-dpop-scope {
  font-size: 13px;
  font-weight: 700;
  color: #56627A;
}
body.hdm-srv-desktop .hdm-dpop-close.hdm-dpop-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f3f6fb;
  color: #56627A;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
body.hdm-srv-desktop .hdm-dpop-close.hdm-dpop-close:hover { background: #e6ebf2; color: #1A2433; }
/* Big red close button (mirrors the mobile compose close). Doubled class +
   the modifier keep specificity above the base round style. */
body.hdm-srv-desktop .hdm-dpop-close.hdm-dpop-close--red {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #DC2626;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}
body.hdm-srv-desktop .hdm-dpop-close.hdm-dpop-close--red:hover { background: #B91C1C; color: #fff; }

/* Scope toggle in the modal head (Whole store / this page) — reuses the shared
   .hdm-hdr-scope-seg markup, styled to sit on the left of the sticky head. */
body.hdm-srv-desktop .hdm-dpop-scopetoggle {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
body.hdm-srv-desktop .hdm-dpop-scopetoggle .hdm-hdr-scope-seg {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  color: #1A2433;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.hdm-srv-desktop .hdm-dpop-scopetoggle .hdm-hdr-scope-seg.is-on {
  border-color: #1E8E33;
  background: #E7F4EA;
  color: #176F28;
}
body.hdm-srv-desktop .hdm-dpop-scopetoggle .hdm-hdr-scope-seg:hover { background: #f3f6fb; }
body.hdm-srv-desktop .hdm-dpop-scopetoggle .hdm-hdr-scope-seg.is-on:hover { background: #DBEEDF; }

/* in-modal compose — editable input + a Search button directly below it, so
   the shopper can change the query in place and re-search. Mirrors the mobile
   compose field look. Stays fixed (does not scroll) above the answer body. */
body.hdm-srv-desktop .hdm-dpop-compose {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;     /* input on top, Search button directly below */
  align-items: stretch;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
}
/* (0,2,0) so the theme's input[type="search"] rules can't override it. */
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-input {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  border: 1.5px solid #cfd8e3;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15.5px;
  color: #1A2433;
}
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-input::placeholder { color: #8a93a0; }
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-input:focus {
  outline: 0;
  border-color: #1E8E33;
  box-shadow: 0 0 0 3px rgba(30, 142, 51, 0.15);
}
/* (0,2,0) so the theme's button reset can't strip the green box. Full-width,
   directly below the input — mirrors the mobile compose Ask button. */
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--hdmh-green, #37B44A);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  padding: 0 20px;
  cursor: pointer;
}
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-search:hover { background: #1E8E33; }
body.hdm-srv-desktop .hdm-dpop-compose .hdm-dpop-search svg { flex: 0 0 auto; }

/* the answer body scrolls internally */
body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-hsearch-answer {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 14px 16px 18px;
}
body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-hsearch-answer[hidden] { display: none; }
body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-q { margin-top: 0; }

/* 2-up pick grid once the popover is wide enough; single column when narrow. */
body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-picks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-picks {
    grid-template-columns: 1fr 1fr;
  }
  /* a full-width compact card spans both columns so the row stays tidy */
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-picks .hdm-mini { grid-column: 1 / -1; }
}
@media (hover: hover) {
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-pick,
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-mini {
    transition: transform .12s ease, box-shadow .12s ease;
  }
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-pick:hover,
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(16, 40, 90, .14);
  }
}

/* footer reversal affordance — search the whole store, in place */
body.hdm-srv-desktop .hdm-dpop-storeall {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #fff;
  color: #1A2433;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
body.hdm-srv-desktop .hdm-dpop-storeall:hover { background: #f3f6fb; }

/* skeleton shimmer shells for the staged paint while the answer streams */
body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-skel {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f4 25%, #e2e8f0 37%, #eef1f4 63%);
  background-size: 400% 100%;
  animation: hdm-dpop-shimmer 1.3s ease infinite;
}
@keyframes hdm-dpop-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.hdm-srv-desktop .hdm-hsearch-dpop .hdm-ia-skel { animation: none; }
}
