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

:root {
  --bg: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aa0;
  --border: #e8e8f0;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --green: #16a34a;
  --orange: #f97316;
  --red: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-block {
  width: 100%;
  margin-bottom: 10px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
}

/* ===== Top Bar ===== */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.logo-accent {
  color: var(--accent);
}

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

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.nav-link:hover,
.nav-link.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.nav-right {
  display: flex;
  gap: 8px;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
  padding: 64px 0 48px;
  text-align: center;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 17px;
  color: var(--text-secondary);
}

.search-bar {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  align-items: flex-end;
}

.search-field {
  flex: 1;
  text-align: left;
}

.search-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.search-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  cursor: pointer;
}

.btn-search {
  padding: 10px 28px;
  white-space: nowrap;
}

/* ===== Stats Strip ===== */
.stats-strip {
  background: var(--text-primary);
  padding: 20px 0;
}

.stats-inner {
  display: flex;
  justify-content: space-around;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

/* ===== Ad Sections ===== */
.ad-section {
  padding: 20px 0;
}

.ad-section-hero {
  padding: 20px 0;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.motara-banner-slot {
  max-width: 800px;
  margin: 0 auto;
}

.motara-hero-slot {
  max-width: 100%;
}

.motara-large-banner-slot {
  max-width: 970px;
  margin: 0 auto;
}

.motara-banner-slot-feed {
  padding: 16px;
}

.ad-disclosure {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Listings ===== */
.listings-section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.listing-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.listing-card-ad {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  border-style: dashed;
  border-color: var(--border);
  background: var(--bg-surface);
}
.listing-card-ad:hover {
  transform: none;
  box-shadow: none;
}

.listing-image {
  height: 190px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.listing-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.tag-price {
  background: var(--orange);
}

.listing-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.listing-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.listing-specs {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 12px;
}

.listing-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.listing-location {
  font-size: 12px;
  color: var(--text-muted);
}

.load-more {
  text-align: center;
  margin-top: 32px;
}

/* ===== How It Works ===== */
.how-it-works {
  padding: 64px 0;
  background: var(--bg-surface);
}

.how-it-works h2 {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.step-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Footer ===== */
.footer {
  margin-top: auto;
  background: var(--text-primary);
  color: #fff;
  padding-top: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
}

.footer-brand .logo-text {
  color: #fff;
}

.footer-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 0;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.powered-by a {
  color: var(--accent);
}

/* ===== Breadcrumb ===== */
.breadcrumb-bar {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.breadcrumb-bar a {
  color: var(--accent);
}
.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.crumb-sep {
  margin: 0 6px;
  color: var(--text-muted);
}

/* ===== Listing Detail ===== */
.listing-detail {
  padding: 32px 0 64px;
}

.listing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Gallery */
.gallery-main {
  width: 100%;
  height: 420px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.thumb {
  width: 80px;
  height: 60px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s;
}
.thumb:hover,
.thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

/* Specs Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.spec-item {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.spec-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.spec-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

/* Detail sections */
.detail-section {
  margin-top: 32px;
}

.detail-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.feature-list {
  list-style: none;
  margin: 8px 0;
}

.feature-list li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

/* History checks */
.history-checks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.check-pass {
  background: #f0fdf4;
  color: var(--green);
}

.check-icon {
  font-weight: 700;
}

/* Sidebar */
.detail-sidebar {
  position: sticky;
  top: 80px;
}

.price-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.detail-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.detail-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.price-main {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  margin: 16px 0 4px;
}

.price-monthly {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.seller-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.seller-name {
  font-weight: 600;
  font-size: 14px;
}

.seller-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Similar cars */
.similar-section {
  margin-top: 20px;
}

.similar-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.similar-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.15s;
}
.similar-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

.similar-image {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.similar-title {
  font-size: 13px;
  font-weight: 600;
}

.similar-specs {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.similar-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}

/* ===== Vehicle Selector (Demo) ===== */
.vehicle-selector {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 280px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 13px;
}

.vs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--text-primary);
  color: #fff;
  user-select: none;
}

.vs-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.vs-current {
  flex: 1;
  font-weight: 700;
  text-align: right;
}

.vs-toggle {
  font-size: 10px;
  transition: transform 0.2s;
}

.vs-toggle.open {
  transform: rotate(180deg);
}

.vs-options {
  display: none;
  padding: 8px;
}

.vs-options.open {
  display: block;
}

.vs-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
}

.vs-option:hover {
  background: var(--bg-surface);
}

.vs-option.active {
  background: #f0f9ff;
  border: 1.5px solid var(--accent);
}

.vs-emoji {
  font-size: 20px;
  flex-shrink: 0;
}

.vs-option div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.vs-option strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.vs-option span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .nav-right {
    display: none;
  }

  .hero-title {
    font-size: 28px;
  }

  .search-bar {
    flex-direction: column;
    gap: 8px;
  }

  .stats-inner {
    flex-wrap: wrap;
    gap: 24px;
  }

  .stat {
    width: 40%;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .listing-detail-grid {
    grid-template-columns: 1fr;
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-checks {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    gap: 32px;
    flex-wrap: wrap;
  }
}
