/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0a0a0a;
  --primary: #007aff;
  --dark:    #111827;
  --mid:     #6b7280;
  --light:   #f3f4f6;
  --white:   #ffffff;
  --accent:  #e02020;
  --radius:  12px;
  --shadow:  0 4px 24px rgba(0,0,0,.08);
  --shadow-hover: 0 8px 40px rgba(0,0,0,.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8f9fa;
  color: var(--dark);
  min-height: 100vh;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 48px;
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  text-decoration: none;
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .15s;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,.15);
}

.nav-cta {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.nav-cta:hover { opacity: .88; }

/* ── Pages ────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  color: var(--white);
  padding: 96px 28px 80px;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.50);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-tag {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: 20px;
}

.hero-accent {
  color: #e53935;
}

.hero-sub {
  font-size: 18px;
  color: #d1d5db;
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn {
  background: var(--white);
  color: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
  text-decoration: none;
  display: inline-block;
}
.hero-btn:hover { opacity: .88; }

.hero-btn.outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,.5);
}
.hero-btn.outline:hover { border-color: var(--white); opacity: 1; background: rgba(255,255,255,.1); }

/* ── Inventory Section ────────────────────────────────────────────── */
.inventory-section {
  padding: 40px 28px 80px;
}

.inventory-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Filters ──────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.filter-group { flex: 1; min-width: 160px; }

.filter-input,
.filter-select {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--dark);
  transition: border-color .15s;
  appearance: none;
}
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--black);
}

.filter-reset {
  align-self: center;
  background: var(--light);
  color: var(--dark);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.filter-reset:hover { background: #e5e7eb; }

/* ── Results Bar ──────────────────────────────────────────────────── */
.results-bar {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ── Car Grid ─────────────────────────────────────────────────────── */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Car Card ─────────────────────────────────────────────────────── */
.car-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.car-card-img-wrap {
  position: relative;
  display: block;
}

.card-photo-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: .02em;
  pointer-events: none;
}

.card-source-tag {
  position: absolute;
  bottom: 8px;
  right: 10px;
  color: rgba(0,0,0,.2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  pointer-events: none;
  user-select: none;
}

.car-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--light);
  display: block;
}

.card-carfax-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  padding: 3px 8px;
  text-decoration: none;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: box-shadow .15s;
  vertical-align: middle;
}
.card-carfax-badge:hover { box-shadow: 0 3px 8px rgba(0,0,0,.18); }

.cfx-logo {
  font-size: 11px;
  font-weight: 900;
  color: #111;
  letter-spacing: .04em;
  font-family: 'Inter', sans-serif;
}
.cfx-leaf { color: #c0392b; margin-left: 1px; }

.cfx-view {
  font-size: 8px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.car-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
}

.car-card-body {
  padding: 16px;
  position: relative;
}

.car-card-year {
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.car-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.car-card-trim {
  font-size: 13px;
  color: var(--mid);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 12px;
  letter-spacing: -.02em;
}

.car-card-price.call { font-size: 16px; color: var(--mid); }

.car-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-pill {
  background: var(--light);
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ── Loading / Empty ──────────────────────────────────────────────── */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--mid);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 16px;
  max-width: 740px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--light);
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
  transition: background .15s;
}
.modal-close:hover { background: #e5e7eb; }

.modal-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
}

.modal-body {
  padding: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}

.modal-trim {
  font-size: 15px;
  color: var(--mid);
  margin-bottom: 16px;
}

.modal-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}

.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.modal-spec {
  background: var(--light);
  border-radius: 10px;
  padding: 12px 14px;
}
.modal-spec-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 2px;
}
.modal-spec-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.modal-ctas {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
}

.modal-cta-apply {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  border: none;
  background: var(--accent);
  color: var(--white);
  transition: opacity .15s;
  white-space: nowrap;
}
.modal-cta-apply:hover { opacity: .88; }

.modal-cta-contact {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid #1f2937;
  background: transparent;
  color: #1f2937;
  transition: background .15s, color .15s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.modal-cta-contact:hover { background: #1f2937; color: var(--white); }

.modal-carfax-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mid);
  text-decoration: none;
}
.modal-carfax-link:hover { color: var(--dark); }

/* ── Modal Gallery ────────────────────────────────────────────────── */
.modal-gallery {
  position: relative;
}

.modal-gallery .modal-img {
  border-radius: 16px 16px 0 0;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-nav:hover { background: rgba(0,0,0,.7); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-counter {
  position: absolute;
  bottom: 56px;
  right: 12px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  overflow-x: auto;
  scroll-behavior: smooth;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.gallery-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color .15s, opacity .15s;
  opacity: .65;
}
.gallery-thumb:hover { opacity: .9; }
.gallery-thumb.active { border-color: var(--primary); opacity: 1; }

/* ── Simple Pages (Sell / Financing) ─────────────────────────────── */
.simple-page {
  padding: 80px 28px;
  min-height: calc(100vh - 64px);
}

.simple-page-inner {
  max-width: 640px;
  margin: 0 auto;
}

.simple-page h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}

.simple-page > .simple-page-inner > p {
  font-size: 18px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 40px;
}

.contact-card {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.contact-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}
.contact-card p {
  color: var(--mid);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  transition: opacity .15s;
}
.cta-btn:hover { opacity: .85; }

/* ── Financing Form ───────────────────────────────────────────────── */
.financing-page {
  min-height: calc(100vh - 64px);
  background: #f8f9fa;
  padding: 60px 28px 80px;
}

.financing-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}

.financing-left h1 {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.financing-sub {
  font-size: 16px;
  color: var(--mid);
  margin-bottom: 28px;
}

.financing-note {
  background: #fff8e1;
  border-left: 3px solid #f59e0b;
  padding: 12px 16px;
  font-size: 13px;
  color: #92400e;
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

.fin-form {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.fin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.fin-dob { grid-template-columns: 1fr 80px 100px; }

.fin-group { display: flex; flex-direction: column; }

.fin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.fin-input {
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color .15s;
  appearance: none;
  width: 100%;
}
.fin-input:focus { outline: none; border-color: var(--primary); }
.fin-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.fin-full { width: 100%; margin-bottom: 16px; }

.fin-dollar { position: relative; }
.fin-dollar span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mid); font-size: 14px; pointer-events: none; }
.fin-dollar .fin-input { padding-left: 24px; }

.fin-check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 20px 0 24px;
  font-size: 13px;
  color: var(--mid);
  line-height: 1.5;
  cursor: pointer;
}
.fin-check-row input { margin-top: 2px; flex-shrink: 0; accent-color: var(--primary); }

.fin-submit {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.fin-submit:hover { opacity: .88; }
.fin-submit:disabled { opacity: .5; cursor: not-allowed; }

#fin-result, #sell-result { margin-top: 16px; font-size: 14px; text-align: center; font-weight: 600; }
#fin-result.success, #sell-result.success { color: #16a34a; }
#fin-result.error,   #sell-result.error   { color: var(--accent); }

.fin-textarea { resize: vertical; min-height: 80px; margin-bottom: 16px; }

/* ── Carfax Badges ────────────────────────────────────────────────── */
.pill-no-acc   { background: #1d6fe8; color: #fff; }
.pill-one-owner { background: #16a34a; color: #fff; }

.cfx-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cfx-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.cfx-no-acc   { background: #1d6fe8; color: #fff; }
.cfx-one-owner { background: #16a34a; color: #fff; }

@media (max-width: 768px) {
  .financing-inner { grid-template-columns: 1fr; gap: 32px; }
  .fin-row { grid-template-columns: 1fr; }
  .fin-dob { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,.75);
  padding: 48px 28px 32px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand .footer-logo {
  display: block;
  margin-bottom: 12px;
  text-decoration: none;
}
.footer-logo-img {
  height: 72px;
  width: auto;
  display: block;
}
.footer-tagline {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,.5);
  max-width: 260px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  margin-bottom: 14px;
}

.footer-col p, .footer-col a {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  line-height: 1.8;
  display: block;
  text-decoration: none;
}
.footer-col a:hover { color: var(--white); }

.footer-hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  line-height: 2;
}
.footer-hours-row span:last-child { color: rgba(255,255,255,.45); }

.footer-bottom {
  max-width: 1400px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-inner { gap: 16px; padding: 0 16px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .nav-cta { display: none; }
  .hero { padding: 60px 16px 50px; }
  .inventory-section { padding: 24px 16px 60px; }
  .filters { padding: 12px; }
  .filter-group { min-width: 140px; }
  .modal-specs { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
