/* ===========================================
   SEARCH SCOPE — IKB / External / Both
   Agent-only control rendered by search-scope.js
   =========================================== */

.search-scope {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  background: #f4f5f8;
  border: 1px solid rgba(34, 46, 58, 0.1);
  border-radius: 999px;
}

.search-scope__option {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: rgba(34, 46, 58, 0.65);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.search-scope__option:hover {
  color: #222e3a;
}

.search-scope__option.is-selected {
  background: #178a9e;
  color: #ffffff;
}

.search-scope__option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 138, 158, 0.4);
}

/* --- placement ---------------------------------------------------------- */

#search .search-scope,
#search-mobile .search-scope {
  align-self: center;
  margin: 0 8px;
}

#home-hero .search-scope {
  display: flex;
  width: -moz-fit-content;
  width: fit-content;
  margin: 16px auto 0;
}

.section-search-results .search-scope {
  margin-bottom: 24px;
}

@media (max-width: 767px) {
  .search-scope__option {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* --- scoped suggestions dropdown ---------------------------------------- */

/* While a scope is active the native dropdown is replaced by our own. */
body.search-scope-filtered zd-autocomplete {
  display: none !important;
}

.search-scope-suggestions {
  position: fixed;
  z-index: 10001;
  max-height: 60vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(34, 46, 58, 0.12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(34, 46, 58, 0.16);
}

.search-scope-suggestions[hidden] {
  display: none;
}

.search-scope-suggestions__status {
  margin: 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(34, 46, 58, 0.65);
}

.search-scope-suggestions__status[hidden] {
  display: none;
}

.search-scope-suggestions__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.search-scope-suggestions__item {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.search-scope-suggestions__item a {
  display: block;
  padding: 10px 16px;
  color: #222e3a;
  text-decoration: none;
}

.search-scope-suggestions__item.is-active,
.search-scope-suggestions__item:hover {
  background: #f4f5f8;
}

.search-scope-suggestions__item--all {
  margin-top: 4px;
  padding: 12px 16px;
  border-top: 1px solid rgba(34, 46, 58, 0.1);
  color: #178a9e;
  font-weight: 600;
}

/* --- results page ------------------------------------------------------- */

.search-scope-empty a {
  color: #178a9e;
}
