.cars-page { padding: 40px 0 80px; min-height: calc(100vh - 200px); }

.cars-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}
.cars-header h1 { font-size: 2rem; color: var(--yellow); margin: 0; }
.cars-count { color: var(--text-muted); font-size: 0.9rem; }

/* Фильтры */
.cars-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.search-input {
  background: #1A1A1A;
  border: 1px solid #3A3A3A;
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--yellow); }

.class-filters { display: flex; gap: 6px; }
.class-btn {
  background: #1A1A1A;
  border: 1px solid #3A3A3A;
  color: #aaa;
  padding: 7px 13px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s;
}
.class-btn:hover { border-color: #666; color: #fff; }
.class-btn.active { background: var(--yellow); border-color: var(--yellow); color: #000; }

.select-wrapper {
  position: relative;
  display: inline-block;
}
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 0.8rem;
  pointer-events: none;
}
.manufacturer-select {
  background: #1A1A1A;
  border: 1px solid #3A3A3A;
  color: #fff;
  padding: 9px 36px 9px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.manufacturer-select:focus { border-color: var(--yellow); }

/* Таблица машин */
.cars-list-wrap {
  border: 1px solid #2A2A2A;
  border-radius: 12px;
  overflow: hidden;
}
.cars-table {
  width: 100%;
  border-collapse: collapse;
}
.cars-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.cars-table thead th.sortable:hover { color: #aaa; }
.cars-table thead th.sort-active { color: var(--yellow); }
.sort-icon { font-size: 0.6rem; }

.cars-table thead th {
  background: #161616;
  color: #555;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #2A2A2A;
  white-space: nowrap;
}
.cars-table tbody tr {
  border-bottom: 1px solid #1E1E1E;
  cursor: pointer;
  transition: background 0.12s;
  height: 58px;
  max-height: 58px;
}
.cars-table tbody tr:last-child { border-bottom: none; }
.cars-table tbody tr:hover { background: #1F1F1F; }
.cars-table td {
  padding: 6px 16px;
  vertical-align: middle;
  overflow: hidden;
}

/* Thumb */
.ct-thumb { width: 80px; padding: 4px 8px 4px 12px; }
.ct-thumb img {
  width: 80px; height: 50px;
  object-fit: cover;
  border-radius: 5px;
  background: #111;
  display: block;
  flex-shrink: 0;
}
.ct-thumb-placeholder {
  width: 80px; height: 50px;
  border-radius: 5px;
  background: #111;
}

/* Производитель + модель */
.ct-name-mfr {
  font-size: 0.68rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 3px;
}
.ct-name-model {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e8e8e8;
}

/* Классовый бейдж */
.car-class-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 24px;
  border-radius: 5px;
  font-weight: 900;
  font-size: 0.78rem;
}
.class-D  { background: #4A90E2; color: #fff; }
.class-C  { background: #27AE60; color: #fff; }
.class-B  { background: #F39C12; color: #fff; }
.class-A  { background: #E74C3C; color: #fff; }
.class-S1 { background: #9B59B6; color: #fff; }
.class-S2 { background: #FF2D7A; color: #fff; }
.class-X  { background: #1ABC9C; color: #fff; }
.class-R  { background: #FFE234; color: #000; }

/* PI */
.ct-pi { font-size: 0.85rem; color: #aaa; font-variant-numeric: tabular-nums; }

/* Год */
.ct-year { font-size: 0.85rem; color: #888; }

/* Страна */
.ct-country { font-size: 0.82rem; color: #888; white-space: nowrap; }

/* Цена */
.ct-price { font-size: 0.82rem; color: #aaa; white-space: nowrap; }

/* Статы */
.ct-stat-cell { text-align: center; }
.ct-stat { font-size: 0.82rem; color: #aaa; font-variant-numeric: tabular-nums; }
.ct-stat-empty { font-size: 0.75rem; color: #333; }

/* Где получить */
.ct-where { font-size: 0.8rem; color: #666; max-width: 220px; }

/* Теги */
.ct-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; align-content: center; }
.car-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.car-tag.has-tune {
  background: rgba(255,226,52,0.1);
  color: var(--yellow);
  border: 1px solid rgba(255,226,52,0.25);
}
.car-tag.dlc {
  background: rgba(155,89,182,0.1);
  color: #c39bd3;
  border: 1px solid rgba(155,89,182,0.25);
}

.cars-loading { color: var(--text-muted); padding: 40px; text-align: center; }
.cars-empty { color: var(--text-muted); padding: 60px; text-align: center; font-size: 1.1rem; }

/* Кнопка сравнения в строке */
.ct-compare-cell { text-align: center; width: 36px; }
.ct-compare-btn {
  background: none; border: 1px solid #333; color: #555;
  width: 24px; height: 24px; border-radius: 5px;
  cursor: pointer; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s; margin-left: 4px; vertical-align: middle;
}
.ct-compare-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.ct-compare-btn.active { background: var(--yellow); border-color: var(--yellow); color: #000; }

/* Характеристики в модалке — сетка 3×2 */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
  margin-top: 8px;
}
.modal-stat-item {
  display: flex; flex-direction: column; gap: 4px;
}
.modal-stat-label { font-size: 0.68rem; color: #666; text-transform: uppercase; letter-spacing: 0.06em; }
.modal-stat-bar-wrap { height: 5px; background: #2A2A2A; border-radius: 3px; overflow: hidden; }
.modal-stat-bar { height: 100%; background: var(--yellow); border-radius: 3px; }
.modal-stat-val { font-size: 0.88rem; font-weight: 700; color: #e0e0e0; }

/* Цена/страна/редкость в модалке */
.car-modal-meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-meta-country { font-size: 0.78rem; color: #888; }
.modal-meta-price { font-size: 0.78rem; color: var(--yellow); background: rgba(255,226,52,0.08); border: 1px solid rgba(255,226,52,0.2); padding: 2px 10px; border-radius: 20px; }
.modal-meta-rarity { font-size: 0.72rem; color: #888; background: #222; border: 1px solid #333; padding: 2px 10px; border-radius: 20px; }

/* Панель сравнения (снизу) */
.compare-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #111; border-top: 1px solid #2A2A2A;
  padding: 12px 24px; z-index: 800;
  display: flex; align-items: center; gap: 20px;
}
.compare-bar-title { font-size: 0.82rem; color: #666; white-space: nowrap; }
.compare-bar-cars { display: flex; gap: 12px; flex: 1; }
.cbar-car {
  display: flex; align-items: center; gap: 8px;
  background: #1A1A1A; border: 1px solid #2A2A2A;
  border-radius: 8px; padding: 6px 10px;
  cursor: pointer; transition: border-color 0.15s; position: relative;
  min-width: 160px;
}
.cbar-car:hover { border-color: #E74C3C; }
.cbar-thumb { width: 52px; height: 32px; flex-shrink: 0; }
.cbar-thumb img { width: 52px; height: 32px; object-fit: cover; border-radius: 4px; }
.cbar-no-img { width: 52px; height: 32px; background: #222; border-radius: 4px; }
.cbar-name { font-size: 0.75rem; color: #ccc; flex: 1; }
.cbar-remove { font-size: 10px; color: #555; }
.cbar-car:hover .cbar-remove { color: #E74C3C; }
.compare-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-compare {
  background: var(--yellow); color: #000; border: none;
  padding: 8px 20px; border-radius: 8px; font-size: 0.85rem;
  font-weight: 700; cursor: pointer;
}
.btn-compare:disabled { opacity: 0.35; cursor: default; }
.btn-compare-clear {
  background: none; border: 1px solid #333; color: #666;
  padding: 8px 14px; border-radius: 8px; font-size: 0.82rem;
  cursor: pointer;
}
.btn-compare-clear:hover { border-color: #555; color: #aaa; }

/* Модалка сравнения */
.compare-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.compare-modal {
  background: #161616; border: 1px solid #2A2A2A;
  border-radius: 16px; width: 100%; max-width: 900px;
  max-height: 90vh; overflow-y: auto; padding: 28px;
  position: relative;
}
.compare-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: #2A2A2A; border: none; color: #aaa;
  width: 30px; height: 30px; border-radius: 6px;
  cursor: pointer; font-size: 14px;
}
.compare-modal-close:hover { color: #fff; }
.compare-modal-title { font-size: 1.1rem; color: var(--yellow); margin: 0 0 20px; }

/* Карточки в сравнении */
.cmp-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.cmp-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.cmp-img { width: 100%; height: 140px; object-fit: contain; border-radius: 8px; background: #111; padding: 8px; }
.cmp-img-empty { width: 100%; height: 140px; background: #111; border-radius: 8px; }

.cmp-col .car-class-badge {
  width: auto;
  min-width: 48px;
  padding: 0 8px;
  height: 28px;
  font-size: 0.9rem;
}
.cmp-mfr { font-size: 0.68rem; color: #555; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 8px; }
.cmp-model { font-size: 0.95rem; font-weight: 700; color: #fff; }
.cmp-year { font-size: 0.78rem; color: #666; }
.cmp-meta-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: center; margin-top: 3px; }
.cmp-sep { color: #444; font-size: 0.75rem; }
.cmp-year { font-size: 0.78rem; color: #666; }
.cmp-country { font-size: 0.78rem; color: #666; }
.cmp-price { font-size: 0.78rem; color: var(--yellow); }
.cmp-class-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cmp-pi { font-size: 1rem; font-weight: 700; color: #ccc; }

/* Строки статов в сравнении */
.cmp-stats { display: flex; flex-direction: column; gap: 12px; }
.cmp-stat-row { display: flex; align-items: center; gap: 16px; }
.cmp-stat-label { width: 90px; flex-shrink: 0; font-size: 0.78rem; color: #666; }
.cmp-stat-cols { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.cmp-stat-cell { display: flex; align-items: center; gap: 8px; }
.cmp-stat-bar-wrap { flex: 1; height: 6px; background: #2A2A2A; border-radius: 3px; overflow: hidden; }
.cmp-stat-bar { height: 100%; background: #444; border-radius: 3px; }
.cmp-stat-cell.best .cmp-stat-bar { background: var(--yellow); }
.cmp-stat-cell.best .cmp-stat-val { color: var(--yellow); font-weight: 700; }
.cmp-stat-val { font-size: 0.8rem; color: #888; width: 24px; text-align: right; flex-shrink: 0; }

/* Фото в модалке */
.car-modal-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #111;
}
.car-modal-image img { width: 100%; height: 100%; object-fit: cover; }

/* Модалка */
.car-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.car-modal {
  background: #1A1A1A;
  border: 1px solid #3A3A3A;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  position: relative;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
}
.car-modal-stripe {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  border-radius: 14px 0 0 14px;
}
.car-modal-content {
  flex: 1;
  padding: 24px 24px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.car-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: #2A2A2A;
  border: none;
  color: #aaa;
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.car-modal-close:hover { color: #fff; background: #3A3A3A; }

.car-modal-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; padding-right: 32px; }
.car-modal-manufacturer { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.car-modal-name { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 0; }
.car-modal-year { font-size: 0.82rem; color: #666; margin-top: 2px; }

.car-modal-body { display: flex; flex-direction: column; gap: 14px; }
.car-modal-label { font-size: 0.65rem; color: #444; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.car-modal-value { font-size: 0.9rem; color: #ccc; }

.car-modal-code-block {
  background: #232323;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.car-modal-code-value { font-family: monospace; font-size: 0.95rem; color: var(--yellow); letter-spacing: 0.06em; }

.tunes-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tune-item { background: #232323; border-radius: 8px; padding: 10px 14px; }
.tune-class-label { font-size: 0.65rem; color: #555; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.tune-code { font-family: monospace; font-size: 0.95rem; color: var(--yellow); letter-spacing: 0.06em; }
