:root {
  --bg: #f8f9fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header, .site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-footer { border-top: 1px solid var(--border); border-bottom: none; }

.footer-links {
  margin-left: auto;
  display: flex;
  gap: 12px;
  font-size: 13px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
}
.brand:hover,
.brand:focus {
  color: var(--text);
  text-decoration: none;
}

nav a {
  margin-left: 12px;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
}
nav a:hover { color: var(--accent); text-decoration: none; }
nav a.active { color: var(--accent); text-decoration: none; }
nav a.access-email:hover { text-decoration: none; }

.access-email {
  color: var(--text);
  text-decoration: none;
}
.access-email:hover {
  color: var(--accent);
  text-decoration: none;
}

nav { display: flex; align-items: center; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

main { padding: 24px; max-width: 1100px; margin: 0 auto; width: 100%; flex: 1; }

.hero { background: linear-gradient(135deg, #e0f2fe, #f8fafc); padding: 32px; border-radius: 16px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-size: 12px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.filter-row { background: #fff; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.filter-row label { display: block; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.cars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) {
  .cars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cars { grid-template-columns: 1fr; }
}
.car-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 8px 18px rgba(0,0,0,0.04); }
.car-card .image { height: 180px; background: #e5e7eb; }
.car-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-card .meta { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.title-row { display: flex; justify-content: space-between; align-items: center; }
.title { font-weight: 700; }
.badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; text-transform: capitalize; }
.badge.available { background: #dcfce7; color: #166534; }
.badge.sold { background: #fee2e2; color: #b91c1c; }
.specs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.specs li { background: #f1f5f9; padding: 4px 8px; border-radius: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn, .actions .btn, .actions .btn.ghost {
  padding: 10px 12px;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  text-align: center;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); }

.subscribe { margin-top: 32px; background: #fff; padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.subscribe form { display: flex; gap: 8px; flex-wrap: wrap; }
.subscribe input { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
.subscribe button { padding: 10px 16px; border: none; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.muted { color: var(--muted); }

.car-detail { background: #fff; padding: 20px; border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; gap: 16px; }
.detail-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }
.price { font-size: 24px; font-weight: 700; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.gallery img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.spec-grid div { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.spec-grid span { display: block; color: var(--muted); font-size: 12px; }
.description { white-space: pre-wrap; }

.panel { background: #fff; padding: 16px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.panel form { display: grid; gap: 10px; }
.panel input, .panel textarea, .panel select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }

@media (max-width: 640px) {
  main { padding: 16px; }
  .site-header { flex-wrap: wrap; gap: 8px; align-items: center; }
  .site-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  nav {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    padding: 12px 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    z-index: 10;
  }
  nav[data-open='true'] { display: flex; }
  nav a {
    margin-left: 0;
    padding: 12px 16px;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  nav a:last-child { border-bottom: none; }
}
