/*
 * style.css — Avito Search mini-site.
 *
 * Minimal, desktop-first, no frameworks, no CDN.
 */

/* === Reset & base === */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #222;
  background: #f5f5f5;
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* === Header === */

header {
  margin-bottom: 28px;
}

header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #111;
}

.subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #666;
}

/* === Search form === */

.search-form {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-row--price {
  margin-top: 12px;
}

.price-sep {
  color: #999;
  font-size: 16px;
}

/* === Inputs === */

.input--query {
  flex: 1;
  padding: 10px 14px;
  font-size: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.input--query:focus {
  border-color: #6366f1;
}

.input--price {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.input--price:focus {
  border-color: #6366f1;
}

/* === Button === */

.btn--search {
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #6366f1;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn--search:hover {
  background: #4f46e5;
}

.btn--search:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

/* === Status messages === */

.status {
  margin-top: 20px;
  min-height: 24px;
  font-size: 14px;
}

.status--loading {
  color: #6366f1;
}

.status--loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #c7d2fe;
  border-top: 2px solid #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status--error {
  color: #fff;
  background: #ef4444;
  padding: 8px 14px;
  border-radius: 6px;
}

.status--empty {
  color: #6b7280;
  padding: 8px 0;
}

/* === Results === */

.results-grid {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.results-header {
  font-size: 14px;
  color: #555;
  margin-bottom: 2px;
}

/* === Card === */

.card {
  background: #fff;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  margin-bottom: 8px;
  line-height: 1.35;
}

.card-title:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* === Badges === */

.card-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  line-height: 1.5;
}

.badge--new {
  background: #d1fae5;
  color: #065f46;
}

.badge--used {
  background: #fed7aa;
  color: #92400e;
}

.badge--unknown {
  background: #f3f4f6;
  color: #6b7280;
}

.badge--rating {
  background: #fef3c7;
  color: #92400e;
}

.badge--days {
  background: #e0e7ff;
  color: #3730a3;
}

/* === Meta (price + city) === */

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.card-price {
  font-weight: 700;
  color: #111;
}

.card-meta-sep {
  color: #d1d5db;
}

.card-city {
  color: #6b7280;
}
