.ads-livesearch {
  --ads-ls-input-bg: #fff;
  --ads-ls-input-text: #333;
  --ads-ls-button-bg: #00ff79;
  --ads-ls-button-hover: #00d968;
  --ads-ls-button-icon: #000000;
  --ads-ls-panel-bg: #fff;
  --ads-ls-title: #333;
  --ads-ls-meta: #6b7280;
  --ads-ls-price: #00528b;
  --ads-ls-accent: #2fb5d2;
  position: relative;
  width: 100%;
  max-width: 100%;
  z-index: 10050;
  color: var(--ads-ls-title);
  font-family: inherit;
  padding: 4px 0;
}

.ads-livesearch *,
.ads-livesearch *::before,
.ads-livesearch *::after {
  box-sizing: border-box;
}

.ads-livesearch__form {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  margin: 0;
}

.ads-livesearch__input {
  width: 100%;
  height: 42px !important;
  min-width: 0;
  margin: 0;
  padding: 0 92px 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  background: var(--ads-ls-input-bg);
  color: var(--ads-ls-input-text);
  box-shadow: none;
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}

.ads-livesearch__input::-webkit-search-cancel-button {
  display: none;
}

.ads-livesearch__input::placeholder {
  color: var(--ads-ls-input-text);
  opacity: 0.58;
}

.ads-livesearch__input:focus {
  border-color: var(--ads-ls-accent);
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(47, 181, 210, 0.22);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ads-ls-accent) 25%, transparent);
}

.ads-livesearch__clear,
.ads-livesearch__submit {
  position: absolute;
  top: 0;
  height: 42px !important;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

.ads-livesearch__clear {
  right: 46px;
  width: 40px;
  padding: 0;
  background: transparent;
  color: var(--ads-ls-meta);
  font-size: 25px;
  line-height: 1;
}

.ads-livesearch__clear:hover,
.ads-livesearch__clear:focus {
  color: var(--ads-ls-title);
  outline: 0;
}

.ads-livesearch__submit {
  right: 0;
  display: grid;
  place-items: center;
  width: 46px;
  padding: 0;
  border-radius: 0 4px 4px 0;
  background: var(--ads-ls-button-bg);
  color: var(--ads-ls-button-icon);
  transition: background-color 160ms ease;
}

.ads-livesearch__submit:hover,
.ads-livesearch__submit:focus {
  background: var(--ads-ls-button-hover);
  outline: 0;
}

.ads-livesearch__submit svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.ads-livesearch__spinner {
  display: none;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(0, 82, 139, 0.3);
  border-top-color: var(--ads-ls-button-icon);
  border-radius: 50%;
  animation: ads-ls-spin 700ms linear infinite;
}

.ads-livesearch--loading .ads-livesearch__submit svg {
  display: none;
}

.ads-livesearch--loading .ads-livesearch__spinner {
  display: block;
}

.ads-livesearch__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 280px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: var(--ads-ls-panel-bg);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  z-index: 10060;
}

.ads-livesearch__panel[hidden],
.ads-livesearch__clear[hidden] {
  display: none !important;
}

.ads-livesearch__list {
  max-height: 520px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ads-livesearch__result {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
  background: var(--ads-ls-panel-bg);
  color: var(--ads-ls-title);
  text-decoration: none !important;
  cursor: pointer;
}

.ads-livesearch__result--no-image {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ads-livesearch__result:hover,
.ads-livesearch__result:focus,
.ads-livesearch__result.is-active {
  background: #f5f7fa;
  background: color-mix(in srgb, var(--ads-ls-accent) 9%, var(--ads-ls-panel-bg));
  color: var(--ads-ls-title);
  outline: 0;
}

.ads-livesearch__image {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: #f3f4f6;
  object-fit: contain;
}

.ads-livesearch__image--empty::before {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  margin: 17px auto;
  border: 2px solid #cbd5e1;
  border-radius: 3px;
}

.ads-livesearch__content {
  min-width: 0;
}

.ads-livesearch__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ads-ls-title);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.32;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ads-livesearch__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 5px;
  color: var(--ads-ls-meta);
  font-size: 11.5px;
  line-height: 1.25;
}

.ads-livesearch__meta > span:not(:last-child)::after {
  content: '·';
  margin-left: 10px;
  color: var(--ads-ls-meta);
}

.ads-livesearch__stock {
  flex-basis: 100%;
  font-weight: 600;
}

.ads-livesearch__stock::after {
  display: none;
}

.ads-livesearch__stock--available {
  color: #08783f;
}

.ads-livesearch__stock--backorder {
  color: #8a5700;
}

.ads-livesearch__stock--unavailable {
  color: #b42318;
}

.ads-livesearch__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 70px;
}

.ads-livesearch__price {
  color: var(--ads-ls-price);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.ads-livesearch__regular-price {
  color: var(--ads-ls-meta);
  font-size: 11px;
  line-height: 1;
  text-decoration: line-through;
  white-space: nowrap;
}

.ads-livesearch__discount {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 2px;
  background: var(--ads-ls-button-bg);
  color: #00385f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
}

.ads-livesearch__all {
  display: block;
  padding: 12px 16px;
  background: var(--ads-ls-button-bg);
  color: var(--ads-ls-button-icon) !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none !important;
}

.ads-livesearch__all:hover,
.ads-livesearch__all:focus {
  background: var(--ads-ls-button-hover);
  color: var(--ads-ls-button-icon) !important;
  outline: 0;
}

.ads-livesearch__empty {
  padding: 18px 16px;
  color: var(--ads-ls-meta);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

.ads-livesearch__sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes ads-ls-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
  .ads-livesearch__form,
  .ads-livesearch__input,
  .ads-livesearch__clear,
  .ads-livesearch__submit {
    height: 42px !important;
  }

  .ads-livesearch__form {
    min-height: 42px;
  }

  .ads-livesearch__input {
    padding-left: 12px;
    font-size: 16px;
  }

  .ads-livesearch__panel {
    top: calc(100% + 4px);
    min-width: 0;
  }

  .ads-livesearch__list {
    max-height: calc(100vh - 150px);
  }

  .ads-livesearch__result {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 56px;
    padding: 4px 8px;
  }

  .ads-livesearch__result--no-image {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ads-livesearch__image {
    width: 44px;
    height: 44px;
  }

  .ads-livesearch__image--empty::before {
    width: 18px;
    height: 18px;
    margin: 13px auto;
  }

  .ads-livesearch__prices {
    grid-column: auto;
    min-width: 62px;
  }

  .ads-livesearch__price {
    font-size: 12.5px;
  }

  .ads-livesearch__name {
    font-size: 13px;
    line-height: 1.25;
  }

  .ads-livesearch__meta {
    margin-top: 3px;
    font-size: 10.5px;
  }

  .ads-livesearch__regular-price {
    font-size: 10px;
  }

  .ads-livesearch__discount {
    padding: 1px 4px;
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .ads-livesearch__meta {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ads-livesearch__submit {
    transition: none;
  }
}
