/* City search — HydroJet Plumbing (PipeCraft)
   Added 2026-11-07, preview only. Copper / steel-blue tokens match style-v4.css.
   The search sits in normal page flow (never inside the hero, which has
   overflow:hidden) so the results dropdown is never clipped, and it never
   overlaps the sticky header, the hero heading or the call button. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Homepage band: overlaps the bottom edge of the hero like a
   floating search card, so it reads as part of the hero on desktop
   and mobile. It is a sibling AFTER the hero (never inside it, which
   has overflow:hidden), so the results dropdown is never clipped. --- */
.city-search-band {
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 40px rgba(8, 20, 38, 0.14);
  margin-top: -48px;
  padding: 2.4rem 0 2.6rem;
  position: relative;
  z-index: 60;
}

.city-search-band .city-search {
  max-width: 720px;
}

.city-search-band h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  margin-bottom: 0.5rem;
  text-align: center;
}

.city-search-band > .container > p,
.city-search-lead {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

/* --- Compact strip on every other page: directly below the header --- */
.city-search-strip {
  background: var(--ink-900);
  padding: 0.9rem 0;
  position: relative;
  z-index: 150;
}

/* --- The form (shared by band and strip) --- */
.city-search {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  gap: 0.6rem;
}

.city-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 1.25rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-strong);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.city-search input[type="search"]:focus {
  border-color: var(--copper-500);
  box-shadow: 0 0 0 4px rgba(200, 119, 46, 0.18);
}

.city-search button[type="submit"] {
  flex: none;
  height: 56px;
  padding: 0 1.6rem;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--copper-500);
  border: 2px solid var(--copper-500);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s ease;
}

.city-search button[type="submit"]:hover,
.city-search button[type="submit"]:focus-visible {
  background: var(--copper-600);
  border-color: var(--copper-600);
}

/* --- Results dropdown --- */
.city-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  text-align: left;
}

.city-search-results li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  text-decoration: none;
}

.city-search-results li a strong {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
}

.city-search-results li a span {
  flex: none;
  font-size: 0.82rem;
  color: var(--muted);
}

.city-search-results li a:hover,
.city-search-results li a.active {
  background: rgba(47, 111, 214, 0.08);
}

.city-search-results li a.active strong {
  color: var(--blue-600);
}

.city-search-results .no-match {
  padding: 0.9rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.city-search-results .no-match a {
  color: var(--copper-600);
  font-weight: 600;
}

/* --- Popular links under the homepage search --- */
.city-search-popular {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.city-search-popular a {
  color: var(--blue-600);
  font-weight: 600;
  white-space: nowrap;
}

.city-search-popular a:hover {
  color: var(--copper-600);
}

/* --- Mobile: 16px input text stops iOS zooming on focus; button stacks.
   Smaller hero overlap so the band never covers hero content. --- */
@media (max-width: 640px) {
  .city-search-band {
    margin-top: -48px;
    border-radius: 20px 20px 0 0;
    padding: 1.8rem 0 2rem;
  }

  .city-search {
    flex-wrap: wrap;
  }

  .city-search input[type="search"] {
    flex-basis: 100%;
    height: 56px;
    font-size: 16px;
  }

  .city-search button[type="submit"] {
    flex: 1 1 auto;
    width: 100%;
    height: 52px;
  }

  .city-search-strip .city-search {
    flex-wrap: nowrap;
  }

  .city-search-strip .city-search input[type="search"] {
    flex-basis: auto;
    font-size: 16px;
  }

  .city-search-strip .city-search button[type="submit"] {
    flex: none;
    width: auto;
    padding: 0 1.1rem;
  }

  .city-search-results {
    max-height: 280px;
  }
}
