 :root {
  --accent: #2563eb;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

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

body {
  font-size: 16px;
  font-family: 'Space Grotesk', 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  height: 44px;
  padding: 8px;
  border-radius: 10px;
  background: #eef2ff;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 700;
  border: 1px solid var(--border);
}

.brand__logo img {
  max-height: 44px;
  object-fit: contain;
}

.brand__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.95rem;
}

.brand__meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  font-weight: 600;
}

.nav a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  background: #e8edfb;
  color: #0f172a;
}

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

.layout__main {
  flex: 1;
  padding: 28px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.layout__footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  background: #fff;
}

.footer__contacts {
  display: flex;
  gap: 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
  min-height: 320px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

.hero__content {
  position: relative;
  padding: 36px;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef2ff;
  font-size: 0.85rem;
  color: #1f2937;
  border: 1px solid #e2e8f0;
}

.pill.alt {
  background: #e0ecff;
  color: #1d4ed8;
  border-color: #d4ddf5;
}

.subtitle {
  color: var(--muted);
  line-height: 1.5;
}

.hero__actions, .section__header, .car-card__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero__meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__meta .label {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
}

.section {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section__header h2, h1, h3 {
  letter-spacing: -0.01em;
}

.page-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.car-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: var(--shadow);
  max-width: 400px;
}

.car-card--link {
  text-decoration: none;
  color: inherit;
}

.car-card__media {
  position: relative;
  display: block;
  background: #f1f5f9;
}

.car-card__media img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.car-card__content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.8rem;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.label {
  color: var(--muted);
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.btn.ghost {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.btn.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.btn.tiny {
  padding: 8px 11px;
  font-size: 0.9rem;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.car-card__footer {
  align-items: flex-end;
  gap: 32px;
}

.car-hero {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 18px;
  background: var(--card);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.car-hero__media img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 14px;
}

.car-hero__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.detail-card {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  background: var(--card);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.store-card {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: fit-content;
}

.store-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-card__header img {
  max-height: 34px;
}

.store-card__actions {
  display: flex;
  gap: 8px;
}

.photo-viewer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-main {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.photo-main img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.photo-thumb {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.photo-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-thumb:hover {
  transform: translateY(-1px);
}

.photo-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
}

.photo-uploader {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-uploader__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.photo-uploader__actions {
  display: flex;
  gap: 10px;
}

.photo-list,
.photo-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-placeholder {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  color: var(--muted);
  background: #f8fafc;
  text-align: center;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(160px, 200px) 1fr;
  gap: 12px;
  padding: 12px;
  align-items: center;
}

.photo-card__image {
  position: relative;
  background: #f1f5f9;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
}

.photo-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
}

.photo-card__actions {
  display: flex;
  gap: 8px;
  padding: 0;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.photo-card__content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-upload-list,
.photo-existing-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 720px) {
  .photo-card {
    grid-template-columns: 1fr;
  }
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  margin-bottom: 12px;
}

.alert.warning {
  border-color: #facc15;
  background: #fffae5;
  color: #92400e;
}

.empty {
  border: 1px dashed var(--border);
  padding: 16px;
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.link {
  color: #1d4ed8;
}

input, select, textarea {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-stack input,
.form-stack select,
.form-stack textarea {
  max-width: 400px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: var(--shadow);
}

.table th, .table td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}

.table th {
  background: #f8fafc;
  color: var(--muted);
}

.bold {
  font-weight: bold;
}

@media (max-width: 960px) {
  .layout__main {
    padding: 18px;
  }

  .layout__header {
    /* flex-direction: column; */
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .car-hero, .detail-card {
    grid-template-columns: 1fr;
  }

  .layout__footer {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .footer__contacts {
    flex-direction: column;
    gap: 0;
  }
}
