.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 104px 24px 32px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}

.search-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-overlay[hidden] {
  display: none;
}

.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 7, 0.58);
  backdrop-filter: blur(12px);
}

.search-overlay__panel {
  position: relative;
  width: min(900px, 100%);
  max-height: min(720px, calc(100svh - 132px));
  overflow: hidden;
  border: 1px solid rgba(31, 31, 31, 0.08);
  border-radius: 26px;
  background: #f7f3ee;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.search-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 18px;
}

.search-overlay__header span {
  display: block;
  margin-bottom: 8px;
  color: #8f7750;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-overlay__header h3 {
  margin: 0;
  color: #1f1f1f;
  font-size: 34px;
  line-height: 1;
}

.search-overlay__close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 999px;
  background: #1f1f1f;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.search-overlay__body {
  max-height: calc(100svh - 250px);
  overflow-y: auto;
  padding: 0 28px 30px;
}

.ai-product-search {
  display: grid;
  gap: 14px;
}

.ai-product-search__bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(31, 31, 31, 0.1);
  border-radius: 22px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ai-product-search__input {
  width: 100%;
  min-height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f1f1f;
  font-size: 17px;
  font-weight: 650;
  padding: 0 12px;
}

.ai-product-search__input::placeholder {
  color: #817970;
  font-weight: 600;
}

.ai-product-search__submit {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: #1f1f1f;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

.ai-product-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-product-search__chips button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(31, 31, 31, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: #4e4a45;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.ai-product-search__status {
  min-height: 20px;
  color: #736b61;
  font-size: 13px;
  font-weight: 650;
}

.ai-product-search__results {
  display: grid;
  gap: 10px;
}

.ai-search-result {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(31, 31, 31, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: #1f1f1f;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.ai-search-result:hover {
  border-color: rgba(143, 119, 80, 0.34);
  background: #fff;
  transform: translateY(-1px);
}

.ai-search-result--more {
  grid-template-columns: 1fr auto;
  padding: 16px 18px;
}

.ai-search-result__image {
  width: 82px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
}

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

.ai-search-result__content {
  min-width: 0;
}

.ai-search-result__meta {
  display: block;
  margin-bottom: 6px;
  color: #8f7750;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ai-search-result__title {
  display: block;
  margin-bottom: 5px;
  color: #1f1f1f;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
}

.ai-search-result__excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: #5b554e;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-search-result__price {
  align-self: center;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.ai-search-empty {
  padding: 20px;
  border: 1px solid rgba(31, 31, 31, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  color: #5b554e;
  font-weight: 650;
}

@media (max-width: 1024px) {
  .search-overlay {
    display: none;
  }
}

@media (max-width: 640px) {
  .ai-product-search__bar,
  .ai-search-result {
    grid-template-columns: 1fr;
  }

  .ai-product-search__submit {
    width: 100%;
  }

  .ai-search-result {
    gap: 10px;
  }

  .ai-search-result__image {
    width: 100%;
    aspect-ratio: 1.9;
  }

  .ai-search-result__price {
    justify-self: start;
  }
}
