/*
 * Viatura Core Engine v0.7.4 — Consolidação Visual Premium
 * Camada final de design system, compatibilidade de tema e leitura premium.
 * Não altera dados, queries, importação, rankings, SIV ou TCO: apenas apresentação.
 */

:root{
  --vce-premium-ink:#102033;
  --vce-premium-muted:#607086;
  --vce-premium-soft:#f6f8fb;
  --vce-premium-card:#ffffff;
  --vce-premium-line:#d9e1ec;
  --vce-premium-line-strong:#b8c6d8;
  --vce-premium-brand:#0b3a67;
  --vce-premium-brand-2:#1769aa;
  --vce-premium-accent:#16a34a;
  --vce-premium-warn:#b45309;
  --vce-premium-radius:18px;
  --vce-premium-radius-sm:12px;
  --vce-premium-shadow:0 18px 45px rgba(15,35,62,.10);
  --vce-premium-shadow-soft:0 10px 28px rgba(15,35,62,.08);
}

/* Base segura dentro de componentes VCE */
html body :where(.vce-vehicle-page,.vce-ficha-tecnica,.vce-smart-summary,.vce-tco-simulator,.vce-comparator,.vce-catalog-section,.vce-vehicle-related-list,.vce-intelligent-links,.vce-seo-navigation,.vce-auto-highlights,.vce-data-quality-public){
  color:var(--vce-premium-ink) !important;
  color-scheme:light !important;
  font-family:inherit;
}

html body :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) :where(h1,h2,h3,h4){
  color:var(--vce-premium-ink) !important;
  letter-spacing:-.02em;
  line-height:1.15;
}

html body :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) :where(p,li,dd,dt,span,small,em,strong){
  color:inherit;
}

/* Cartões premium unificados */
html body :where(.vce-vehicle-summary,.vce-smart-summary,.vce-ficha-tecnica-pro,.vce-tco-simulator,.vce-vehicle-related-list,.vce-intelligent-links,.vce-seo-block,.vce-catalog-card,.vce-theme-card,.vce-comparator-empty,.vce-comparator-tco-summary,.vce-auto-highlights,.vce-data-quality-public){
  background:linear-gradient(180deg,#ffffff 0%,var(--vce-premium-soft) 100%) !important;
  border:1px solid var(--vce-premium-line) !important;
  border-radius:var(--vce-premium-radius) !important;
  box-shadow:var(--vce-premium-shadow-soft) !important;
  overflow:hidden;
}

html body :where(.vce-vehicle-summary,.vce-smart-summary,.vce-tco-simulator,.vce-intelligent-links,.vce-vehicle-related-list,.vce-auto-highlights,.vce-data-quality-public){
  padding:clamp(18px,2.5vw,28px) !important;
  margin:0 0 24px !important;
}

/* Cabeçalho da ficha: visual de revista automóvel */
html body .vce-vehicle-summary{
  display:grid !important;
  grid-template-columns:minmax(260px,.9fr) minmax(0,1.1fr) !important;
  gap:clamp(18px,3vw,34px) !important;
  align-items:stretch !important;
}
html body .vce-vehicle-summary-media{
  border-radius:calc(var(--vce-premium-radius) - 4px) !important;
  overflow:hidden !important;
  background:#e9eef5 !important;
  min-height:230px;
}
html body .vce-vehicle-summary-media img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  display:block !important;
}
html body .vce-vehicle-kicker,
html body .vce-catalog-eyebrow,
html body .vce-catalog-kicker,
html body .vce-related-kicker{
  color:var(--vce-premium-brand-2) !important;
  font-weight:800 !important;
  text-transform:uppercase !important;
  letter-spacing:.08em !important;
  font-size:.78rem !important;
}
html body .vce-vehicle-highlights,
html body .vce-catalog-facts,
html body .vce-brand-stats,
html body .vce-model-stats{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(130px,1fr)) !important;
  gap:10px !important;
}
html body :where(.vce-vehicle-highlights,.vce-catalog-facts,.vce-brand-stats,.vce-model-stats) :where(div,dd,dt){
  min-width:0;
}
html body .vce-vehicle-highlights div,
html body .vce-catalog-facts div,
html body .vce-brand-stats > div,
html body .vce-model-stats > div,
html body .vce-smart-summary-item{
  background:rgba(255,255,255,.88) !important;
  border:1px solid var(--vce-premium-line) !important;
  border-radius:var(--vce-premium-radius-sm) !important;
  padding:12px 14px !important;
  box-shadow:0 8px 20px rgba(15,35,62,.055) !important;
}

/* Resumo inteligente/SIV: destaque compreensível */
html body .vce-smart-summary{
  position:relative;
  border-top:4px solid var(--vce-premium-brand-2) !important;
}
html body .vce-smart-summary::before{
  content:"SIV explicado • leitura rápida";
  position:absolute;
  top:14px;
  right:18px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  background:#eaf4ff;
  color:var(--vce-premium-brand) !important;
  -webkit-text-fill-color:var(--vce-premium-brand) !important;
  font-size:.74rem;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}
html body .vce-smart-summary-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr)) !important;
  gap:12px !important;
}
html body .vce-smart-summary-item:first-child{
  background:linear-gradient(135deg,#eef9ef 0%,#ffffff 75%) !important;
  border-color:#9bd7aa !important;
}
html body .vce-smart-summary-item span{
  display:block !important;
  margin-bottom:6px !important;
  color:var(--vce-premium-muted) !important;
  -webkit-text-fill-color:var(--vce-premium-muted) !important;
  font-size:.74rem !important;
  font-weight:800 !important;
}
html body .vce-smart-summary-item strong{
  color:var(--vce-premium-ink) !important;
  -webkit-text-fill-color:var(--vce-premium-ink) !important;
  font-size:clamp(1rem,1.6vw,1.24rem) !important;
}

/* Botões e ações */
html body :where(.vce-button,.vce-comparator-submit,.vce-compare-go,.vce-brand-actions a,.vce-model-actions a,.vce-intelligent-link-card,.vce-related-vehicle-card a,.vce-catalog-card a.button){
  border-radius:999px !important;
  font-weight:800 !important;
  text-decoration:none !important;
}
html body :where(.vce-button,.vce-comparator-submit,.vce-compare-go){
  background:linear-gradient(135deg,var(--vce-premium-brand),var(--vce-premium-brand-2)) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border:0 !important;
  box-shadow:0 10px 24px rgba(23,105,170,.22) !important;
}
html body :where(.vce-compare-toggle,.vce-compare-clear){
  border-radius:999px !important;
  border:1px solid var(--vce-premium-line-strong) !important;
  background:#fff !important;
  color:var(--vce-premium-brand) !important;
  -webkit-text-fill-color:var(--vce-premium-brand) !important;
  font-weight:800 !important;
}
html body :where(.vce-button,.vce-comparator-submit,.vce-compare-go,.vce-compare-toggle,.vce-intelligent-link-card):hover{
  transform:translateY(-1px);
  filter:saturate(1.04);
}

/* Comparador: leitura de diferenças e tabelas */
html body .vce-comparator-table-wrap,
html body .vce-comparator-tco-table-wrap{
  overflow-x:auto !important;
  border:1px solid var(--vce-premium-line) !important;
  border-radius:var(--vce-premium-radius) !important;
  background:#fff !important;
  box-shadow:var(--vce-premium-shadow-soft) !important;
}
html body :where(.vce-comparator-table,.vce-comparator-tco-table){
  border-collapse:separate !important;
  border-spacing:0 !important;
  width:100% !important;
  min-width:720px;
}
html body :where(.vce-comparator-table,.vce-comparator-tco-table) th{
  background:#edf4fb !important;
  color:var(--vce-premium-brand) !important;
  -webkit-text-fill-color:var(--vce-premium-brand) !important;
  font-weight:900 !important;
  border-bottom:1px solid var(--vce-premium-line-strong) !important;
}
html body :where(.vce-comparator-table,.vce-comparator-tco-table) td{
  background:#fff !important;
  color:var(--vce-premium-ink) !important;
  -webkit-text-fill-color:var(--vce-premium-ink) !important;
  border-bottom:1px solid var(--vce-premium-line) !important;
}
html body .vce-comparator-section-row th{
  background:linear-gradient(135deg,var(--vce-premium-brand),var(--vce-premium-brand-2)) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  text-transform:uppercase !important;
  letter-spacing:.06em !important;
}
html body .vce-comparator-table td.vce-best-value,
html body .vce-comparator-table-blocks td.vce-best-value{
  background:#ecfdf3 !important;
  color:#062415 !important;
  -webkit-text-fill-color:#062415 !important;
  box-shadow:inset 4px 0 0 #16a34a, inset 0 0 0 9999px rgba(236,253,243,.68) !important;
}

/* Ligações internas e recomendações */
html body .vce-intelligent-links-grid,
html body .vce-related-vehicle-grid,
html body .vce-alternatives-grid,
html body .vce-model-version-grid,
html body .vce-brand-chip-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr)) !important;
  gap:14px !important;
}
html body :where(.vce-intelligent-link-card,.vce-related-vehicle-card,.vce-alternative-card,.vce-model-version-grid a,.vce-brand-chip-grid a,.vce-brand-mini-list a,.vce-model-mini-list a){
  background:#fff !important;
  border:1px solid var(--vce-premium-line) !important;
  border-radius:var(--vce-premium-radius-sm) !important;
  box-shadow:0 8px 20px rgba(15,35,62,.06) !important;
  color:var(--vce-premium-ink) !important;
  -webkit-text-fill-color:var(--vce-premium-ink) !important;
}
html body .vce-intelligent-link-card{
  padding:16px !important;
  display:flex !important;
  flex-direction:column !important;
  gap:6px !important;
}
html body .vce-intelligent-link-icon{
  font-size:1.55rem !important;
}

/* Catálogo e páginas de marca/modelo */
html body .vce-catalog-card{
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
html body .vce-catalog-card:hover,
html body .vce-related-vehicle-card:hover,
html body .vce-intelligent-link-card:hover{
  transform:translateY(-2px);
  border-color:var(--vce-premium-line-strong) !important;
  box-shadow:var(--vce-premium-shadow) !important;
}
html body .vce-catalog-thumb{
  background:#e9eef5 !important;
}
html body .vce-catalog-title a,
html body .vce-related-vehicle-card a,
html body .vce-brand-mini-list a,
html body .vce-model-mini-list a{
  color:var(--vce-premium-brand) !important;
  -webkit-text-fill-color:var(--vce-premium-brand) !important;
}

/* Breadcrumbs e blocos SEO */
html body .vce-breadcrumbs{
  margin:0 0 18px !important;
  color:var(--vce-premium-muted) !important;
  -webkit-text-fill-color:var(--vce-premium-muted) !important;
  font-size:.9rem !important;
}
html body .vce-seo-links{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:10px !important;
}
html body .vce-seo-links a{
  display:inline-flex !important;
  padding:8px 12px !important;
  border-radius:999px !important;
  background:#fff !important;
  border:1px solid var(--vce-premium-line) !important;
  color:var(--vce-premium-brand) !important;
  -webkit-text-fill-color:var(--vce-premium-brand) !important;
  font-weight:800 !important;
  text-decoration:none !important;
}

/* Barra flutuante de comparação */
html body .vce-compare-bar{
  z-index:99998 !important;
}
html body .vce-compare-bar-inner{
  background:rgba(16,32,51,.96) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  border:1px solid rgba(255,255,255,.16) !important;
  box-shadow:0 18px 45px rgba(0,0,0,.24) !important;
  backdrop-filter:blur(10px);
}
html body .vce-compare-bar-inner *{
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}
html body .vce-compare-bar .vce-compare-clear{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(255,255,255,.24) !important;
}

/* Modo escuro do tema: mantém componentes VCE claros e legíveis */
html[class*="dark"] body :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) *,
body[class*="dark"] :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) *,
body.dark :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) *,
body.dark-mode :where(.vce-vehicle-page,.vce-comparator,.vce-catalog-section) *{
  text-shadow:none !important;
  filter:none !important;
  mix-blend-mode:normal !important;
}

@media (max-width: 780px){
  html body .vce-vehicle-summary{
    grid-template-columns:1fr !important;
  }
  html body .vce-smart-summary::before{
    position:static;
    margin:0 0 14px;
  }
  html body :where(.vce-vehicle-summary,.vce-smart-summary,.vce-tco-simulator,.vce-intelligent-links,.vce-vehicle-related-list,.vce-auto-highlights,.vce-data-quality-public){
    padding:16px !important;
    border-radius:14px !important;
  }
  html body .vce-smart-summary-grid,
  html body .vce-intelligent-links-grid,
  html body .vce-related-vehicle-grid,
  html body .vce-alternatives-grid{
    grid-template-columns:1fr !important;
  }
}

@media (prefers-reduced-motion: reduce){
  html body :where(.vce-catalog-card,.vce-related-vehicle-card,.vce-intelligent-link-card,.vce-button,.vce-comparator-submit,.vce-compare-go,.vce-compare-toggle){
    transition:none !important;
    transform:none !important;
  }
}

/* v0.7.7.2 — Semântica cromática das barras SIV/Perfil Económico
   Garante que a cor da barra acompanha a classificação textual. */
html body .vce-siv-card .vce-siv-score-bar,
html body .vce-siv-card .vce-siv-profile-bar {
    background:#e5e7eb !important;
    background-color:#e5e7eb !important;
}

html body .vce-siv-level-excellent .vce-siv-score-bar i,
html body .vce-siv-profile-excellent .vce-siv-profile-bar i {
    background:#16a34a !important;
    background-color:#16a34a !important;
}

html body .vce-siv-level-very-good .vce-siv-score-bar i,
html body .vce-siv-profile-very-good .vce-siv-profile-bar i {
    background:#65a30d !important;
    background-color:#65a30d !important;
}

html body .vce-siv-level-good .vce-siv-score-bar i,
html body .vce-siv-profile-good .vce-siv-profile-bar i {
    background:#eab308 !important;
    background-color:#eab308 !important;
}

html body .vce-siv-level-below-average .vce-siv-score-bar i,
html body .vce-siv-profile-below-average .vce-siv-profile-bar i {
    background:#f97316 !important;
    background-color:#f97316 !important;
}

html body .vce-siv-level-weak .vce-siv-score-bar i,
html body .vce-siv-profile-weak .vce-siv-profile-bar i {
    background:#dc2626 !important;
    background-color:#dc2626 !important;
}

html body .vce-siv-level-neutral .vce-siv-score-bar i,
html body .vce-siv-profile-neutral .vce-siv-profile-bar i {
    background:#94a3b8 !important;
    background-color:#94a3b8 !important;
}

html body .vce-siv-level-excellent .vce-siv-score-row span,
html body .vce-siv-profile-excellent .vce-siv-profile-rating span { color:#166534 !important; }
html body .vce-siv-level-very-good .vce-siv-score-row span,
html body .vce-siv-profile-very-good .vce-siv-profile-rating span { color:#3f6212 !important; }
html body .vce-siv-level-good .vce-siv-score-row span,
html body .vce-siv-profile-good .vce-siv-profile-rating span { color:#854d0e !important; }
html body .vce-siv-level-below-average .vce-siv-score-row span,
html body .vce-siv-profile-below-average .vce-siv-profile-rating span { color:#c2410c !important; }
html body .vce-siv-level-weak .vce-siv-score-row span,
html body .vce-siv-profile-weak .vce-siv-profile-rating span { color:#991b1b !important; }

/* v0.7.7.3 — Correção final: barras SIV realmente semânticas, mesmo com Visual Isolation/temas agressivos. */
html body .vce-siv-card.vce-siv-level-excellent .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-excellent .vce-siv-profile-bar i{background:#16a34a !important;background-color:#16a34a !important;}
html body .vce-siv-card.vce-siv-level-very-good .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-very-good .vce-siv-profile-bar i{background:#65a30d !important;background-color:#65a30d !important;}
html body .vce-siv-card.vce-siv-level-good .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-good .vce-siv-profile-bar i{background:#eab308 !important;background-color:#eab308 !important;}
html body .vce-siv-card.vce-siv-level-below-average .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-below-average .vce-siv-profile-bar i{background:#f97316 !important;background-color:#f97316 !important;}
html body .vce-siv-card.vce-siv-level-weak .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-weak .vce-siv-profile-bar i{background:#dc2626 !important;background-color:#dc2626 !important;}
html body .vce-siv-card.vce-siv-level-neutral .vce-siv-score-bar i,
html body .vce-siv-profile-item.vce-siv-profile-neutral .vce-siv-profile-bar i{background:#94a3b8 !important;background-color:#94a3b8 !important;}



/* v0.7.8.1 — Ecossistema SIV: barras de pesos neutras e explicação da classificação */
html body .vce-siv-card .vce-siv-component > span.vce-siv-weight-bar,
html body .vce-siv-explain .vce-siv-component > span.vce-siv-weight-bar{
  background:#e5e7eb !important;
  background-color:#e5e7eb !important;
}
html body .vce-siv-card .vce-siv-component > span.vce-siv-weight-bar i,
html body .vce-siv-explain .vce-siv-component > span.vce-siv-weight-bar i{
  background:#2563eb !important;
  background-color:#2563eb !important;
}
html body .vce-siv-card .vce-siv-reason{
  margin-top:18px;
  padding:18px;
  border:1px solid rgba(148,163,184,.35);
  border-radius:16px;
  background:#ffffff;
}
html body .vce-siv-card .vce-siv-reason h3{
  margin:0 0 8px;
  color:#0f172a;
  font-size:1.2rem;
}
html body .vce-siv-card .vce-siv-reason p{
  margin:0 0 12px;
  color:#334155;
  line-height:1.6;
}
html body .vce-siv-card .vce-siv-reason-block{
  margin:12px 0;
  padding:12px 14px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.28);
}
html body .vce-siv-card .vce-siv-reason-block h4{
  margin:0 0 8px;
  color:#0f172a;
  font-size:1rem;
}
html body .vce-siv-card .vce-siv-reason-block ul{
  margin:0;
  padding:0;
  list-style:none;
  display:grid;
  gap:7px;
}
html body .vce-siv-card .vce-siv-reason-block li{
  display:flex;
  align-items:center;
  gap:8px;
  color:#0f172a;
  font-weight:700;
}
html body .vce-siv-card .vce-siv-reason-block li em{
  margin-left:auto;
  font-style:normal;
  color:#334155;
  font-weight:900;
}
html body .vce-siv-card .vce-siv-reason-positive li span{
  color:#16a34a;
}
html body .vce-siv-card .vce-siv-reason-attention li span{
  color:#f97316;
}
html body .vce-siv-card .vce-siv-reason-note{
  margin-top:12px !important;
  font-size:.92rem;
  color:#64748b !important;
}
html body .vce-siv-card .vce-siv-reason-balanced{
  padding:12px 14px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid rgba(148,163,184,.28);
}
