.search-backdrop {
  animation: sfade 150ms ease both;
  touch-action: none;
}

.search-panel {
  animation: sslide 200ms ease both;
}

/* Result rows rise + fade as the set lands without delaying interaction. */
.search-result-enter {
  animation: srow 160ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.search-input-row:has(input:focus-visible) {
  box-shadow: inset 0 -2px 0 var(--color-secondary);
}

/* City uses the input row as the focus boundary. This keeps the keyboard cue
   visible without letting the global focus ring float inside the dialog. */
:root[data-style="city"] .search-input-row:has(input:focus-visible) {
  box-shadow: inset 0 -3px 0 var(--color-tertiary);
}

:root[data-style="city"] .search-input-row input:focus-visible {
  outline: none;
}

:root[data-style="city"] .search-budget-chip {
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--fp-ink) 16%, transparent);
}

/* City turns suggested brands into constructed choices rather than leaving
   them as Classic's soft pills. Budget remains visually stronger because it
   advances the primary buying decision. */
:root[data-style="city"] .search-popular-chip {
  background: var(--color-surface-container);
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--fp-ink) 16%, transparent);
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

:root[data-style="city"] .search-popular-chip:hover,
:root[data-style="city"] .search-popular-chip:focus-visible {
  background: var(--color-tertiary);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--fp-ink) 22%, transparent);
  color: var(--color-on-tertiary);
  transform: translate(-1px, -1px);
}

:root[data-style="city"] .search-result-enter {
  border-bottom: 1px solid color-mix(in srgb, var(--fp-ink) 22%, transparent);
}

:root[data-style="city"] .search-close-control {
  background: var(--color-tertiary);
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--fp-ink) 20%, transparent);
  color: var(--color-on-tertiary);
}

/* Search becomes a floating dialog at tablet width. Give that dark surface the
   same quiet boundary as the other dialog panels; mobile stays edge-to-edge. */
@media (min-width: 768px) and (prefers-color-scheme: dark) {
  :root[data-style="classic"][data-theme-preference="system"] .search-panel {
    border: 1px solid var(--c-border-dropdown);
  }
}

@media (min-width: 768px) {
  :root[data-style="classic"][data-theme="dark"] .search-panel {
    border: 1px solid var(--c-border-dropdown);
  }
}

/* City constructs the search panel like a dialog at tablet width: outlined
   with the same hard shadow as adaptive-dialog.css. */
@media (min-width: 768px) {
  :root[data-style="city"] .search-panel {
    border: var(--fp-outline-width) solid var(--fp-ink);
    border-radius: var(--fp-card-radius);
    box-shadow: 7px 8px 0 color-mix(in srgb, var(--fp-ink) 28%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-backdrop,
  .search-panel,
  .search-result-enter,
  :root[data-style="city"] .search-popular-chip {
    animation: none;
    transition: none;
  }

  :root[data-style="city"] .search-popular-chip:hover,
  :root[data-style="city"] .search-popular-chip:focus-visible {
    transform: none;
  }
}

@keyframes sfade {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes sslide {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes srow {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
