.header-search-bar {
  --header-search-bar-slide-anime-duration: 200ms;
  --header-search-drop-gap: 10px;

  position: relative;
  z-index: calc(var(--header-nav-dropdown-menu-z-index) + 1);
  display: none;
  flex-direction: column;
  column-gap: var(--header-column-gap);
  align-items: center;
  justify-content: start;
  order: 30;
  width: 100%;
  height: auto;
  margin-block-start: var(--header-search-drop-gap);
  margin-inline-start: auto;
  pointer-events: none;
  opacity: 0;
}

.header-search-bar.divider::after {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 4;
  height: 1px;
  content: "";
  background-color: rgba(var(--color-entry-line), 1);
}

@media (max-width: 959px) {
  .header-search-bar {
    margin-inline-start: 0;
  }
}

.header-search-bar.open {
  display: flex;
  position: fixed;
  inset-block-start: var(--header-search-fixed-top, 80px);
  inset-inline-start: 0;
  z-index: calc(var(--header-nav-dropdown-menu-z-index) + 20);
  margin-block-start: 0;
  pointer-events: all;
  opacity: 1;
}

.header-search-bar--lockscreen {
  overflow: hidden !important;
}

.header-search-bar__backdrop {
  position: fixed;
  inset-block-start: var(--header-search-fixed-top, 80px);
  inset-inline-start: 0;
  display: block !important;
  width: 100vw;
  height: calc(100vh - var(--header-search-fixed-top, 80px));
  background: rgb(0 0 0 / 40%);
}

.header-search-bar__icon {
  box-sizing: content-box;
  display: inline-flex;
  flex-shrink: 0;
  justify-self: end;
  width: 24px;
  height: 24px;
}

@media (max-width: 959px) {
  .header-search-bar__icon {
    width: 22px;
    height: 22px;
  }
}

.header-search-bar__form {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 18px 40px;
  background-color: rgba(var(--color-background), 1);
  border-block-start: 1px solid rgba(var(--color-entry-line), 1);
}

@media (max-width: 959px) {
  .header-search-bar__form {
    padding: 10px 16px;
  }
}

.header-search-bar__form .button {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
}

@media (min-width: 960px) {
  .header-search-bar__form .button {
    width: 24px;
    height: 24px;
  }
}

.header-search-bar__form .field__input {
  flex: 1;
  width: 100%;
  padding: 0;
}

.header-search-bar__form .field__input::placeholder {
  opacity: 1;
}

[layout$="_wrap_menu"] .header__container-top .header-search-bar {
  order: 10;
  margin-inline-start: 0;
}

.header-search-bar__results {
  position: relative;
  z-index: 1;
  display: none;
  flex-direction: column;
  width: 100%;
  padding: 10px 48px;
  background-color: rgba(var(--color-background), 1);
}

@media (max-width: 959px) {
  .header-search-bar__results {
    padding: 0 20px;
  }
}

.header-search-bar__results.shown {
  display: flex;
}

.header-search-bar__results-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.header-search-bar__results-spinner {
  width: 20px;
  height: 20px;
  color: rgba(var(--color-text), 1);
  animation: animation-circling linear 1.5s infinite;
}

.header-search-bar__results-list {
  display: block;
}

.header-search-bar__results.loading {
  align-items: center;
  justify-content: center;
}

.header-search-bar__results.loading .header-search-bar__results-loading {
  display: flex;
}

.header-search-bar__results.loading .header-search-bar__results-list {
  display: none;
}

/* Disable third-party product-search header UI to avoid conflict with theme search bar. */
#plugin-product-search,
.plugin-product-search-searchIconMask,
.plugin-product-search-SearchBar,
.plugin-product-search-searchInputWrap,
.plugin-product-search-searchInputWarp {
  display: none !important;
  pointer-events: none !important;
}
