/**
 * Site-wide search results page.
 * Tokens taken from the Figma frame 全局搜索结果页 (9991:8610).
 */
.gsearch {
  --gs-primary: #eb0000;
  --gs-dark: #04043f;
  --gs-link: #00549f;
  --gs-text: #333;
  --gs-muted: #a6a6a6;
  --gs-border: #e2e0e8;
  --gs-surface: #f5f5f7;
  --gs-news: #00549f;
  --gs-suppliers: #92400e;
  --gs-pages: #0f6e56;
  font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--gs-text);
}

.gsearch__viewport {
  max-width: 1110px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Search band ------------------------------------------------------------ */
.gsearch__band {
  background: var(--gs-dark);
  padding: 24px 0;
}

.gsearch__form {
  display: flex;
  gap: 12px;
}

.gsearch__input-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 4px;
  height: 52px;
  padding: 0 44px 0 44px;
}

.gsearch__input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--gs-dark);
  border-radius: 50%;
}

.gsearch__input-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -3px;
  width: 8px;
  height: 2px;
  background: var(--gs-dark);
  transform: rotate(45deg);
}

.gsearch__input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  font-size: 16px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.gsearch__input::-webkit-search-cancel-button { display: none; }

.gsearch__clear {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border: 0;
  background: url("../../../../themes/custom/mess/images/x-close.svg") center / 24px no-repeat;
  cursor: pointer;
  padding: 0;
}

.gsearch__submit {
  min-width: 80px;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--gs-primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
/* The theme appends an icon-font arrow to every button; it renders as a stray ".". */
.gsearch button::after {
  content: none;
  margin-left: 0;
}

/* Tab bar ---------------------------------------------------------------- */
.gsearch__tabs {
  border-bottom: 1px solid var(--gs-border);
  background: #fff;
}

.gsearch__tabs-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gsearch__tablist {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}

.gsearch__tab a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  height: 48px;
  padding: 0 20px;
  border-bottom: 3px solid transparent;
  color: var(--gs-muted);
  font-size: 14px;
  line-height: 22px;
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .gsearch__tab a {
   font-size: 12px;
  }
}

.gsearch__tab.is-active a {
  color: var(--gs-primary);
  font-weight: 700;
  border-bottom-color: var(--gs-primary);
}

.gsearch__badge {
  min-width: 24px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--gs-surface);
  color: var(--gs-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.gsearch__tab.is-active .gsearch__badge {
  background: var(--gs-primary);
  color: #fff;
}

.gsearch__count {
  color: var(--gs-muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
}

/* Results ---------------------------------------------------------------- */
.gsearch__results { padding: 32px 16px 48px; }

.gsearch__empty {
  padding: 48px 0;
  color: var(--gs-muted);
}

.gsearch__group { margin-bottom: 24px; }

.gsearch__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gs-border);
}

.gsearch__group--news .gsearch__group-head { border-bottom-color: var(--gs-news); }
.gsearch__group--suppliers .gsearch__group-head { border-bottom-color: var(--gs-suppliers); }
.gsearch__group--pages .gsearch__group-head { border-bottom-color: var(--gs-pages); }

.gsearch__group-title {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
}

.gsearch__group-title span { font-weight: 600; }

.gsearch__group--news .gsearch__group-title,
.gsearch__group--news .gsearch__group-title span,
.gsearch__group--news .gsearch__more { color: var(--gs-news); }
.gsearch__group--suppliers .gsearch__group-title,
.gsearch__group--suppliers .gsearch__group-title span,
.gsearch__group--suppliers .gsearch__more { color: var(--gs-suppliers); }
.gsearch__group--pages .gsearch__group-title,
.gsearch__group--pages .gsearch__group-title span,
.gsearch__group--pages .gsearch__more { color: var(--gs-pages); }

.gsearch__more {
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  text-decoration: none;
}

.gsearch__more:hover { text-decoration: underline; }

/* News cards */
.gsearch__rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.gsearch-news {
  display: flex;
  border: 1px solid var(--gs-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--gs-surface);
  transition: box-shadow .2s ease;
  padding: 0;
}

.gsearch-news:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }

.gsearch-news__media {
  flex: 0 0 180px;
  width: 180px;
  height: 160px;
  min-width: 0;
  overflow: hidden;
  display: block;
}

.gsearch-news__media img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

/* ponytail: the design always ships a thumbnail; drop the frame when there is none. */
.gsearch-news__media--empty { display: none; }

.gsearch-news__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.gsearch-news__date {
  color: var(--gs-muted);
  font-size: 12px;
  line-height: 18px;
}

.gsearch-news__title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.gsearch-news__title a {
  color: var(--gs-link);
  text-decoration: none;
}

.gsearch-news:hover .gsearch-news__title a { text-decoration: underline; }

.gsearch-news__summary {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--gs-text);
}

/* Supplier cards */
.gsearch__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 16px;
}

.gsearch-supplier {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--gs-border);
  border-radius: 6px;
  background: #fff;
  transition: box-shadow .2s ease;
}

.gsearch-supplier:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }

.gsearch-supplier__head {
  display: flex;
  align-items: center;
  gap: 24px;
}

.gsearch-supplier__logo {
  flex: 0 0 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gs-surface);
  border-radius: 4px;
  overflow: hidden;
}

.gsearch-supplier__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.gsearch-supplier__name {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 26px;
  font-weight: 700;
}

.gsearch-supplier__name a {
  color: var(--gs-dark);
  text-decoration: none;
}

.gsearch-supplier__region {
  color: var(--gs-link);
  font-size: 14px;
  line-height: 22px;
}

.gsearch-supplier__desc {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gsearch-supplier.is-expanded .gsearch-supplier__desc {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.gsearch-supplier__toggle {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gs-text);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.gsearch-supplier__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gsearch-supplier__tags li {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e6f1fb;
  color: #0c447c;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

/* Matches .supplier-tag--china on the advanced search cards. Scoped to the
   list so it outweighs the `.gsearch-supplier__tags li` base rule above. */
.gsearch-supplier__tags li.gsearch-supplier__tag--china {
  background: #f5f5f7;
  color: #27500a;
}

.gsearch-supplier__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.gsearch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 32px;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.gsearch-btn--ghost { min-width: 120px; }

.gsearch-btn--solid {
  background: var(--gs-dark);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  font-weight: 500;
}

.gsearch-btn--ghost {
  border: 1px solid var(--gs-dark);
  color: var(--gs-dark);
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

/* Other pages */
.gsearch__pages {
  margin: 0;
  padding: 16px 0 0;
  list-style: none;
}

.gsearch-page {
  padding: 16px 0;
  border-bottom: 1px solid var(--gs-border);
}

.gsearch-page__title {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 26px;
  font-weight: 700;
}

.gsearch-page__title a {
  color: var(--gs-dark);
  text-decoration: none;
}

.gsearch-page__summary {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  color: var(--gs-text);
}

@media (max-width: 767px) {
  .gsearch-page__summary {
    font-size: 14px;
    line-height: 22px;
  }
}
.gsearch mark {
  background: #fef3c7;
  color: inherit;
}

/* Pager — matches the sector landing search page (.sector-search) */
.gsearch .pager__items.pager__items {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

.gsearch .pager__items .pager__item { display: block; }

.gsearch .pager__items .pager__item a,
.gsearch .pager__items .pager__item--previous.is-disabled span[aria-disabled] {
  box-sizing: border-box;
  display: block;
  width: auto;
  height: auto;
  min-width: 40px;
  padding: 12px 16px;
  border: none;
  box-shadow: inset 0 0 0 2px var(--gs-dark);
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  line-height: 18px;
  color: var(--gs-dark);
  text-decoration: none;
  background: #fff;
  opacity: 1;
}

.gsearch .pager__items .pager__item a[rel="prev"],
.gsearch .pager__items .pager__item a[rel="next"] {
  width: auto;
}

.gsearch .pager__items .pager__item.is-active a {
  background: var(--gs-link);
  box-shadow: none;
  color: #fff;
}

.gsearch .pager__items .pager__item--previous.is-disabled span[aria-disabled] {
  box-shadow: inset 0 0 0 2px var(--gs-border);
  color: var(--gs-muted);
  cursor: not-allowed;
}

/* Mobile ----------------------------------------------------------------- */
@media (max-width: 767px) {
  .gsearch__tabs-inner { align-items: flex-start; }
  .gsearch__tablist { width: 100%; gap: 0; }
  .gsearch__tab { flex: 1 0 0; min-width: 0; }
  .gsearch__tab a {
    min-width: 0;
    height: 44px;
    padding: 0 4px;
    font-size: 12px;
    border-bottom-width: 2px;
  }
  .gsearch__badge { border-radius: 8px; }
  /* Full-bleed grey result-count band under the tabs (Figma 9991:8717). */
  .gsearch__count {
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 8px 16px;
    background: var(--gs-surface);
  }
  .gsearch-news__summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .gsearch__cards { grid-template-columns: minmax(0, 1fr); }
  .gsearch-supplier__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gsearch-btn { padding: 0 8px; }
  .gsearch-btn--ghost { min-width: 0; }
  .gsearch-news { flex-direction: column; }
  .gsearch-news__media {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .gsearch-news__media img { height: 100%; }
  .gsearch-news__body { padding: 16px; }
  .gsearch-news__summary { font-size: 12px; line-height: 18px; }

  /* Pager: page numbers and ellipses collapse to just prev/next. */
  .gsearch .pager__items .pager__item:not(.pager__item--previous):not(.pager__item--next) {
    display: none;
  }
  .gsearch .pager__items .pager__item--previous,
  .gsearch .pager__items .pager__item--next {
    flex: 1 0 0;
  }
  .gsearch .pager__items .pager__item--previous a,
  .gsearch .pager__items .pager__item--previous span[aria-disabled],
  .gsearch .pager__items .pager__item--next a {
    width: 100%;
  }
}
