/* Component - Predictive Search
=================================== */
.predictive-search {
  display: none;
  position: absolute;
  width: 100%;
  top: calc(100% - 0.1rem);
  inset-inline-start: 0;
  z-index: 3;
  border-bottom-right-radius: var(--border-radius-base);
  border-bottom-left-radius: var(--border-radius-base);
  box-shadow: inset 0 0 0 1px var(--color-border);
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
}

.template-search-search-bar predictive-search [type="search"] {
  display: flex;
  height: 44px;
}

.template-search-search-bar predictive-search [type="submit"] {
  border-radius: var(--border-radius-base);
  padding-left: 3.5rem;
  padding-right: 3.5rem;
}

.header-search-global .predictive-search {
  position: relative;
  width: 100%;
  top: auto;
  inset-inline-start: auto;
  box-shadow: none;
  margin-top: 1px;
  margin-bottom: -1.5rem;
  border-radius: 0;
}

.predictive-search-results-list > [class^="spinner"] {
  position: absolute;
  top: 1.5rem;
  inset-inline-end: 1.5rem;
}

.predictive-search-results-list-empty > [class^="spinner"] {
  display: none;
}

predictive-search:not([loading]) .predictive-search-results-list > [class^="spinner"],
predictive-search:not([loading]) .predictive-search-loading-state {
  display: none;
}

predictive-search[loading] .predictive-search-loading-state {
  display: flex;
  justify-content: center;
  padding: 1rem;
}

predictive-search[loading]
  .predictive-search-results-list-empty
  + #predictive-search-option-search-keywords {
  display: none;
}

predictive-search[loading] .predictive-search,
predictive-search[open] .predictive-search {
  display: block;
}

predictive-search[open] {
  z-index: 100;
  position: relative;
}

.predictive-search-results-group {
  min-width: 1px;
}

.predictive-search-results-group-section-desktop {
  display: none;
}

.header-search-global .predictive-search-results-group-wrapper {
  margin-left: -1.5rem;
  margin-right: -1.5rem;
}

.header-search-global .predictive-search-results-list {
  margin-top: 1rem;
}

@media (min-width: 990px) {
  .predictive-search-results-group-wrapper-two-column {
    display: flex;
    grid-gap: var(--grid-desktop-horizontal-spacing) / 2;
  }

  .predictive-search-results-group-wrapper-two-column .predictive-search-results-group:first-child {
    width: 36%;
    flex: none;
  }

  .predictive-search-results-group-wrapper-two-column
    .predictive-search-list-item-product
    .predictive-search-item-link {
    padding-inline-start: 0;
  }

  .predictive-search-results-group-section-desktop {
    display: block;
  }

  .predictive-search-results-group-section-mobile {
    display: none;
  }
}

.predictive-search-heading {
  display: flex;
  align-items: center;
  padding: 1.5rem 0 0.5rem;
  margin: 0 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  font-size: calc(var(--font-heading-scale) * 1.5rem);
}

.predictive-search-heading-products {
  margin-bottom: 0;
}

.predictive-search-heading [class^="spinner"] {
  margin: 0 0.2rem 0 auto;
}

.predictive-search-results-item-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.predictive-search-list-item {
  margin: 0;
  padding: 0;
  display: block;
}

.predictive-search-list-item-query .predictive-search-item-heading span {
  font-weight: bolder;
}

.predictive-search-list-item .price-regular .price-item-regular,
.predictive-search-list-item .price-item-sale {
  font-size: calc(var(--font-body-scale) * 1.3rem);
  margin-top: 1rem;
}

.predictive-search-list-item .price-sale span {
  display: inline-block;
}

.predictive-search-list-item .unit-price {
  font-size: calc(var(--font-body-scale) * 1.2rem);
}

.predictive-search-list-item:hover,
.predictive-search-list-item[aria-selected="true"] {
  background: rgb(var(--color-foreground), 0.05);
}

.predictive-search-item-link {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 1.5rem;
  color: rgb(var(--color-foreground));
}

.predictive-search-list-item-product .predictive-search-item-link {
  border-bottom: 0.1rem dashed var(--color-border);
  margin: 0 1.5rem;
  padding: 1.5rem 1.5rem 1.5rem 0;
}

@media (min-width: 990px) {
  .predictive-search-list-item-product .predictive-search-item-link {
    padding-inline-start: 0.75rem;
  }
}

.predictive-search-list-item-product .predictive-search-item-link:last-child {
  border-bottom: 0;
}

.predictive-search-item-image-wrap {
  box-shadow: inset 0 0 0 1px var(--color-border);
  background-color: rgb(var(--color-background));
  border-radius: var(--border-radius-base);
  position: relative;
  width: 64px;
  padding: 0.5rem;
  flex: none;
  margin-inline-end: 1.25rem;
}

.predictive-search-item-image-wrap:empty {
  opacity: 0;
  visibility: hidden;
}

.predictive-search-item-image {
  object-fit: contain;
}

.predictive-search-item-content {
  flex: auto;
  min-width: 1px;

  .price-requires-login-message {
    font-size: calc(var(--font-body-scale) * 1.2rem);
    margin-top: 0.5rem;
  }
}

.predictive-search-item-heading {
  font-size: calc(var(--font-heading-scale) * 1.3rem);
  font-weight: 400;
  color: rgb(var(--color-foreground-alt));
  margin: 0;
}

.predictive-search-item-vendor {
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-size: calc(var(--font-body-scale) * 1.1rem);
}

.predictive-search-list-item-term {
  text-align: end;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}

.predictive-search-results-list-empty + .predictive-search-list-item-term {
  border: 0;
  margin-top: 0;
}

.predictive-search-item-term {
  border: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  padding: 1.5rem 1.5rem;
  align-items: center;
  text-align: end;
  justify-content: flex-end;
  text-decoration: none;
  background-color: transparent;
  font-size: calc(var(--font-body-scale) * 1.3rem);
  line-height: calc(1 + 0.2 / var(--font-body-scale));
  word-break: break-word;
  text-transform: none;
}

.predictive-search-item-term[aria-selected="true"],
.predictive-search-item-term:hover {
  background: rgb(var(--color-foreground), 0.05);
}

.predictive-search-item-term .angle {
  margin-inline-start: 0.5rem;
}
