header,
header .container,
header .row,
header .col-sm-6,
#search,
#search.input-group {
  overflow: visible !important;
}

#search.input-group {
  position: relative;
  z-index: 10050;
}

.ai-search-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10051;
  background: #fff;
  border: 1px solid #ddd;
  border-top: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: min(420px, 70vh);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #8b95a5 transparent;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

/* Кастомный тонкий ползунок (WebKit / Blink) */
.ai-search-suggest::-webkit-scrollbar {
  width: 10px;
}

.ai-search-suggest::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.06));
  border-radius: 999px;
  margin: 8px 2px;
}

.ai-search-suggest::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c8d0db 0%, #8b95a5 100%);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 48px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.ai-search-suggest::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4f9cf9 0%, #1a73e8 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ai-search-suggest::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #1557b0 0%, #0f5bb5 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ai-search-suggest::-webkit-scrollbar-corner {
  background: transparent;
}

.ai-search-suggest__item {
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  text-align: left;
}

.ai-search-suggest__item:last-child {
  border-bottom: 0;
}

.ai-search-suggest__item:hover,
.ai-search-suggest__item.is-active {
  background: #f5f7fa;
}

.ai-search-suggest__main {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.ai-search-suggest__cart {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 10px 0 0;
  padding: 6px 10px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.ai-search-suggest__cart:hover {
  border-color: #1a73e8;
  color: #1a73e8;
}

.ai-search-suggest__cart.is-added {
  border-color: #2e7d32;
  color: #2e7d32;
}

.ai-search-suggest__cart.is-loading,
.ai-search-suggest__cart:disabled {
  opacity: 0.65;
  cursor: default;
}

.ai-search-suggest__body {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.ai-search-suggest__thumb {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
  background: #f8f8f8;
}

.ai-search-suggest__thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ai-search-suggest__content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-search-suggest__name {
  color: #222;
  font-size: 13px;
  line-height: 1.35;
}

.ai-search-suggest__model {
  color: #888;
  font-size: 12px;
  line-height: 1.3;
}

.ai-search-suggest__price {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  color: #222;
  font-size: 13px;
  font-weight: 600;
}

.ai-search-suggest__special {
  display: block;
  color: #c0392b;
}

.ai-search-suggest__old {
  display: block;
  color: #999;
  font-size: 12px;
  font-weight: 400;
  text-decoration: line-through;
}

.ai-search-suggest__item mark {
  background: transparent;
  color: #1a73e8;
  font-weight: 600;
  padding: 0;
}

.ai-search-suggest--hint {
  padding: 10px 12px;
}

.ai-search-suggest--empty {
  border-top: 0;
}

.ai-search-suggest__hint {
  color: #5f6368;
  font-size: 13px;
  line-height: 1.4;
}

.ai-search-suggest__hint--empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-search-suggest__empty-title {
  color: #3c4043;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.ai-search-suggest__empty-sub {
  color: #80868b;
  font-size: 12px;
  line-height: 1.35;
}

.ai-search-suggest--loading {
  padding: 10px 12px;
}

.ai-search-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ai-search-progress--compact {
  min-width: 220px;
}

.ai-search-progress__track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e8eaed;
  overflow: hidden;
}

.ai-search-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a73e8, #4f9cf9);
  transition: width 0.18s ease;
}

.ai-search-progress__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5f6368;
  font-size: 13px;
}

.ai-search-progress__text {
  flex: 1 1 auto;
}

.ai-search-progress__percent {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #1a73e8;
  min-width: 3.2em;
  text-align: right;
}

.ai-search-suggest__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d7de;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: ai-search-spin 0.8s linear infinite;
  flex: 0 0 18px;
}

.ai-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 24, 0.62);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.ai-search-overlay.is-visible {
  opacity: 1;
}

.ai-search-overlay__panel {
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.ai-search-overlay .ai-search-progress__meta {
  font-size: 15px;
}

.ai-search-overlay .ai-search-progress__track {
  height: 8px;
}

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