/* LABRepCo: LIVE-style ElasticPress Autosuggest dropdown. */
.header-widget .widget_search,
.header-widget .search-form {
  position: relative;
  overflow: visible;
}

.header-widget .widget_search {
  z-index: 1000;
}

.ep-autosuggest-container .ep-autosuggest {
  top: calc(100% + 2px);
  left: 0;
  z-index: 9999;
  max-height: min(70vh, 650px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-shadow: 0 7px 8px rgba(0, 0, 0, 0.1);
  text-align: left;
}

/* LIVE's dropdown is wider than the header search field. */
.header-widget .ep-autosuggest-container .ep-autosuggest {
  width: 440px;
  max-width: calc(100vw - 32px);
}

.ep-autosuggest-container .ep-autosuggest > ul {
  padding: 0;
}

.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion {
  margin: 0;
  padding: 0;
  font-family: inherit;
  background: #fff;
}

.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion > a.autosuggest-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  box-sizing: border-box;
  color: #252525;
  text-decoration: none;
}

.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion > a.autosuggest-link:hover,
.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion > a.autosuggest-link:focus,
.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion.selected > a.autosuggest-link,
.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion > a.autosuggest-link.selected {
  background: #fafafa;
  color: #252525;
  text-decoration: none;
}

.lrc-ep-suggestion__image {
  display: flex;
  flex: 0 0 78px;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
}

.lrc-ep-suggestion__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lrc-ep-suggestion__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding-top: 1px;
}

.lrc-ep-suggestion__title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: #242424;
  overflow-wrap: anywhere;
}

.lrc-ep-suggestion__sku {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: #777;
}

@media (max-width: 768px) {
  .header-widget .ep-autosuggest-container .ep-autosuggest {
    width: 100%;
    max-width: 100%;
    max-height: 55vh;
  }

  .ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion > a.autosuggest-link {
    gap: 8px;
    padding: 10px 8px;
  }

  .lrc-ep-suggestion__image {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
  }
}

/* Searched words in product titles, highlighted like LIVE. */
.lrc-ep-suggestion__title mark {
  padding: 0 3px;
  border-radius: 2px;
  background: #fff59d;
  color: inherit;
  font-weight: 600;
}

/* Category suggestions (shown first): title only, vertically centered. */
.ep-autosuggest-container .ep-autosuggest > ul > li.lrc-ep-suggestion--category > a.autosuggest-link {
  align-items: center;
}
