/**
 * Public operator type-ahead: catalogue browse search bar + dropdown + rows.
 * Shared by templates/catalog/browse.html and templates/home.html (cascade step 1)
 * for input and suggest row typography. Operator map uses its own search styling.
 *
 * Input uses var(--font-content) so it stays the body/content scale even when a
 * parent applies header font (e.g. .sub-header * in main.css).
 */

/* ─── Search bar (browse layout; home/map may use only the input class) ─── */
.catalog-search-bar {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  position: relative;
}

/* Browse: input + dropdown share a column so type-ahead does not cover the Search button. */
.catalog-search-bar__field-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.catalog-search-bar__field-wrap .catalog-search-bar__input {
  width: 100%;
  flex: 0 0 auto;
}

.catalog-search-bar__input {
  flex: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-content);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  color: #334155;
  background: #fff;
}

.catalog-search-bar__input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-color: #2563eb;
}

.catalog-search-bar__input::placeholder {
  color: #94a3b8;
}

/* Match site primary actions (e.g. home "Learn More", login submit): Front UI / auth submit tokens */
.catalog-search-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hcs-icon-text-gap);
  min-height: var(--hcs-btn-height-md);
  padding: var(--hcs-btn-pad-y) var(--hcs-btn-pad-x);
  font-family: var(--font-content);
  line-height: 1;
  border: 1px solid var(--auth-color-submit-bg, var(--hcs-accent));
  border-radius: 8px;
  background: var(--auth-color-submit-bg, var(--hcs-accent));
  color: var(--auth-color-submit-text, var(--hcs-on-accent));
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

.catalog-search-bar__btn:hover {
  opacity: 0.85;
}

.catalog-search-bar__btn svg {
  display: block;
  width: var(--hcs-control-icon-size);
  height: var(--hcs-control-icon-size);
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.catalog-search-results-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 8px 8px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.catalog-search-results-dropdown.is-open {
  display: block;
}

.catalog-search-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-bottom: 1px solid #f1f5f9;
}

.catalog-search-item:last-child {
  border-bottom: none;
}

.catalog-search-item:hover {
  background: #f8fafc;
}

.catalog-search-item-name {
  color: #0f172a;
  font-weight: 500;
  font-family: var(--font-content);
}

.catalog-search-item-hint {
  color: #94a3b8;
  font-family: var(--font-content);
}
