/* ============================================================
   DESIGN TOKENS — "FriendlyPrice"
   Palette pulled from the brand reference: deep navy + warm gold
   on a clean white/cream base.
   ============================================================ */
:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --line: #e3e0d7;
  --text: #0b2447;
  --muted: #5c6472;

  --navy: #0b2447;
  --navy-deep: #071a35;
  --navy-light: #16345f;

  --gold: #d4a13c;
  --gold-deep: #b3832a;
  --gold-light: #f6e9c9;

  --mint: #1fa787;
  --mint-soft: #dcf3ec;
  --danger: #d9534f;
  --danger-soft: #fbe4e1;

  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(11, 36, 71, 0.08);
  --shadow-hover: 0 20px 40px rgba(11, 36, 71, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--gold);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand img { height: 68px; width: auto; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
  letter-spacing: -0.3px;
}
.brand-text .accent { color: var(--gold-deep); }
.header-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  margin-left: 24px;
  font-weight: 500;
  transition: color .15s ease;
}
.header-links a:hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 44px;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 20px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5.5vw, 58px);
  line-height: 1.06;
  margin: 0 0 18px;
  letter-spacing: -1px;
  color: var(--navy);
}
.hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 520px;
  margin: 0 0 28px;
  line-height: 1.6;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 28px;
}
.filter-bar input,
.filter-bar select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  min-width: 150px;
  box-shadow: 0 1px 2px rgba(11,36,71,0.03);
}
.filter-bar input::placeholder { color: var(--muted); }
.filter-bar input:focus,
.filter-bar select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ---------- Car grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 12px 0 90px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.card-media {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}

/* gold price tag — signature element, echoes the brand reference */
.price-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--gold);
  color: var(--navy-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(212, 161, 60, 0.45);
}
.sold-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.2px;
  color: var(--navy);
}
.card-sub { color: var(--muted); font-size: 13px; margin: -8px 0 0; }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.spec-strip div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
}
.spec-strip .val {
  font-weight: 600;
  color: var(--navy);
  font-size: 13px;
  display: block;
}
.spec-strip .lbl {
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.card-cta {
  display: inline-block;
  text-align: center;
  background: var(--navy);
  border: none;
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  margin-top: auto;
}
.card-cta:hover { background: var(--gold-deep); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Modal (car detail) ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(7, 26, 53, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: sticky; top: 0; float: right;
  background: var(--surface); border: none; color: var(--muted);
  font-size: 24px; cursor: pointer; padding: 14px 18px;
  border-radius: 0 20px 0 16px;
}
.modal-close:hover { color: var(--navy); }
.modal-body { padding: 0 28px 32px; }

/* ---------- Admin ---------- */
.admin-shell { padding: 40px 0 100px; }
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 28px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 20px;
  letter-spacing: -0.3px;
  color: var(--navy);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--navy-light); }
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn.secondary:hover { background: var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #cf4237; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.gold { background: var(--gold); color: var(--navy-deep); }
.btn.gold:hover { background: var(--gold-deep); color: #fff; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table img.thumb {
  width: 56px; height: 42px; object-fit: cover; border-radius: 8px;
}
.row-actions button { margin-right: 6px; }

.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .brand { justify-content: center; margin-bottom: 20px; }
.login-card .brand img { height: 56px; }
.login-card .panel-inner { text-align: left; }

.msg {
  font-size: 13px;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.success { background: var(--mint-soft); color: var(--mint); }

.upload-drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.upload-drop:hover { border-color: var(--gold); background: var(--gold-light); }
.upload-preview {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.upload-preview img {
  width: 64px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}

.site-footer {
  background: var(--navy-deep);
  border-top: 3px solid var(--gold);
  padding: 28px 0;
  color: #cdd6e3;
  font-size: 13px;
}
.site-footer .accent { color: var(--gold); font-weight: 600; }
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-bottom: 14px;
}
.footer-top .footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
}
.footer-links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.footer-links-inline a {
  color: #b7c1d1;
  text-decoration: none;
  transition: color .15s ease;
}
.footer-links-inline a:hover { color: var(--gold); }
.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 14px;
  font-size: 12.5px;
  color: #8a94a6;
}

/* ---------- Simple content pages (Contact / Privacy) ---------- */
.page-hero {
  padding: 56px 0 32px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 44px);
  color: var(--navy);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.page-hero p { color: var(--muted); font-size: 16px; max-width: 560px; line-height: 1.6; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 80px;
}
@media (max-width: 800px) { .content-grid { grid-template-columns: 1fr; } }

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.info-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--navy);
  margin: 0 0 6px;
}
.info-card p { color: var(--muted); margin: 0; line-height: 1.6; }
.info-card a.link-btn {
  display: inline-block;
  margin-top: 14px;
  color: var(--gold-deep);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.info-card a.link-btn:hover { color: var(--navy); }
.info-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--gold-deep);
}

.legal-copy {
  max-width: 760px;
  padding-bottom: 90px;
  color: var(--text);
  line-height: 1.75;
}
.legal-copy h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--navy);
  margin: 32px 0 10px;
}
.legal-copy h2:first-child { margin-top: 0; }
.legal-copy p, .legal-copy li { color: var(--muted); font-size: 15px; }
.legal-copy ul { padding-left: 20px; }
.legal-copy .updated {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 32px;
}
