/* Nayef Cars — shared search finder */

.sf-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.sf-root.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sf-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(210, 174, 104, 0.18), transparent 55%),
    rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sf-panel {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(92dvh, 46rem);
  display: flex;
  flex-direction: column;
  margin-top: clamp(0.5rem, 6vh, 4.5rem);
  overflow: hidden;
  border-radius: 1.35rem;
  background: #fbf8f3;
  box-shadow:
    0 0 0 1px rgba(210, 174, 104, 0.22),
    0 32px 80px rgba(8, 10, 14, 0.45);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.sf-root.is-open .sf-panel {
  transform: none;
}

.sf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  background:
    linear-gradient(145deg, #14181e 0%, #0c1014 70%),
    #0c1014;
  color: #fff;
}

.sf-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d2ae68;
}

.sf-kicker::before {
  content: "";
  width: 1.4rem;
  height: 1px;
  background: #d2ae68;
}

.sf-title {
  margin-top: 0.45rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.sf-sub {
  margin-top: 0.35rem;
  max-width: 22rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.sf-close {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.sf-close:hover {
  border-color: #d2ae68;
  color: #d2ae68;
  background: rgba(210, 174, 104, 0.1);
}

.sf-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  flex: 1;
  padding: 1rem 1.1rem 0.35rem;
}

.sf-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
  padding: 0 0.95rem;
  border-radius: 1rem;
  border: 1px solid #efe4cf;
  background: #fff;
  box-shadow: 0 10px 28px rgba(58, 44, 24, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sf-field:focus-within {
  border-color: #d2ae68;
  box-shadow: 0 0 0 3px rgba(210, 174, 104, 0.18), 0 12px 28px rgba(58, 44, 24, 0.06);
}

.sf-field-ic {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  color: #8d6a32;
}

.sf-input {
  width: 100%;
  height: 3.35rem;
  border: 0;
  background: transparent;
  font-size: 1.02rem;
  color: #1c1915;
  outline: none;
}

.sf-input::placeholder {
  color: #a39a8d;
}

.sf-clear {
  display: none;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: 999px;
  border: 0;
  background: #f3eadf;
  color: #8d6a32;
  cursor: pointer;
}

.sf-clear.is-on {
  display: grid;
}

.sf-kbd {
  display: none;
  align-items: center;
  gap: 0.25rem;
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #a39a8d;
}

.sf-kbd span {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  border-radius: 0.35rem;
  border: 1px solid #efe4cf;
  background: #fbf8f3;
}

@media (min-width: 640px) {
  .sf-kbd { display: inline-flex; }
  .sf-field:focus-within .sf-kbd { display: none; }
}

.sf-chips {
  display: flex;
  flex-wrap: nowrap;
  flex: none;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sf-chips::-webkit-scrollbar { display: none; }

.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  height: 2.15rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid #efe4cf;
  background: #fff;
  color: #5c564e;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
}

.sf-chip:hover {
  border-color: #d2ae68;
  color: #3a2c18;
}

.sf-chip.is-on {
  border-color: #c5a36c;
  background: #0c1014;
  color: #e4c58a;
}

.sf-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-inline: -0.15rem;
  padding-inline: 0.15rem;
  padding-bottom: 0.35rem;
}

.sf-section-label {
  margin: 0.35rem 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8d6a32;
}

.sf-popular {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.sf-popular-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: #fff;
  text-align: start;
  color: #1c1915;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.sf-popular-btn:hover {
  border-color: #efe4cf;
  background: #fffdf8;
  transform: translateY(-1px);
}

.sf-popular-btn strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.sf-popular-btn span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #8a7b68;
}

.sf-popular-btn svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: #c5a36c;
}

.sf-results {
  display: grid;
  gap: 0.45rem;
}

.sf-hit {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem;
  border-radius: 1rem;
  border: 1px solid #efe4cf;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.sf-hit:hover,
.sf-hit.is-active {
  border-color: #d2ae68;
  box-shadow: 0 12px 28px rgba(58, 44, 24, 0.08);
  transform: translateY(-1px);
}

.sf-hit-photo {
  width: 4.6rem;
  height: 3.35rem;
  overflow: hidden;
  border-radius: 0.7rem;
  background: #ece4d8;
}

.sf-hit-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-hit-meta {
  min-width: 0;
}

.sf-hit-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.sf-badge {
  display: inline-flex;
  align-items: center;
  height: 1.25rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: #f3e6d4;
  color: #8d6a32;
  font-size: 0.68rem;
  font-weight: 700;
}

.sf-badge.is-used {
  background: #eceae6;
  color: #5c564e;
}

.sf-year {
  font-size: 0.75rem;
  color: #8a7b68;
}

.sf-hit-name {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #1c1915;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-hit-sub {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #8a7b68;
}

.sf-hit-price {
  text-align: end;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1c1915;
  white-space: nowrap;
}

.sf-hit-price small {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: #8a7b68;
}

.sf-empty {
  display: none;
  padding: 2rem 1rem;
  text-align: center;
}

.sf-empty.is-on {
  display: block;
}

.sf-empty p:first-child {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1c1915;
}

.sf-empty p:last-child {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #8a7b68;
}

.sf-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem 1.1rem;
  border-top: 1px solid #efe4cf;
  background: linear-gradient(180deg, #fbf8f3, #f6efe4);
}

.sf-count {
  font-size: 0.85rem;
  color: #8a7b68;
}

.sf-count strong {
  color: #3a2c18;
  font-weight: 600;
}

.sf-browse {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.7rem;
  padding: 0 1.1rem;
  border-radius: 0.85rem;
  background: #c5a36c;
  color: #3a2c18;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(197, 163, 108, 0.28);
  transition: transform 0.18s, background 0.18s;
}

.sf-browse:hover {
  background: #d2ae68;
  transform: translateY(-1px);
}

.sf-browse svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 639px) {
  .sf-root {
    place-items: end center;
    padding: 0;
  }

  .sf-panel {
    width: 100%;
    max-height: min(94dvh, 52rem);
    margin-top: 0;
    border-radius: 1.35rem 1.35rem 0 0;
    transform: translateY(100%);
  }

  .sf-root.is-open .sf-panel {
    transform: none;
  }

  .sf-hit {
    grid-template-columns: 4.1rem minmax(0, 1fr);
  }

  .sf-hit-price {
    grid-column: 2;
    text-align: start;
    margin-top: -0.15rem;
  }

  .sf-hit-price small {
    display: inline;
    margin: 0 0.25rem 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-root,
  .sf-panel,
  .sf-hit,
  .sf-chip,
  .sf-popular-btn,
  .sf-browse {
    transition: none;
  }
}
