.lf-header-search {
  position: relative;
  z-index: 4;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.lf-header-search-toggle {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--lf-color-primary, #2563eb) 24%, transparent);
  border-radius: 999px;
  background: var(--lf-color-primary-soft, rgba(37, 99, 235, 0.08));
  color: var(--lf-color-primary, #2563eb);
  cursor: pointer;
  transition:
    transform 0.22s ease,
    opacity 0.18s ease,
    background 0.2s ease;
}

.lf-header-search-toggle:hover {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--lf-color-primary, #2563eb) 14%, transparent);
}

.lf-header-search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.lf-header-search-field {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.42);
  color: #7c3aed;
  opacity: 0;
  overflow: hidden;
  transform: scaleX(0.72);
  transform-origin: right center;
  pointer-events: none;
  transition:
    width 0.28s ease,
    opacity 0.18s ease,
    transform 0.28s ease,
    background 0.2s ease;
}

.lf-header-search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lf-color-text, #0f172a);
  font: inherit;
  font-size: 14px;
}

.lf-header-search-status {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  max-width: 340px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--lf-color-muted, #64748b);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.lf-header-search-status button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #7c3aed;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.lf-search-hidden {
  display: none !important;
}

.lf-header-search.is-open {
  z-index: 8300;
}

.lf-header-search.is-open .lf-header-search-toggle {
  opacity: 0;
  transform: scale(0.86);
  pointer-events: none;
}

.lf-header-search.is-open .lf-header-search-field {
  width: min(320px, 42vw);
  opacity: 1;
  transform: scaleX(1);
  pointer-events: auto;
  background: rgba(248, 250, 252, 0.78);
}

.lf-header-search.is-open .lf-header-search-status:not(:empty) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
