/* ── FYSH Location Search Widget ──────────────────────────────────────────────
   CR: fysh-location-search-2026-06-23
   Depends on: tokens.css (--navy, --gold, --blue, --border)
   ─────────────────────────────────────────────────────────────────────────── */

/* Container */
.ls-wrap {
  position: relative;
  margin-bottom: 20px;
}

/* Input row: icon + text field + spinner */
.ls-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ls-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6B7A8D;
  pointer-events: none;
  display: flex;
  align-items: center;
  font-size: 16px;
  z-index: 1;
}

.ls-input {
  padding-left: 38px !important;
  padding-right: 36px !important;
}

.ls-input:focus {
  outline: 2px solid var(--blue, #1E5BA8);
  outline-offset: 0;
}

/* Spinner */
.ls-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #E2E8F0;
  border-top-color: var(--blue, #1E5BA8);
  border-radius: 50%;
  animation: ls-spin 0.7s linear infinite;
}

@keyframes ls-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Results drawer */
.ls-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 35, 64, 0.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

/* Individual result */
.ls-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 0;
}

.ls-result:hover,
.ls-result[aria-selected="true"] {
  background: #F0F5FF;
}

.ls-result:first-child { border-radius: 7px 7px 0 0; }
.ls-result:last-child  { border-radius: 0 0 7px 7px; }

/* Result icon */
.ls-result__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ls-result--area     .ls-result__icon { background: #EBF2FF; color: var(--blue, #1E5BA8); }
.ls-result--postcode .ls-result__icon { background: #EBF2FF; color: var(--blue, #1E5BA8); }
.ls-result--town     .ls-result__icon { background: #FDF6E7; color: #92400E; }
.ls-result--county   .ls-result__icon { background: #F0FDF4; color: #166534; }

/* Result text */
.ls-result__text {
  flex: 1;
  min-width: 0;
}

.ls-result__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy, #0F2340);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-result__sub {
  display: block;
  font-size: 12px;
  color: #6B7A8D;
  margin-top: 1px;
}

/* Type badge */
.ls-result__badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ls-result--area     .ls-result__badge { background: #EBF2FF; color: var(--blue, #1E5BA8); }
.ls-result--postcode .ls-result__badge { background: #EBF2FF; color: var(--blue, #1E5BA8); }
.ls-result--town     .ls-result__badge { background: #FDF6E7; color: #92400E; }
.ls-result--county   .ls-result__badge { background: #F0FDF4; color: #166534; }

/* Divider between type groups */
.ls-results__divider {
  height: 1px;
  background: var(--border, #E2E8F0);
  margin: 4px 0;
}

/* Empty / no results */
.ls-results__empty {
  padding: 14px;
  font-size: 13px;
  color: #6B7A8D;
  text-align: center;
}

/* Status message below input */
.ls-status {
  margin-top: 6px;
  font-size: 12px;
  min-height: 18px;
}

.ls-status--ok    { color: #15803d; }
.ls-status--error { color: #b91c1c; }

/* Confirmed location strip */
.ls-confirmed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F0FDF4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: #166534;
}

.ls-confirmed__icon { font-size: 15px; }

.ls-confirmed__clear {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #6B7A8D;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.ls-confirmed__clear:hover { color: var(--navy, #0F2340); background: #dcfce7; }

/* Override fields section */
.ls-override-fields {
  margin-top: 16px;
}

.ls-override-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #6B7A8D;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 12px;
  display: inline-block;
}

.ls-override-toggle:hover { color: var(--navy, #0F2340); }

.ls-override-body[hidden] { display: none; }

/* ── Recorded address panel ── CR: fysh-recorded-address-2026-09-28 ───────────
   Shows the full stored listing address on the edit page with an encryption and
   sharing reminder. Tokens only; 4px FYSH card radius. */
.ls-recorded {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.ls-recorded__icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--blue);
    font-size: 15px;
}
.ls-recorded__body { min-width: 0; }
.ls-recorded__label {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
}
.ls-recorded__addr {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--navy);
    word-break: break-word;
}
.ls-recorded__note {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}
