
.search {
  width: 12.5rem;
  outline: none;

  @media (min-width: 60em) { width: 20rem; }
  @media (max-width: 39.95em) { display: none; }
}

.search__inner {
  display: flex;
  width: 100%;
  max-width: var(--content-width);
  padding: 0;
  margin: 0 auto;
  background: var(--color-bg--main);
  z-index: 2;
  text-align: left;
  position: relative;
  border-radius: 2rem;

  &::after {
    content: '';
    position: absolute;
    top: 50%;
    margin-top: -0.9rem;
    left: 1.2rem;
    width: 1.8rem;
    height: 1.8rem;
    background: url("/assets/icons/search-2ac0e9c1.svg") no-repeat;
  }

  .search--busy & {
    &::after { animation: fade-in-out 1.5s infinite both; }
  }
}

.sheet.sheet--thin {
  --sheet-padding: var(--base-space) 2em 2em;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.search__input {
  position: relative;
  z-index: 0;
  padding-top: 0.4em;
  padding-bottom: 0.4em;
  padding-right: 1em;
  background: var(--color-bg--main);

  &::-webkit-input-placeholder { color: var(--color-ink); opacity: 1; font-weight: 500; }
  &::-moz-placeholder { color: var(--color-ink); opacity: 1; font-weight: 500; }
  &:-ms-input-placeholder { color: var(--color-ink); opacity: 1; font-weight: 500; }
  &::placeholder { color: var(--color-ink); opacity: 1; font-weight: 500; }

  &::-webkit-search-cancel-button {
    [data-color-scheme="dark"] & {
      filter: invert(100%) grayscale(100%); }
  }
}

.search__input:focus,
.search__input:not(:placeholder-shown) {
  @media (min-width: 60em) { width: 26rem; }
  @media (max-width: 39.95em) { width: auto; }
}

.search__results {
  display: none;
  position: fixed !important; /* Important is to override .sheet relative positioning */
  top: 3.5rem;
  left: 1rem;
  right: 1rem;
  width: auto !important;
  padding-top: 1em !important; /* Important is to override .sheet--thin padding */
  margin: 0 auto;

  @media (min-width: 60em) {
    max-height: 85vh;
    max-width: calc(var(--content-width) + 12rem);
    left: 2rem;
    right: 2rem;
  }

  &:has(#recent_searches) .sheet {
    position: absolute !important;
    width: 50rem;
    margin: 0;
  }

  &.search__results--has-banner {
    margin-top: 32px; /* Nudge search results down when trial or reactivation banner present */
  }

  /* Hide unsupported bulk actions */
  .bulk-actions__content {
    [data-bulk-actions-target~='noteButton'] {
      display: none;
    }
  }
}

.search__container {
  @media (min-width: 40em) {
    max-height: 78vh;
    min-height: 60vh;
  }
}

.search__heading {
  margin: 0.5em 0;
}

.search--has-results {
  .search__results { display: block; }
}

/* This blank slate is only displayed for mobile's standalone version of the search page */
.search__blank-slate { margin: 18vh var(--negative-page-padding) 0; }

.search__blank-slate-divider {
  height: 1px;
  background: var(--color-border);
}

.search__blank-slate-divider-label {
  position: relative;
  top: -0.75em;
  padding: 0 1em;
  background: var(--color-bg--main);
}

.search__domain,
.search__contact {
  display: flex;
  align-self: stretch;
}

.search__column {
  display: flex;
  flex-direction: row;
  justify-content: center;
  column-gap: 2rem;
}

.search__column--form {
  flex: 0 0 22rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.search__column--results {
  flex: 1;
  overflow: hidden;
}

.refine_inputs {
  width: 18rem;
  @media (min-width: 60em) { width: 20rem; }

  .input {
    border-color: transparent;
    border-radius: 0.8rem;
    padding: 0.4em;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
}

.refine__input {
  margin-bottom: 0.25em;
  background-repeat: no-repeat;
  background-position: 0 center;
  background-size: 1.25rem;

  &::before {
    opacity: 0.5;
  }
}

label.changed::before,
.refine__input:active::before,
.refine__input:focus-within::before {
  filter: var(--colorize-purple);
  opacity: 1;
}

.refine__input--select:not(.changed) {
  color: var(--color-txt--placeholder);
  background-color: var(--color-bg--sheet);
}

.refine__input--select:focus:not(.changed) {
  color: var(--color-txt--ink);
}

label.changed select,
label.changed input {
  color: var(--color-txt--ink) !important;
}

.refine__input--select:focus {
  background: transparent asset-url("/assets/icons/special-case-colors/select-arrows-gray-c5129f84.svg") right 0.8em center / 0.55em no-repeat;
}

.changed .autocomplete-field__selected-value-text {
  text-overflow: ellipsis;
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
}

@-moz-document url-prefix() {
  .refine__input::before { opacity: 0.3; }
  .refine__input--select { padding-left: 0.4rem; }
  .refine__input--select:not(.changed) { color: rgba(var(--rgb-ink), 0.3); }
}

