/* Live product search in the header search modal (lib/live-search.php) */

.va-live-search {
  position: relative;
}

.va-live-search-field {
  position: relative;
}

.va-live-search-input {
  width: 100%;
  padding: .5rem 2.25rem .5rem .75rem;
  border: 1px solid #ced4da;
  border-radius: .25rem;
  font-size: 1rem;
}

.va-live-search-input:focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.va-live-search-input::-webkit-search-cancel-button {
  display: none;
}

.va-live-search-clear {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  border: 0;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
}

.va-live-search.is-loading .va-live-search-input {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .06), transparent) 0 0 / 200% 100%;
  animation: va-live-search-loading 1s linear infinite;
}

@keyframes va-live-search-loading {
  to { background-position: -200% 0; }
}

.va-live-search-status {
  margin: .5rem 0 0;
  font-size: .875rem;
  color: #6c757d;
}

.va-live-search-status:empty {
  display: none;
}

.va-live-search-results {
  list-style: none;
  margin: .5rem 0 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.va-live-search-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border-bottom: 1px solid #eee;
  color: inherit;
  text-decoration: none;
}

.va-live-search-item:hover,
.va-live-search-item:focus {
  background: #f8f9fa;
  text-decoration: none;
}

.va-live-search-item img {
  flex: 0 0 60px;
  object-fit: cover;
}

.va-live-search-title {
  flex: 1 1 auto;
}

.va-live-search-price {
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
}
