/* Search from the header (public/app.js, openSiteSearch): a panel that drops from the top of the screen, the field
   on one line and the matching cars below, each opening its car page. Same anthracite, lines and type as the site. */
.search-dialog {
  width: min(760px, calc(100vw - 48px));
  max-width: none;
  max-height: min(78svh, 720px);
  margin: 92px auto auto;
  padding: 0;
  border: 1px solid #ffffff1a;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgb(0 0 0 / 45%);
  overflow: hidden;
  overscroll-behavior: contain;
}
.search-dialog[open] { display: flex; animation: search-in .32s cubic-bezier(.2, .7, .2, 1); }
.search-dialog::backdrop { background: rgb(var(--surface-deep-rgb) / 55%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.search-dialog[open]::backdrop { animation: search-fade .32s ease; }
.search-dialog.closing { animation: search-out .22s ease forwards; }
.search-dialog.closing::backdrop { animation: search-fade .22s ease reverse forwards; }
@keyframes search-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes search-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes search-fade { from { opacity: 0; } }
.search-panel { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.search-bar { display: flex; align-items: center; gap: 14px; padding: 0 14px 0 26px; border-bottom: 1px solid var(--line); }
.search-bar-icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-secondary); }
.search-bar input { flex: 1; min-width: 0; height: 74px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 1.125rem; letter-spacing: .01em; outline: none; }
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-close { flex-shrink: 0; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text-secondary); transition: color .2s, transform .2s; }
.search-close svg { width: 22px; height: 22px; }
.search-close:hover { color: #fff; transform: rotate(90deg); }
.search-status { margin: 0; padding: 14px 26px 6px; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); }
.search-results { list-style: none; margin: 0; padding: 0 12px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ffffff40 transparent; }
.search-result { display: flex; align-items: center; gap: 18px; padding: 10px 14px; border-bottom: 1px solid #ffffff10; color: inherit; text-decoration: none; transition: background .2s; }
.search-results li:last-child .search-result { border-bottom: 0; }
.search-result:hover, .search-result:focus-visible { background: rgb(255 255 255 / 5%); outline: none; }
.search-result-photo { flex-shrink: 0; width: 104px; aspect-ratio: 3 / 2; overflow: hidden; background: #1f1f1f; }
.search-result-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.search-result-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-result-brand { font-size: .6875rem; letter-spacing: .24em; text-transform: uppercase; color: var(--text-secondary); }
.search-result-model { font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: 1.5rem; font-weight: 500; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-facts { margin-top: 2px; font-size: .8125rem; color: var(--text-muted); }
.search-result-arrow { flex-shrink: 0; width: 20px; height: 20px; color: var(--text-muted); transition: color .2s, transform .2s; }
.search-result:hover .search-result-arrow { color: #e32630; transform: translateX(3px); }
@media (max-width: 700px) {
  /* Phones: the panel takes the whole width under the header. */
  .search-dialog { width: 100vw; max-height: calc(100svh - 78px); max-height: calc(100dvh - 78px); margin: 78px 0 auto; border-width: 1px 0 0; }
  .search-bar { padding: 0 6px 0 18px; gap: 10px; }
  .search-bar input { height: 64px; font-size: 16px; }
  .search-status { padding: 12px 18px 4px; }
  .search-results { padding: 0 4px 12px; }
  .search-result { gap: 14px; padding: 10px 14px; }
  .search-result-photo { width: 84px; }
  .search-result-model { font-size: 1.3125rem; }
}
@media (prefers-reduced-motion: reduce) {
  .search-dialog[open], .search-dialog.closing, .search-dialog[open]::backdrop, .search-dialog.closing::backdrop { animation: none; }
}
