/* ── TOKENS (self-contained fallbacks so this sheet works without iw-algolia.css) ── */
.iw-autocomplete-wrap {
  --_purple:      var(--color-purple,        #4B2E83);
  --_purple-pale: var(--color-purple-pale,   #EDE8F7);
  --_teal:        var(--color-teal,          #1A7A8A);
  --_teal-light:  var(--color-teal-light,    #2DA8BA);
  --_gold:        var(--color-gold-light,    #F2C94C);
  --_border:      var(--color-border,        #E2E2EA);
  --_text:        var(--color-text-primary,  #1A1A2E);
  --_text-sec:    var(--color-text-secondary,#5C5C7A);
  --_text-muted:  var(--color-text-muted,    #9090A8);
  --_surface:     var(--color-surface,       #FFFFFF);
}

/* ── WRAPPER ──────────────────────────────────────────────────────────────── */
.iw-autocomplete-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  overflow: visible;
}

/* ── INPUT ROW ────────────────────────────────────────────────────────────── */
.iw-ac-input-wrap {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.iw-ac-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: var(--_text);
  font-family: inherit;
  min-width: 0;
}

.iw-ac-input::placeholder {
  color: var(--_text-muted);
}

/* Remove native search clear button */
.iw-ac-input::-webkit-search-cancel-button { display: none; }

/* ── SUBMIT BUTTON ────────────────────────────────────────────────────────── */
/* Higher specificity (0,2,0) beats Elementor kit's .elementor-kit-8 button (0,1,1) */
.iw-autocomplete-wrap .iw-ac-submit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50% !important;
  background: var(--_purple);
  border: none;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
  padding: 0;
  box-sizing: content-box;
}

.iw-autocomplete-wrap .iw-ac-submit:hover {
  background: #6040a0;
}

.iw-autocomplete-wrap .iw-ac-submit svg {
  width: 18px;
  height: 18px;
}

/* ── DROPDOWN ─────────────────────────────────────────────────────────────── */
.iw-ac-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 300px;
  background: var(--_surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(75, 46, 131, 0.18);
  z-index: 99999;
  overflow: hidden;
}

.iw-ac-list {
  list-style: none;
  padding: 0.4rem 0;
  margin: 0;
}

.iw-ac-item > a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.6rem 1rem;
  text-decoration: none;
  transition: background 0.12s;
  outline: none;
}

.iw-ac-item > a:hover,
.iw-ac-item > a:focus {
  background: var(--_purple-pale);
}

.iw-ac-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--_purple);
  line-height: 1.3;
}

/* Algolia highlight markup */
.iw-ac-title em,
.iw-ac-snippet em {
  font-style: normal;
  background: var(--_gold);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}

.iw-ac-type {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--_teal);
}

.iw-ac-snippet {
  font-size: 0.8rem;
  color: var(--_text-sec);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
.iw-ac-footer {
  border-top: 1px solid var(--_border);
  padding: 0.5rem 1rem;
}

.iw-ac-view-all {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--_teal);
  text-decoration: none;
}

.iw-ac-view-all:hover {
  color: var(--_teal-light);
  text-decoration: underline;
}

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */
.iw-ac-empty {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--_text-muted);
  text-align: center;
}
