/* Live autocomplete dropdown — 2026-06-17 */
#search-box { position: relative; }

.sg-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  max-height: 480px;
  overflow-y: auto;
  font-size: 0.92rem;
}
.sg-dropdown.hidden { display: none; }

.sg-section {
  padding: .35rem 0;
}
.sg-section + .sg-section {
  border-top: 1px solid #f1f5f9;
}

.sg-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .9rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s;
}
.sg-item:hover, .sg-item.sg-active {
  background: #f1f5f9;
}

.sg-term .sg-i {
  width: 22px;
  color: #64748b;
  font-size: 0.95rem;
}
.sg-term .sg-t b {
  color: #1d4ed8;
  font-weight: 700;
}
.sg-term .sg-t {
  color: #1f2937;
}

.sg-prod {
  padding: .55rem .9rem;
}
.sg-prod .sg-img {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}
.sg-prod .sg-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sg-prod .sg-no-img {
  font-size: 1.2rem;
  opacity: 0.5;
}
.sg-prod .sg-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sg-prod .sg-name {
  color: #111827;
  font-size: 0.88rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-prod .sg-meta {
  color: #64748b;
  font-size: 0.78rem;
}
.sg-prod .sg-meta b {
  color: #059669;
  font-weight: 700;
}

@media (max-width: 640px) {
  .sg-dropdown {
    max-height: 60vh;
    font-size: 0.9rem;
  }
  .sg-prod .sg-img {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
}
