/* OBD2 Finder — Encyclopedic Theme */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #1e3a5f;
  --accent:      #e63946;
  --accent-dark: #b02030;
  --text:        #1a1a2e;
  --text-muted:  #64748b;
  --text-light:  #94a3b8;
  --bg:          #f8f9fa;
  --bg-card:     #ffffff;
  --border:      #e2e8f0;
  --border-dark: #cbd5e1;
  --radius:      8px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent); }

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

/* ── Header ────────────────────────────────────────────────────── */

.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.site-logo:hover { color: #e2e8f0; text-decoration: none; }

.main-nav { display: flex; gap: 16px; }
.main-nav a { color: #cbd5e1; font-size: .9rem; font-weight: 500; }
.main-nav a:hover { color: #fff; text-decoration: none; }

.header-search { flex: 1; max-width: 360px; margin-left: auto; }
.search-input {
  width: 100%;
  padding: 8px 14px;
  border-radius: 20px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .9rem;
  outline: none;
}
.search-input::placeholder { color: rgba(255,255,255,.6); }
.search-input:focus { background: rgba(255,255,255,.25); }

.lang-switcher-nav { display: flex; gap: 6px; }
.lang-link { color: #94a3b8; font-size: .78rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.lang-link:hover { color: #fff; background: rgba(255,255,255,.15); text-decoration: none; }

/* ── Breadcrumb ─────────────────────────────────────────────────── */

.breadcrumb {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: .82rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  color: var(--text-muted);
}

.breadcrumb-list li:not(:last-child)::after { content: '›'; margin-left: 6px; color: var(--text-light); }
.breadcrumb-list a { color: var(--primary); }
.breadcrumb-list a:hover { color: var(--accent); }

/* ── Hero ───────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2d5a8e 100%);
  color: #fff;
  padding: 56px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.hero-desc {
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: #bfdbfe;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Sections ───────────────────────────────────────────────────── */

.section { padding: 48px 0; }
.section-alt { background: #fff; }
.home-sections { padding: 40px 0; display: flex; flex-direction: column; gap: 48px; }
.see-all-link { display: inline-block; margin-top: 14px; color: var(--primary); font-weight: 600; text-decoration: none; font-size: .95rem; }
.see-all-link:hover { text-decoration: underline; }

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── Code Pills ─────────────────────────────────────────────────── */

.code-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.code-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, border-color .15s;
}
.code-pill:hover { box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; color: var(--primary); }

.code-pill-code {
  font-weight: 800;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--accent);
}

.code-pill-name { color: var(--text-muted); font-size: .8rem; }

/* ── Brands Grid ────────────────────────────────────────────────── */

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.brands-grid-full { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.brand-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); text-decoration: none; color: var(--primary); }

.brand-arrow { color: var(--text-light); font-size: 1rem; }

/* ── Models Grid ─────────────────────────────────────────────────── */

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.model-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .15s;
}
.model-card:hover { border-color: var(--primary); text-decoration: none; }
.model-name { flex: 1; }
.model-years { font-size: .78rem; color: var(--text-muted); font-weight: 400; }
.model-arrow { color: var(--text-light); }

/* ── Article List ─────────────────────────────────────────────────── */

.article-list { display: flex; flex-direction: column; gap: 8px; }

.article-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.article-list-item:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.article-list-brand { font-size: .75rem; color: var(--text-muted); min-width: 60px; }
.article-list-title { flex: 1; font-weight: 500; }
.article-list-arrow { color: var(--text-light); margin-left: auto; }

/* ── Latest list ──────────────────────────────────────────────────── */

.latest-list { display: flex; flex-direction: column; gap: 6px; }
.latest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text);
  text-decoration: none;
}
.latest-item:hover { border-color: var(--primary); text-decoration: none; }
.latest-title { flex: 1; }
.latest-arrow { color: var(--text-light); margin-left: 12px; }

/* ── Article Layout ───────────────────────────────────────────────── */

.article-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
  align-items: start;
}

/* ── Article Content ──────────────────────────────────────────────── */

.article-header {
  margin-bottom: 24px;
}

.article-title {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin: 10px 0 6px;
}

.article-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

.code-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: .95rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: .05em;
}

.code-badge-sm {
  font-size: .78rem;
  padding: 2px 8px;
}

.sev-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}

/* ── Article Body ─────────────────────────────────────────────────── */

.article-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.article-body p {
  margin-bottom: 14px;
  line-height: 1.75;
  color: #2d3748;
}

.article-body ul, .article-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.article-body li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: .9rem;
}

.article-body th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.article-body td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.article-body tr:nth-child(even) td { background: #f8fafc; }
.article-body tr:hover td { background: #eef2ff; }

/* FAQ accordion */
.article-body details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.article-body summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  background: #f8fafc;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.article-body summary::-webkit-details-marker { display: none; }
.article-body summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); }
.article-body details[open] summary::after { content: '−'; }
.article-body details[open] summary { background: #eef2ff; }

.article-body details p {
  padding: 12px 16px;
  margin: 0;
  font-size: .9rem;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 72px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.sidebar-card-title {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Quick Facts */
.facts-list { display: flex; flex-direction: column; gap: 8px; font-size: .87rem; }
.facts-list dt { font-weight: 600; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.facts-list dd { color: var(--text); }
.facts-list a { color: var(--primary); }

/* Affiliate */
.affiliate-card { border-color: #fde68a; background: #fffbeb; }
.affiliate-desc { font-size: .85rem; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.affiliate-btn {
  display: block;
  text-align: center;
  padding: 10px;
  background: #ff9900;
  color: #000;
  font-weight: 700;
  font-size: .88rem;
  border-radius: var(--radius);
  text-decoration: none;
  margin-bottom: 8px;
}
.affiliate-btn:hover { background: #e68900; text-decoration: none; }
.affiliate-disclosure { font-size: .7rem; color: var(--text-light); }

/* Lang card */
.lang-card { }
.lang-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lang-link-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
}
.lang-link-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lang-link-pill:hover:not(.active) { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ── Diagnostic Panel ─────────────────────────────────────────────── */

.diagnostic-panel {
  background: linear-gradient(135deg, #0f2240 0%, #1e3a5f 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.diag-item { display: flex; flex-direction: column; gap: 4px; }
.diag-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #93c5fd;
}
.diag-value {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
}
.diag-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.4rem;
  color: #fbbf24;
  letter-spacing: .05em;
}

/* ── Callout Boxes ────────────────────────────────────────────────── */

.callout {
  border-left: 4px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: .92rem;
}
.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.callout-warning {
  border-color: #f59e0b;
  background: #fffbeb;
}
.callout-warning .callout-title { color: #b45309; }
.callout-danger {
  border-color: var(--accent);
  background: #fff1f2;
}
.callout-danger .callout-title { color: var(--accent-dark); }
.callout-tip {
  border-color: #10b981;
  background: #f0fdf4;
}
.callout-tip .callout-title { color: #065f46; }
.callout-info {
  border-color: #3b82f6;
  background: #eff6ff;
}
.callout-info .callout-title { color: #1d4ed8; }

/* ── Trust Bar ────────────────────────────────────────────────────── */

.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: .78rem;
  color: var(--text-muted);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.trust-icon { font-size: .9rem; }

/* ── Affiliate Card (améliorée) ───────────────────────────────────── */

.affiliate-card {
  border: 2px solid #fbbf24 !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
}
.affiliate-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.affiliate-badge {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #ff9900;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
}
.affiliate-product {
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  margin-bottom: 6px;
}
.affiliate-stars {
  color: #f59e0b;
  font-size: .85rem;
  margin-bottom: 8px;
}
.affiliate-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── Ad Placeholders ──────────────────────────────────────────────── */

.ad-horizontal {
  min-height: 90px;
  background: #f1f5f9;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  margin: 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .75rem;
}

.ad-inline {
  min-height: 250px;
  background: #f1f5f9;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .75rem;
}

.ad-sidebar {
  min-height: 250px;
  background: #f1f5f9;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .75rem;
}

/* ── Related ──────────────────────────────────────────────────────── */

.related-section { margin-top: 32px; }
.related-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: .85rem;
  transition: border-color .15s;
}
.related-item:hover { border-color: var(--primary); text-decoration: none; }
.related-brand { font-size: .72rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.related-title { font-weight: 500; color: var(--text); }

/* ── Footer ───────────────────────────────────────────────────────── */

.site-footer {
  background: var(--primary);
  color: #94a3b8;
  padding: 32px 0;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-desc { font-size: .85rem; color: #cbd5e1; }

.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: #94a3b8; font-size: .85rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }

.footer-copy { font-size: .78rem; color: #64748b; }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }

  .article-body {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .header-inner { gap: 12px; }
  .main-nav { display: none; }
  .hero { padding: 36px 0; }
  .section { padding: 32px 0; }
  .brands-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-switcher-nav { display: none; }
}
