/* =========================
   City Motors Manitoba
   Main stylesheet
   ========================= */

:root {
  --ink: #172329;
  --muted: #69777d;
  --paper: #f6f7f5;
  --white: #fff;
  --line: #e1e6e4;
  --green: #b7f36b;
  --dark: #172a2f;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(19, 38, 43, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

a { color: inherit; }

button, input, select { font: inherit; }

h1, h2, h3, p { margin-top: 0; }

:focus-visible {
  outline: 2px solid #7b9d5b;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================
   Header and navigation
   ========================= */

.site-header {
  min-height: 82px;
  padding: 14px clamp(20px, 6vw, 88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  line-height: 1.1;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2.1px;
}

.site-header nav {
  display: flex;
  gap: clamp(18px, 3vw, 38px);
}

.site-header nav a,
.site-footer > a:last-child {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer a:hover {
  color: #507a2b;
}

.header-cta {
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* =========================
   Hero
   ========================= */

.hero {
  min-height: 470px;
  padding: 68px clamp(20px, 8vw, 120px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 36px;
  overflow: hidden;
  background: #e9eee8;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #56783c;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2.1px;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 5.3vw, 72px);
  line-height: 0.99;
  letter-spacing: -3.5px;
}

h1 span { color: #638744; }

.hero-copy {
  max-width: 430px;
  margin-bottom: 28px;
  color: #59696a;
  font-size: 16px;
}

.hero-art {
  position: relative;
  min-width: 0;
  min-height: 310px;
  overflow: hidden;
  border-radius: 28px;
  background: var(--white);
}

.hero-car-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* =========================
   Buttons and links
   ========================= */

.button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--dark);
  color: var(--white);
}

.button-primary:hover { background: #29444a; }

.text-link {
  color: #476c2b;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.text-link span { margin-left: 5px; }

/* =========================
   Sections
   ========================= */

.section { padding: 82px clamp(20px, 8vw, 120px); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08;
  letter-spacing: -1.6px;
}

h3 { font-size: 18px; }

.muted { color: var(--muted); }

.count-pill {
  padding: 8px 13px;
  border: 1px solid #d8e0d7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

/* =========================
   Inventory filters
   ========================= */

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 190px;
  gap: 12px;
  margin-bottom: 26px;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--white);
  color: var(--ink);
}

.filters input:focus,
.filters select:focus {
  border-color: #7b9d5b;
  box-shadow: 0 0 0 3px rgba(123, 157, 91, 0.15);
}

.search-box { position: relative; }

.search-box > span:not(.sr-only) {
  position: absolute;
  top: 6px;
  left: 14px;
  color: #78867f;
  font-size: 28px;
}

.search-box input { padding-left: 42px; }

.inventory-message {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.inventory-message:empty { display: none; }

/* =========================
   Vehicle cards
   ========================= */

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.vehicle-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.vehicle-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.vehicle-image {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: linear-gradient(135deg, #dce6dd, #eef1ed);
}

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

.image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 110%, #a9b7ad 0 20%, transparent 21%),
    linear-gradient(135deg, #e4eae4, #cad8cb);
  color: #66796b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.vehicle-tag {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.vehicle-tag.tag-soon {
  background: var(--dark);
  color: var(--white);
}

.vehicle-info { padding: 19px; }

.vehicle-year {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.vehicle-info h3 {
  margin: 0 0 13px;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.vehicle-price {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.7px;
}

.vehicle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.vehicle-meta span {
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.vehicle-meta span:last-child { border-right: 0; }

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.card-button {
  padding: 10px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--dark);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.card-button:hover { background: #35545a; }

.empty-state {
  grid-column: 1 / -1;
  padding: 50px 20px;
  border: 1px dashed #cbd5cb;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* =========================
   JDM section
   ========================= */

.country-flag {
  width: 36px;
  height: 24px;
  margin-left: 6px;
  vertical-align: middle;
  object-fit: cover;
  border: 1px solid #cbd5d1;
  border-radius: 3px;
  background: var(--white);
}

.steps {
  padding-left: 20px;
  margin: 0 0 24px;
}

.steps li { margin-bottom: 14px; }

.steps strong { color: var(--ink); }

/* =========================
   About section
   ========================= */

.about-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: center;
  gap: 70px;
  background: #e8eee6;
}

.about-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
}

.about-logo {
  display: block;
  width: 100px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.about-brand-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.about-brand-text span {
  font-size: 25px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.about-brand-text small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 3px;
}

.about-copy {
  max-width: 560px;
  color: #5e6c63;
}

/* =========================
   Contact section
   ========================= */

.contact-section {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  align-items: start;
  gap: 60px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 0;
}

.contact-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #edf4e8;
  font-size: 18px;
}

.contact-item small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.5px;
}

.contact-item a,
.contact-item span:not(.contact-icon) {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* =========================
   Footer
   ========================= */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px clamp(20px, 6vw, 88px);
  background: var(--dark);
  color: var(--white);
}

.site-footer .brand small { color: #bdc9c5; }

.site-footer p {
  margin: 0;
  color: #c0cbc7;
  font-size: 11px;
}

/* =========================
   Vehicle details dialog
   ========================= */

.vehicle-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(620px, calc(100% - 28px));
  max-height: 90vh;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 20px 90px rgba(0, 0, 0, 0.3);
}

.vehicle-dialog::backdrop {
  background: rgba(15, 28, 31, 0.66);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  font-size: 26px;
  cursor: pointer;
}

.dialog-image-container {
  position: relative;
  background: #e1e9e0;
}

.dialog-image {
  height: 300px;
  overflow: hidden;
}

.dialog-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-nav {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.image-nav:hover { background: var(--green); }
.image-prev { left: 12px; }
.image-next { right: 12px; }

.image-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(23, 35, 41, 0.8);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.dialog-body { padding: 25px; }

.dialog-body h2 { font-size: 30px; }

.dialog-description { color: var(--muted); }

.dialog-contact {
  display: inline-block;
  margin-top: 10px;
}

/* =========================
   Responsive layouts
   ========================= */

@media (max-width: 900px) {
  .hero { padding-top: 50px; padding-bottom: 50px; }
  .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .about-section { gap: 35px; }
}

@media (max-width: 650px) {
  .site-header { flex-wrap: wrap; gap: 14px; }

  .site-header nav {
    order: 3;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .header-cta { margin-left: auto; padding: 10px 13px; }

  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-art { min-height: 245px; }
  h1 { letter-spacing: -2px; }

  .section { padding-top: 58px; padding-bottom: 58px; }
  .section-heading { align-items: flex-start; flex-direction: column; }

  .filters { grid-template-columns: 1fr; }
  .search-box { grid-column: auto; }
  .vehicle-grid { grid-template-columns: 1fr; }
  .vehicle-image { height: 220px; }

  .about-section,
  .contact-section { grid-template-columns: 1fr; gap: 32px; }

  .about-brand { gap: 12px; padding: 10px; }
  .about-logo { width: 78px; }
  .about-brand-text span { font-size: 20px; }
  .about-brand-text small { font-size: 11px; letter-spacing: 2px; }

  .site-footer { align-items: flex-start; flex-direction: column; }
  .dialog-image { height: 230px; }
}
