
:root {
  --bg: #f3f5fb;
  --bg-glow: rgba(124, 92, 255, 0.10);
  --surface: #ffffff;
  --surface-soft: #f6f7fb;
  --text: #111827;
  --text-muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 6px 22px rgba(30, 41, 90, 0.08);
  --shadow-soft: 0 2px 8px rgba(30, 41, 90, 0.07);
  --accent-bg: #e6edff;
  --accent-text: #1e3a8a;
  --accent-border: rgba(59, 91, 219, 0.28);
  --pill-bg: #f3f4f8;
  --pill-border: rgba(15, 23, 42, 0.07);
  --mark: #fde68a;
}

:root[data-theme="dark"] {
  --bg: #0a0f1f;
  --bg-glow: rgba(60, 80, 200, 0.16);
  --surface: #172033;
  --surface-soft: #0f1628;
  --text: #f1f4fb;
  --text-muted: #a3adc2;
  --border: rgba(255, 255, 255, 0.07);
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.45);
  --accent-bg: rgba(59, 100, 230, 0.20);
  --accent-text: #6c9bff;
  --accent-border: rgba(90, 130, 255, 0.38);
  --pill-bg: #252e44;
  --pill-border: rgba(255, 255, 255, 0.06);
  --mark: #92710a;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(900px 600px at 95% 55%, rgba(40, 60, 170, 0.18), transparent 65%),
    linear-gradient(180deg, #0f1730 0%, #0a0f1f 35%, #080c19 100%);
  background-attachment: fixed;
}
:root[data-theme="dark"] .car-image-wrapper {
  background: radial-gradient(circle at 50% 40%, #131c33, #0b1122);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
:root[data-theme="dark"] .price-usd { background: #0c1222; border-color: rgba(255, 255, 255, 0.05); color: #fff; }
:root[data-theme="dark"] .search-input,
:root[data-theme="dark"] .theme-toggle { background-color: #172033; }
:root[data-theme="dark"] .app-btn--secondary { color: var(--accent-text); background: #172033; border-color: rgba(255, 255, 255, 0.07); }
:root[data-theme="dark"] .pagination { background: rgba(23,32,51,.6); }
:root[data-theme="dark"] .pagination button { background: #0c1222; color: #fff; }
:root[data-theme="dark"] .pagination button:disabled { color: var(--text-muted); }
:root[data-theme="dark"] .bodykit-item h3 { color: var(--text); }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  padding: 22px 20px 40px;
  background:
    radial-gradient(900px 500px at 85% -5%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

#root {
  max-width: 1060px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-radius: 30px;
  height: 68px;
  padding: 0 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.logo-block { display: flex; align-items: center; gap: 10px; }
.logo { height: 24px; width: auto; display: block; }
.logo-text h1 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

.header-right { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 14px;
  display: grid; place-items: center;
  padding: 0;
}

.app-btn {
  display: inline-flex; align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  text-decoration: none;
  color: var(--accent-text);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  transition: background .15s, transform .15s;
}
.app-btn:hover { transform: translateY(-1px); }
.app-btn--secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

/* ---------- Search ---------- */
.search-container {
  display: flex;
  justify-content: center;
  margin: 17px 0 14px;
}
.search-wrapper {
  position: relative;
  width: 75%;
  max-width: 800px;
}
.search-input {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") no-repeat 16px center;
  box-shadow: var(--shadow-soft);
  padding: 0 38px 0 41px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-bg); }

.search-clear {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: var(--pill-bg); color: var(--text-muted);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
}

.search-suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 20;
}
.search-suggestion-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13px; cursor: pointer;
}
.search-suggestion-item:hover { background: var(--surface-soft); }
.suggestion-sub { color: var(--text-muted); font-size: 11px; }

mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Cards ---------- */
.autosalon-container { display: flex; flex-direction: column; gap: 12px; }
.autosalon-container.single-result { max-width: 100%; }

.car-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 115px;
  padding: 13px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.car-image-wrapper {
  flex: 0 0 175px; width: 175px; height: 88px;
  border-radius: 14px;
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-soft);
  display: grid; place-items: center;
  overflow: hidden;
}
.car-image-wrapper img { width: 100%; height: 100%; object-fit: contain; display: block; }

.car-card-content { flex: 1; min-width: 0; }
.model { margin: 0 0 8px; font-size: 14px; line-height: 1.35; }
.model b { font-weight: 700; font-size: 14px; letter-spacing: -0.005em; }
.model-code { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-item {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap;
}
.bodykit-pill { cursor: pointer; transition: background .15s; }
.bodykit-pill:hover { background: var(--accent-bg); }

.price-panel {
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  align-self: stretch; justify-content: center;
}
.price-usd {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 13px; font-weight: 700;
}
.copy-btn {
  font-family: inherit;
  font-size: 10px; font-weight: 500;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.copy-btn:hover { background: var(--accent-bg); color: var(--accent-text); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: fit-content;
  margin: 22px auto 0;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.pagination span { font-size: 12px; font-weight: 600; }
.pagination button {
  font-family: inherit;
  font-size: 12px; font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.pagination button:disabled { background: transparent; border-color: transparent; color: var(--text-muted); opacity: .7; cursor: default; font-weight: 500; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  background: #111827; color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow);
  z-index: 100;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 60px 20px;
  background: var(--surface); border-radius: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.empty-state p { margin: 0 0 6px; font-weight: 700; font-size: 16px; }
.empty-state span { color: var(--text-muted); font-size: 13px; }

/* ---------- Skeleton ---------- */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton-image,
.skeleton-line {
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--pill-bg) 37%, var(--surface-soft) 63%);
  background-size: 800px 100%;
  animation: shimmer 1.3s infinite linear;
}
.skeleton-line { height: 10px; border-radius: 6px; margin-bottom: 10px; }
.skeleton-line-lg { width: 40%; height: 14px; }
.skeleton-line-sm { width: 60%; }
.skeleton-line-price { width: 90px; height: 26px; border-radius: 999px; }
.skeleton-line-btn { width: 70px; height: 20px; border-radius: 8px; margin-bottom: 0; }

/* ---------- Bodykit modal ---------- */
.bodykit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid; place-items: center;
  z-index: 200; padding: 20px;
}
.bodykit-modal {
  position: relative;
  width: 900px; max-width: calc(100vw - 40px);
  max-height: 500px; overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  padding: 24px 24px 22px;
  box-shadow: var(--shadow);
}
.bodykit-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center; padding: 0;
  border: none; border-radius: 8px;
  background: var(--surface-soft); color: var(--text);
  cursor: pointer; z-index: 2;
}
.bodykit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; padding-top: 6px; }
.bodykit-grid.single { grid-template-columns: 1fr; }
.bodykit-item { text-align: center; min-width: 0; }
.bodykit-item h3 { margin: 0 0 4px; padding: 0 36px; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--text); }
.bodykit-item img { display: block; width: 100%; height: auto; max-height: 250px; object-fit: contain; margin: 0 auto; }
.bodykit-grid.single .bodykit-item img { max-width: 540px; }
.bodykit-missing { margin: 10px auto 0; max-width: 360px; padding: 46px 12px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted); font-size: 12px; background: var(--surface-soft); }
@media (max-width: 720px) {
  .bodykit-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  body { padding: 14px 12px 32px; }
  .header { height: auto; padding: 12px 14px; flex-wrap: wrap; gap: 10px; border-radius: 24px; }
  .search-wrapper { width: 100%; }
  .car-card { flex-wrap: wrap; }
  .car-image-wrapper { flex: 0 0 100%; width: 100%; height: 120px; }
  .car-card-content { flex: 1 1 100%; }
  .price-panel { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

