/* AI live search dropdown — used site-wide */

.ais-wrap {
  position: relative;
}

.ais-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  overflow: auto;
  padding: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Inline fallback before JS mounts (hidden by default) */
.ais-panel:not(.ais-panel--floating) {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1200;
  max-height: min(70vh, 480px);
}

/* Portaled to body — position set by JS */
.ais-panel.ais-panel--floating {
  position: fixed;
  z-index: 9998;
  max-height: min(55vh, 480px);
  pointer-events: auto;
}

body.is-ais-search-active {
  /* Prevent page scroll chaining while browsing results on touch devices */
  overscroll-behavior: contain;
}

.ais-interpretation,
.ais-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #475569;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border-radius: 8px;
  margin-bottom: 8px;
}

.ais-ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ais-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 8px 10px 4px;
}

.ais-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ais-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.ais-row:hover {
  background: #f8fafc;
}

.ais-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.ais-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ais-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ais-row-body strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ais-meta {
  font-size: 12px;
  color: #64748b;
}

.ais-price {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.ais-cal {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.ais-view-all {
  display: block;
  text-align: center;
  padding: 10px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  border-top: 1px solid #f1f5f9;
}

.ais-view-all:hover {
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
}

.ais-empty {
  padding: 16px 12px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.ais-suggestions {
  padding: 0 8px 10px;
  font-size: 12px;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ais-suggestion {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.ais-suggestion:hover {
  background: #dbeafe;
}

.search-ai-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #eff6ff, #faf5ff);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
}

.search-ai-banner .ais-ai-badge {
  font-size: 11px;
  padding: 3px 10px;
}

@media (max-width: 768px) {
  .ais-panel.ais-panel--floating {
    max-height: min(50vh, 360px);
    border-radius: 10px;
  }

  .ais-row {
    padding: 12px 10px;
  }

  .ais-row-body strong {
    font-size: 13px;
    white-space: normal;
  }

  .ais-price {
    font-size: 12px;
  }

  .ais-cal {
    display: none;
  }
}
