/* Toykar search bar + instant results */

#header .header-top .search-widget.tk-search,
#header .header-top .search-widget {
  width: 460px;
}

.search-widget.tk-search {
  position: relative;
}

.search-widget.tk-search form {
  position: relative;
  margin: 0;
  overflow: visible;
}

#header .header-top {
  position: relative;
  z-index: 30;
}

.search-widget.tk-search input[type="text"],
.search-widget.tk-search input[type="search"],
.header-top .search-widget.tk-search form input[type="text"],
.header-top .search-widget.tk-search form input[type="search"] {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 84px 0 16px;
  border: 1px solid #d9dee3;
  border-radius: 22px;
  background: #f4f6f8;
  color: #051829;
  font-size: 14px;
  line-height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.search-widget.tk-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-widget.tk-search input[type="text"]:focus,
.search-widget.tk-search input[type="search"]:focus,
.header-top .search-widget.tk-search form input[type="text"]:focus,
.header-top .search-widget.tk-search form input[type="search"]:focus {
  outline: none;
  background: #fff;
  border-color: #227ed1;
  box-shadow: 0 0 0 3px rgba(34, 126, 209, 0.15);
}

.search-widget.tk-search form button[type="submit"],
.search-widget.tk-search .tk-search__submit {
  position: absolute;
  right: 4px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #051829;
  color: #fff;
  padding: 0;
  z-index: 2;
}

.search-widget.tk-search form button[type="submit"] .search,
.search-widget.tk-search form button[type="submit"] span {
  color: #fff;
}

.search-widget.tk-search form button[type="submit"] .hidden-xl-down {
  display: none !important;
}

.search-widget.tk-search form button[type="submit"]:hover,
.search-widget.tk-search form input:focus + .tk-search__clear + button[type="submit"],
.search-widget.tk-search.is-searching form button[type="submit"] {
  background: #227ed1;
}

.search-widget.tk-search .tk-search__clear {
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #667787;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  z-index: 2;
  cursor: pointer;
}

.search-widget.tk-search .tk-search__clear:hover {
  color: #051829;
}

.search-widget.tk-search.is-searching form button[type="submit"] .search {
  animation: tk-search-spin 0.8s linear infinite;
}

@keyframes tk-search-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tk-search__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  max-height: min(70vh, 520px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e6eaee;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(5, 24, 41, 0.16);
}

.tk-search__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #051829;
  text-decoration: none;
  border-bottom: 1px solid #f0f3f6;
}

.tk-search__item:hover,
.tk-search__item.is-active {
  background: #f4f8fc;
  color: #051829;
}

.tk-search__item.is-exact {
  background: #eef6ff;
}

.tk-search__thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tk-search__thumb img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tk-search__ph {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9dee3;
}

.tk-search__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.tk-search__name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}

.tk-search__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: #667787;
}

.tk-search__sku {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  color: #051829;
}

.tk-search__right {
  flex: 0 0 auto;
  text-align: right;
}

.tk-search__price {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #051829;
}

.tk-search__stock {
  display: inline-block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tk-search__stock.is-in {
  color: #1b7f3a;
}

.tk-search__stock.is-out {
  color: #b42318;
}

.tk-search__all,
.tk-search__empty {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  color: #227ed1;
  text-align: center;
}

.tk-search__empty {
  color: #4a5560;
}

.tk-search__empty p {
  margin: 0 0 6px;
}

.tk-search__wa {
  color: #1b7f3a;
  font-weight: 600;
}

.tk-search__all:hover,
.tk-search__wa:hover {
  text-decoration: underline;
}

.search-widget.tk-search input.ui-autocomplete-loading {
  background-image: none !important;
}

/* Hide leftover native search menu only (not other jQuery UI widgets) */
body > ul.ui-autocomplete:has(span.category),
body > ul.ui-autocomplete:has(span.product) {
  display: none !important;
}

@media (max-width: 1199px) {
  #header .header-top .search-widget.tk-search,
  #header .header-top .search-widget {
    width: 280px;
  }
}

@media (max-width: 767px) {
  #header .header-top .search-widget.tk-search,
  #header .header-top .search-widget {
    width: 100%;
    margin: 0;
    padding: 10px 15px 14px;
  }

  .header-top .search-widget.tk-search .tk-search__panel {
    top: calc(100% + 6px);
  }
}
