/* ============================================================
   JP SHEET — Search & Results Styles
   assets/css/search.css
   ============================================================ */

/* ── Search Box ─────────────────────────────────────────────── */
.search-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  max-width: 560px;
  margin: 0 auto 28px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.search-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.search-box__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.search-box__live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(34,197,94,.1);
  color: #16A34A;
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 100px;
  padding: 3px 9px;
}
.search-box__live::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse 2s infinite;
}
.search-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  outline: none;
  transition: all .2s;
  font-family: 'Courier New', monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.search-input::placeholder {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-3);
}
.search-input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.search-input.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.search-btn {
  padding: 12px 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.search-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-glow);
}
.search-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.search-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: 0;
}

/* ── Loading Spinner ────────────────────────────────────────── */
.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results-loading {
  text-align: center;
  padding: 48px 20px;
}
.results-loading p {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.results-loading small {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Results Section ────────────────────────────────────────── */
.results-section {
  padding: 32px 0 60px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.results-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.results-chassis {
  font-size: 15px;
  color: var(--text-2);
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}
.results-chassis strong {
  color: var(--text);
  font-size: 16px;
}
.found-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22,163,74,.1);
  color: #16A34A;
  border: 1px solid rgba(22,163,74,.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
}
.results-new-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  margin-left: auto;
}
.results-new-search:hover {
  background: var(--bg-3);
  color: var(--text);
}

/* ── Vehicle Cards Grid ─────────────────────────────────────── */
.vehicles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.vehicle-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all .2s;
  display: flex;
  flex-direction: column;
}
.vehicle-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(187,24,35,.12);
  transform: translateY(-1px);
}
.vehicle-card.is-exact {
  border-color: #16A34A;
  box-shadow: 0 0 0 2px rgba(22,163,74,.15);
}
.vehicle-card.is-close {
  border-color: #F59E0B;
  box-shadow: 0 0 0 2px rgba(245,158,11,.15);
}
.vehicle-card.is-loose {
  border-color: var(--border);
  opacity: .85;
}
.vehicle-card__exact-badge {
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  padding: 3px 10px;
  color: #fff;
  background: #9CA3AF;
  margin: 10px 10px 0;
}
.vehicle-card__exact-badge.match-exact {
  background: #16A34A;
}
.vehicle-card__exact-badge.match-close {
  background: #F59E0B;
  color: #111;
}
.vehicle-card__exact-badge.match-loose {
  background: #9CA3AF;
}
.vehicle-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.vehicle-card__model {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.vehicle-card__specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  flex: 1;
}
.vehicle-card__spec {
  background: var(--bg-2);
  border-radius: 5px;
  padding: 5px 7px;
}
.vehicle-card__spec-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1px;
}
.vehicle-card__spec-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.vehicle-card__spec-value.grade {
  font-size: 14px;
  font-weight: 800;
}
.vehicle-card__actions {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}
.vehicle-card__buy-btn {
  width: 100%;
  padding: 13px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .18s;
  letter-spacing: -.01em;
}
.vehicle-card__buy-btn:hover {
  background: var(--brand-hover);
  box-shadow: 0 4px 14px var(--brand-glow);
  transform: translateY(-1px);
}

/* ── Not Found ──────────────────────────────────────────────── */
.not-found-box {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 20px;
}
.not-found-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--text-3);
}
.not-found-box h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.not-found-box > p {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 24px;
}
.not-found-highlight {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  background: var(--brand-dim);
  border: 1px solid rgba(187,24,35,.2);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.not-found-highlight-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.not-found-highlight p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.not-found-highlight p:last-child { margin-bottom: 0; }
.not-found-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.not-found-price {
  text-align: center;
}
.not-found-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -.04em;
  display: block;
}
.not-found-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  display: block;
}

/* ── Error Box ──────────────────────────────────────────────── */
.error-box {
  text-align: center;
  padding: 40px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.error-box p {
  color: var(--brand);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── Mobile fixes ────────────────────────────────────────────── */
@media(max-width:600px){
  .search-box{padding:16px;margin:0 0 24px}
  .search-input-wrap{flex-direction:column;gap:8px}
  .search-input{width:100%}
  .search-btn{width:100%;justify-content:center}
  .results-header{flex-direction:column;align-items:flex-start;gap:10px}
  .results-new-search{margin-left:0}
}
