/* wksemanticaisearch - search widget & autocomplete */

/* ── Widget wrapper ── */
.wk-search-widget {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 40rem;
}
.wk-search-bar-wrap {
  position: relative;
  width: 100%;
}

.wk-ac-meta{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:2px;
}

.wk-ac-ref{
  font-size:0.8rem;
  color:#666;
}

.wk-ac-price{
  font-size:0.9rem;
  font-weight:600;
  color:#510d31;
}

/* ── Input row ── */
.wk-search-inner {
  display: flex;
  align-items: center;
  width: 100%;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.18);
  border-radius: 5px;
  transition: border-color .2s, box-shadow .2s;
  overflow: visible;
}
.wk-search-inner:focus-within {
  border-color: #510d31;
  box-shadow: none;
}

#semantic-ai-search-bar {
  flex: 1;
  min-width: 0;
  padding: 0rem 1rem;
  border: none;
  outline: none;
  font-size: .93rem;
  background: transparent;
  color: #222;
}

/* ── Buttons ── */
.wk-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: .2rem;
  border: none;
  border-radius: 3px;
  background: none;
  color: #666;
  cursor: pointer;
  transition: background .15s, color .15s;
  padding: 0;
  text-decoration: none;
}
.wk-search-btn:hover { background: #e8f4fb; color: #510d31; }

.wk-search-btn--submit {
  background: #510d31;
  color: #fff;
  margin-right: .2rem;
}
.wk-search-btn--submit:hover { background: #1f5a7a; color: #fff; }

/* ── Autocomplete dropdown ── */
.ui-autocomplete.semantic-search-autocomplete {
  background: #fff;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 5px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: .4rem 0;
  max-height: 26rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999 !important;
  min-width: 22rem;
}

.semantic-search-autocomplete .ui-menu-item { width: 100%; list-style: none; }
.semantic-search-autocomplete .ui-menu-item + .ui-menu-item { border-top: 1px solid #f0f0f0; }

.semantic-search-autocomplete .ui-menu-item a,
.semantic-search-autocomplete .ui-menu-item a.ui-state-focus {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1rem;
  text-decoration: none;
  color: #222;
  border: none !important;
  background: none !important;
  transition: background .15s;
  cursor: pointer;
}
.semantic-search-autocomplete .ui-menu-item a:hover,
.semantic-search-autocomplete .ui-menu-item a.ui-state-focus {
  background: #e8f4fb !important;
}

.wk-ac-thumb {
  flex-shrink: 0;
  width: 50px; height: 50px;
  object-fit: cover;
  border-radius: .4rem;
  border: 1px solid #eee;
}
.wk-ac-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: .1rem;
}
.wk-ac-name {
  font-size: .87rem; font-weight: 600; color: #1a1a2e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wk-ac-price { font-size: .83rem; color: #510d31; font-weight: 700; }
.wk-ac-ref   { font-size: .74rem; color: #aaa; }

.wk-ac-noresult {
  padding: .9rem 1rem; font-size: .85rem; color: #888;
  text-align: center; list-style: none;
}

/* ── Spinner ── */
.wk_csspin {
  position: absolute;
  right: 3.5rem; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ── Mobile ── */
@media (max-width: 992px) {
  .wk-search-widget { max-width: 100%; }
  #semantic-ai-search-bar { font-size: .9rem; }
  .ui-autocomplete.semantic-search-autocomplete {
    min-width: 0 !important;
    left: 0 !important;
    box-sizing: border-box;
  }
  .wk-ac-thumb { width: 50px; height: 50px; }
  .wk-ac-name { white-space: normal; -webkit-line-clamp: 2; }
}

/* ── Mobile header row integration ── */
@media (max-width: 992px) {
  .wk-mobile-controls-row { min-width: 0; }
  .wk-mobile-controls-row #wk_ai_search_widget { flex: 1 1 auto; min-width: 0; }
  .wk-mobile-controls-row .shopping-cart-module,
  .wk-mobile-controls-row .blockcart,
  .wk-mobile-controls-row .cart-preview,
  .wk-mobile-controls-row .cart-header,
  .wk-mobile-controls-row .cart-link {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
  }
}
