/*
 * Header search AJAX results — hand-written (NOT generated by build-theme.js).
 * Loaded after site.css. Styles the results dropdown that site.js appends inside
 * .search_bar .content, and expands the collapsed search bar to reveal it.
 */

/* Let the collapsible bar grow while results are shown (base rule caps it at 12rem). */
header.search_open .search_bar.search_has_results {
  max-height: 70vh;
}

.search_bar .search_results {
  padding-bottom: 2rem;
}

.search_bar .search_results ul {
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid rgba(13, 27, 55, 0.08);
  border-radius: 1.2rem;
  background-color: #fff;
}

.search_bar .search_results li + li {
  border-top: 1px solid rgba(13, 27, 55, 0.06);
}

.search_bar .search_results a {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.8rem;
  transition: background-color 0.2s;
}

.search_bar .search_results a:hover {
  background-color: #fff6ec;
}

.search_bar .search_results .sr_type {
  flex: none;
  padding: 0.3rem 1rem;
  border-radius: 10rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  background-color: #fff1e2;
}

.search_bar .search_results .sr_title {
  overflow: hidden;
  font-size: 1.5rem;
  color: var(--title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search_bar .search_empty {
  padding: 1.6rem 1.8rem;
  border: 1px solid rgba(13, 27, 55, 0.08);
  border-radius: 1.2rem;
  font-size: 1.5rem;
  color: var(--text);
  background-color: #fff;
}

.search_bar .search_results_foot {
  padding-top: 1rem;
  text-align: center;
}

.search_bar .search_results_foot a {
  display: inline-flex;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
}

.search_bar .search_results_foot a:hover {
  text-decoration: underline;
}

/* 手机端保留原站点页头，让搜索输入框可收缩，按钮不被挤出。 */
@media (max-width: 768px) {
  #brx-header .search_form input[type="search"] {
    min-width: 0;
    width: 0;
  }
  #brx-header .search_form button {
    flex-shrink: 0;
  }
}

/* 320–480px 窄屏控制 logo、按钮及间距的总宽度，保留询价入口。 */
@media (max-width: 480px) {
  #brx-header .content > .flex {
    gap: 8px;
  }
  #brx-header .logo img {
    width: clamp(96px, 28vw, 120px);
  }
  #brx-header .btns {
    flex-shrink: 0;
    gap: 16px;
  }
  #brx-header .btns .btn {
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .search_bar .search_results a {
    padding: 10px 14px;
    gap: 10px;
  }
  .search_bar .search_results .sr_type {
    font-size: 11px;
  }
  .search_bar .search_results .sr_title,
  .search_bar .search_empty {
    font-size: 14px;
  }
  .search_bar .search_results_foot a {
    font-size: 13px;
  }
}
