/* ── Car Pages — Shared Styles ──
   Brand pages, Model pages, Model+City pages
   Used alongside header.css (shared header)
*/

:root {
  --primary: #ff6b00;
  --secondary: #2563eb;
  --bg-dark: #0f1419;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  --card-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(255, 107, 0, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 70% 70% at 90% 85%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 70% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    linear-gradient(160deg, #1a1f2e 0%, #0f1419 50%, #0c1015 100%);
}

/* ── Container ── */
.car-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: rgba(255, 255, 255, 0.3);
}

.breadcrumb .current {
  color: var(--text-main);
}

/* ── Hero ── */
.car-hero {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 2rem;
}

.car-hero-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.car-hero-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.car-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.car-hero .subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-body-type {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-fuel {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-segment {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-ev {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Key Stats Strip ── */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-value.price {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 800;
}

/* ── Section Blocks ── */
.car-section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.car-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
}

.car-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.car-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.car-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.car-card p:last-child {
  margin-bottom: 0;
}

/* ── Tabs ── */
.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 0.85rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  font-family: 'Inter', sans-serif;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Tables ── */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.spec-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Specs Grid — two-column key/value */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.specs-grid .spec-row {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.specs-grid .spec-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.spec-key {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.spec-val {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
}

/* ── Model Grid (Brand page) ── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.model-card {
  text-decoration: none;
  color: inherit;
  display: block;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.model-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 107, 0, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.model-card .model-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.model-card .model-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.model-card .model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.model-card .model-variants {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Pros / Cons ── */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pros-list, .cons-list {
  list-style: none;
  padding: 0;
}

.pros-list li, .cons-list li {
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pros-list li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: #34d399;
  font-weight: 700;
  font-size: 1rem;
}

.cons-list li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: #f87171;
  font-weight: 700;
  font-size: 1rem;
}

/* ── Colour Chips with Swatches ── */
.colour-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.colour-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.2s;
}

.colour-chip:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.colour-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ── Car Hero Image ── */
.car-hero-inner.with-image {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.car-hero-text {
  flex: 1;
  min-width: 0;
}

.car-hero-img {
  flex: 0 0 380px;
  max-width: 380px;
}

.car-hero-img img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}


/* ── Model Card Thumbnail (Brand page) ── */
.model-card-img {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.model-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.model-card:hover .model-card-img img {
  transform: scale(1.05);
}

.model-card-img .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.08), rgba(37, 99, 235, 0.08));
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ── City Hero Background ── */
.car-hero-inner.city-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.car-hero-inner.city-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.7) 0%, rgba(15, 20, 25, 0.55) 50%, rgba(15, 20, 25, 0.65) 100%);
  border-radius: 24px;
  z-index: 0;
}

.car-hero-inner.city-hero > * {
  position: relative;
  z-index: 1;
}

.badge-city {
  background: rgba(255, 107, 0, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 107, 0, 0.3);
}

/* ── City Info Card (Popular Brands / Nearby Cities / Why Buy) ── */
.city-info-card h2 {
  margin-top: 1.75rem;
}

.city-info-card h2:first-child {
  margin-top: 0;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tag-pill.tag-brand {
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  color: var(--primary);
}

.tag-pill.tag-brand:hover {
  background: rgba(255, 107, 0, 0.15);
}

.tag-pill.tag-city {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
}

.tag-pill.tag-city:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 0, 0.08);
}

/* ── City Page Car Image ── */
.city-car-img {
  margin: 1.5rem 0;
  border-radius: 16px;
  overflow: hidden;
}

.city-car-img img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 16px;
}


/* ── FAQ ── */
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-left: 1rem;
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '-';
}

.faq-answer {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-top: 0.5rem;
}

/* ── City Links ── */
.city-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.city-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.city-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 107, 0, 0.08);
}

/* ── CTA Box ── */
.cta-box {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(255, 107, 0, 0.25);
  border-radius: 24px;
  padding: 3rem;
  text-align: center;
}

.cta-box h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.cta-box p {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: linear-gradient(180deg, #ff7a1a 0%, #ff6b00 100%);
  color: white;
  text-decoration: none;
  border-radius: 980px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 8px rgba(255, 107, 0, 0.3);
}

.cta-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px rgba(255, 107, 0, 0.4);
}

/* ── Similar Models ── */
.similar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.similar-card {
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.similar-card:hover {
  border-color: rgba(255, 107, 0, 0.3);
  transform: translateY(-2px);
}

.similar-card .sim-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.similar-card .sim-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.similar-card .sim-type {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ── Reviews Placeholder ── */
.reviews-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.reviews-placeholder h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.reviews-placeholder p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Used Car Listings (dynamic) ── */
.used-listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.used-listing-card {
  text-decoration: none;
  color: inherit;
  display: block;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.used-listing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 0, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.used-listing-card .card-img {
  height: 160px;
  overflow: hidden;
}

.used-listing-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.used-listing-card:hover .card-img img {
  transform: scale(1.05);
}

.used-listing-card .card-body {
  padding: 1rem;
}

.used-listing-card .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.used-listing-card .card-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.used-listing-card .card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.used-listing-card .card-specs span {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .models-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .used-listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .car-container {
    padding: 0 1rem;
  }
  .breadcrumb {
    padding: 1rem 1rem 0;
  }
  .car-hero {
    padding: 0 1rem;
  }
  .car-hero-inner {
    padding: 1.5rem;
    border-radius: 18px;
  }
  .car-hero-inner.with-image {
    flex-direction: column-reverse;
    gap: 1.25rem;
  }
  .car-hero-img {
    flex: 0 0 auto;
    max-width: 100%;
  }
  .car-hero h1 {
    font-size: 1.6rem;
  }
  .model-card-img {
    height: 120px;
  }
  .car-section {
    padding: 0 1rem;
    margin: 1.5rem auto;
  }
  .car-card {
    padding: 1.5rem;
    border-radius: 16px;
  }
  .stats-strip {
    gap: 1rem;
  }
  .models-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .model-card {
    padding: 1.25rem;
  }
  .pros-cons {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .similar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .used-listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cta-box {
    padding: 2rem 1.5rem;
  }
  .cta-box h2 {
    font-size: 1.4rem;
  }
  .tab-btn {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
  .spec-table th, .spec-table td {
    padding: 0.6rem 0.7rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .car-hero-inner {
    padding: 1.25rem;
    border-radius: 14px;
  }
  .car-hero h1 {
    font-size: 1.35rem;
  }
  .stat-value.price {
    font-size: 1.2rem;
  }
  .models-grid {
    grid-template-columns: 1fr;
  }
  .model-card {
    padding: 1rem;
    border-radius: 12px;
  }
  .similar-grid {
    grid-template-columns: 1fr;
  }
  .used-listings-grid {
    grid-template-columns: 1fr;
  }
  .car-card {
    padding: 1rem;
    border-radius: 14px;
  }
  .tabs-nav {
    gap: 0;
  }
  .tab-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
}
