/* Horizon Auto Export — self-contained styles, RTL-aware, no external fonts required */

:root {
  --navy: #0b1c33;
  --navy-2: #12243f;
  --navy-3: #1a3358;
  --ink: #1c2430;
  --muted: #5c6778;
  --line: #e3e7ee;
  --bg: #f3f5f8;
  --paper: #ffffff;
  --gold: #c9a227;
  --gold-2: #e0b93a;
  --gold-ink: #3a2d08;
  --success: #1b7a4a;
  --success-bg: #e8f6ee;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --shadow: 0 10px 30px rgba(11, 28, 51, 0.08);
  --shadow-sm: 0 2px 10px rgba(11, 28, 51, 0.06);
  --radius: 14px;
  --header-h: 72px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans Arabic", "Geeza Pro", "Tahoma", "Noto Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 0.5em; }

.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 rgba(201, 162, 39, 0.7);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: -0.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.02rem; }
.brand-tag { font-size: 0.72rem; color: rgba(255,255,255,0.65); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 12px;
  flex: 1;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.82);
  font-size: 0.92rem;
}
.nav-links a:hover, .nav-links a.is-active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}
.tool {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 4px 8px 4px 10px;
  color: #fff;
}
.tool label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }
.tool select {
  background: transparent;
  color: #fff;
  border: 0;
  padding: 4px 2px;
  outline: none;
  max-width: 140px;
}
.tool select option { color: #111; background: #fff; }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 8px;
  width: 40px;
  height: 40px;
}

/* Banner */
.sample-banner {
  background: #fff6d9;
  color: #5c4300;
  font-size: 0.9rem;
  padding: 10px 0;
  border-bottom: 1px solid #ead38a;
}
.sample-banner .wrap { display: flex; gap: 10px; align-items: center; }

/* Hero */
.hero {
  background:
    radial-gradient(800px 280px at 80% 0%, rgba(201,162,39,0.18), transparent 50%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #0e2748 100%);
  color: #fff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border: 40px solid rgba(201,162,39,0.08);
  border-radius: 50%;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); max-width: 18ch; margin-bottom: 12px; }
.hero-sub { max-width: 46em; color: rgba(255,255,255,0.78); font-size: 1.05rem; margin-bottom: 28px; }
.hero-search {
  display: flex;
  gap: 8px;
  max-width: 640px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.hero-search input {
  flex: 1;
  border: 0;
  padding: 12px 14px;
  outline: none;
  color: var(--ink);
  background: transparent;
}
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.hero-stats div { min-width: 120px; }
.hero-stats strong {
  display: block;
  font-size: 1.6rem;
  color: var(--gold-2);
  letter-spacing: -0.03em;
}
.hero-stats span { font-size: 0.85rem; color: rgba(255,255,255,0.65); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  line-height: 1.2;
  transition: 0.15s ease;
  text-align: center;
}
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--gold-2); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}
.btn-light {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-light:hover { border-color: var(--navy); }
.btn-whatsapp { background: #128c7e; color: #fff; }
.btn-whatsapp:hover { background: #0e7a6e; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-wide { width: 100%; }
.btn-sm { padding: 7px 11px; font-size: 0.85rem; font-weight: 600; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Layout: inventory */
.inventory {
  padding: 36px 0 64px;
}
.inventory-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}
.filters {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.filters h2 { font-size: 1rem; margin-bottom: 14px; }
.filter-group { margin-bottom: 14px; }
.filter-group label, .field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.filter-group select,
.filter-group input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.filter-group input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-group select:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(18, 36, 63, 0.12);
}
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .note { color: var(--muted); font-size: 0.88rem; }
.sort-box { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.sort-box select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
}

.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.car-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.car-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #d5dde6;
  overflow: hidden;
}
.card-media svg { width: 100%; height: 100%; display: block; }
.badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}
.badge.gold { background: var(--gold); color: var(--gold-ink); }
.badge.muted { background: rgba(255,255,255,0.9); color: var(--ink); }
.badge.sold { background: #555; }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { font-size: 0.75rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 1.02rem; margin: 0; }
.card-loc { font-size: 0.82rem; color: var(--muted); }
.card-price { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.03em; color: var(--navy); margin-top: auto; }
.card-price small { display: block; font-size: 0.75rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card-actions { display: flex; gap: 8px; margin-top: 6px; }
.card-actions .btn { flex: 1; }

.empty-state {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

/* Process */
.process { padding: 10px 0 70px; }
.process h2 { margin-bottom: 22px; }
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.step {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
}
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--gold-2);
  display: grid; place-items: center; font-weight: 700; margin-bottom: 10px;
  font-size: 0.9rem;
}
.step h3 { font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Detail */
.page-block { padding: 28px 0 64px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.92rem; margin-bottom: 16px; }
.back-link:hover { color: var(--navy); }
.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 28px;
  align-items: start;
}
.gallery-main {
  background: #d5dde6;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
}
.gallery-main svg { width: 100%; height: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.thumbs button {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #d5dde6;
  aspect-ratio: 16 / 10;
}
.thumbs button.is-active, .thumbs button:hover { border-color: var(--gold); }
.thumbs svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.photo-note { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

.specs {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 20px;
}
.specs th, .specs td { text-align: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.specs th { color: var(--muted); font-weight: 600; width: 42%; }

.quote-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.quote-card .price { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.03em; }
.quote-card .price-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }
.contact-row { display: grid; gap: 8px; margin: 10px 0 16px; }

.form .field { margin-bottom: 12px; }
.form textarea { min-height: 90px; resize: vertical; }
.form-error { color: var(--danger); font-size: 0.88rem; margin-bottom: 8px; display: none; }
.form-error.show { display: block; }
.success-box {
  display: none;
  background: var(--success-bg);
  color: #145c38;
  border-radius: 12px;
  padding: 16px;
}
.success-box.show { display: block; }
.success-box h3 { margin-bottom: 6px; }
.form.is-done .form-fields { display: none; }

/* Wanted */
.wanted-hero { padding: 36px 0 10px; }
.wanted-hero h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.wanted-hero p { color: var(--muted); max-width: 46em; }
.wanted-form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* Admin */
.admin-head { padding: 28px 0 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  color: var(--muted);
}
.tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.panel { display: none; }
.panel.is-active { display: block; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th, table.data td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  vertical-align: top;
}
table.data th { background: #f7f8fb; font-weight: 650; color: var(--muted); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.toolbar-admin { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.toast {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 16px;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
  z-index: 80;
}
.toast.show { display: block; }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 35, 0.5);
  display: none;
  z-index: 60;
  padding: 24px 12px;
  overflow: auto;
}
.modal-back.show { display: block; }
.modal {
  background: #fff;
  width: min(720px, 100%);
  margin: 24px auto;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h2 { margin-bottom: 8px; }

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 24px;
}
.site-footer h3 { color: #fff; font-size: 0.95rem; }
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: var(--gold-2); }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.legal { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; font-size: 0.8rem; color: rgba(255,255,255,0.55); }

.filters-toggle { display: none; margin-bottom: 12px; }

/* RTL tweaks */
[dir="rtl"] body { text-align: start; }
[dir="rtl"] .hero h1 { max-width: 20ch; }

/* Mobile */
@media (max-width: 900px) {
  .inventory-grid, .detail-grid, .process-grid, .footer-grid { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; margin-bottom: 16px; }
  .filters-toggle { display: inline-flex; }
  .quote-card { position: static; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    inset-inline: 0;
    background: var(--navy-2);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    margin: 0;
  }
  .nav-links.open { display: flex; }
  .header-tools { gap: 6px; }
  .tool label { display: none; }
  .tool select { max-width: 110px; font-size: 0.85rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .hero { padding: 36px 0 44px; }
}
@media (max-width: 560px) {
  .hero-search { flex-direction: column; }
  .card-actions { flex-direction: column; }
  .thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}


/* SPA views */
.view { display: none; }
.view.is-active { display: block; }
