/* ============================================
   Location finder: search typeahead + state/city
   picks. Used on /locations/, service hubs, and
   the homepage service-areas section.
   ============================================ */

.location-finder {
  max-width: 720px;
  margin: 0 auto;
}

.location-finder__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.location-finder__search {
  position: relative;
}

.location-finder__search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.location-finder__input {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-8) + var(--space-3));
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.location-finder__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg);
}

.location-finder__results {
  position: absolute;
  z-index: var(--z-dropdown);
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: var(--space-2) 0;
  list-style: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
}

.location-finder__results[hidden] {
  display: none;
}

.location-finder__result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
}

.location-finder__result:hover,
.location-finder__result:focus-visible,
.location-finder__result.is-active {
  background-color: var(--color-accent-bg);
  color: var(--color-accent);
}

.location-finder__result-meta {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.location-finder__picks {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: var(--space-3);
  align-items: end;
}

.location-finder__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.location-finder__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.location-finder__select {
  width: 100%;
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.location-finder__select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.location-finder__select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.location-finder__go {
  min-width: 7.5rem;
}

.location-finder__browse {
  margin: var(--space-5) 0 0;
  text-align: center;
}

.location-finder__browse a {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.location-finder__browse a:hover,
.location-finder__browse a:focus-visible {
  text-decoration: underline;
}

.hub-areas {
  max-width: 960px;
  margin: var(--space-10) auto 0;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.hub-areas__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  list-style: none;
}

.hub-areas__summary::-webkit-details-marker {
  display: none;
}

.hub-areas__summary:hover {
  background-color: var(--color-bg-alt);
}

.hub-areas__list {
  padding: 0 var(--space-5) var(--space-5);
}

.hub-areas__state {
  margin-top: var(--space-5);
}

.hub-areas__state:first-child {
  margin-top: 0;
}

.hub-areas__state h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

@media (max-width: 640px) {
  .location-finder__picks {
    grid-template-columns: 1fr;
  }

  .location-finder__go {
    width: 100%;
  }
}
