/* Advance Search — predictive typeahead dropdown. Namespaced under .cajson-as to avoid
   collisions with theme styles. Neutral defaults; themes can override via these classes. */

.cajson-as {
  position: relative;
  /* Inset from the search-bar edges so it lines up with the search form below and has
     breathing room around it. Tune this margin to fine-tune the width/alignment. */
  margin: 1rem;
}

.cajson-as-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  line-height: 1.2;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.4rem;
  background: #fff;
}

.cajson-as-dropdown {
  position: absolute;
  z-index: 1000;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 22rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cajson-as-dropdown[hidden] {
  display: none;
}

.cajson-as-group {
  padding: 0.5rem 0.9rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.5);
}

.cajson-as-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.cajson-as-item:hover,
.cajson-as-item:focus,
.cajson-as-item.cajson-as-active {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

/* While a natural-language query is being interpreted (Enter with no highlighted suggestion). */
.cajson-as-loading .cajson-as-input {
  opacity: 0.6;
  cursor: progress;
}

/* Voice search — mic button inside the input on the right (only present where supported). */
.cajson-as-has-mic .cajson-as-input {
  padding-right: 2.9rem;
}
.cajson-as-mic {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.cajson-as-mic:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.8);
}
.cajson-as-listening .cajson-as-mic {
  background: #e0483a;
  color: #fff;
  animation: cajson-as-pulse 1.4s ease-in-out infinite;
}
@keyframes cajson-as-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 72, 58, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(224, 72, 58, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .cajson-as-listening .cajson-as-mic { animation: none; }
}
