/* Tema oscuro (botón día/noche). Se activa con html[data-theme="dark"]. */
html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #111827;
  --surface-dim: #0b1020;
  --surface-container-lowest: #111827;
  --surface-container-low: #0f172a;
  --surface-container: #1f2937;
  --surface-container-high: #273449;
  --surface-container-highest: #334155;
  --surface-variant: #1f2937;
  --surface-bright: #1f2937;
  --on-surface: #e5e7eb;
  --on-surface-variant: #9ca3af;
  --outline: #374151;
  --outline-variant: #1f2937;
  --ghost-border: rgba(255, 255, 255, 0.08);
  --shadow-ambient: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 12px 32px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] body {
  background-color: #0b1020 !important;
  color: #e5e7eb;
}
html[data-theme="dark"] .dealership-header-wrapper,
html[data-theme="dark"] .navbar {
  background-color: #0b1020 !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .nav-link { color: #cbd5e1 !important; }
html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .nav-link:hover { color: #ffffff !important; }
html[data-theme="dark"] .main-logo { filter: brightness(1.35) saturate(0.9); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #1f2937 !important;
  color: #e5e7eb !important;
  border-color: #374151 !important;
}
html[data-theme="dark"] img:not(.main-logo),
html[data-theme="dark"] video {
  opacity: 0.97;
}

/* Botón día/noche del header */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: #ffffff;
  color: #2563EB;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  flex: 0 0 auto;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { background: #eff6ff; }
html[data-theme="dark"] .theme-toggle {
  background: #1f2937;
  color: #fbbf24;
  border-color: #374151;
}
html[data-theme="dark"] .theme-toggle:hover { background: #273449; }

/* Colores de cada sección (generados desde la skin clara) */
html[data-theme="dark"] #calculadora .calculator-results { background-color: #111827 !important; }
html[data-theme="dark"] .assurance-icon { background-color: #111827 !important; }
html[data-theme="dark"] .brand-filter-select { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .brands-headline { color: #e5e7eb !important; }
html[data-theme="dark"] .btn-action-share { background-color: #0f172a !important; }
html[data-theme="dark"] .btn-back-catalog { background-color: #111827 !important; }
html[data-theme="dark"] .btn-card-details { background-color: #1f2937 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .btn-hero-deal { background-color: #111827 !important; }
html[data-theme="dark"] .btn-hero-primary { background-color: #111827 !important; }
html[data-theme="dark"] .btn-nissan-white { background-color: #111827 !important; }
html[data-theme="dark"] .btn-outline { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .c-badge-type { background-color: #0f172a !important; }
html[data-theme="dark"] .calc-row { color: #9ca3af !important; }
html[data-theme="dark"] .calc-row span:last-child { color: #e5e7eb !important; }
html[data-theme="dark"] .calc-select { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .calculator-inputs input[type="number"] { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .calculator-inputs label:not(.repair-pill-item) { color: #cbd5e1 !important; }
html[data-theme="dark"] .calculator-results { background-color: #111827 !important; }
html[data-theme="dark"] .calculator-section { background-color: #0f172a !important; }
html[data-theme="dark"] .calculator-wrapper { background-color: #111827 !important; }
html[data-theme="dark"] .car-detail-page { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-sort-bar .search-container input { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .category-card { background-color: #111827 !important; }
html[data-theme="dark"] .category-name { color: #e5e7eb !important; }
html[data-theme="dark"] .chips-label { color: #9ca3af !important; }
html[data-theme="dark"] .copart-title { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-header .navbar { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-header-wrapper { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-pillars-section { background-color: #0f172a !important; }
html[data-theme="dark"] .dealership-search-console { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-tool-card.tool-calc { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-tool-card.tool-tradein { background-color: #111827 !important; }
html[data-theme="dark"] .dealership-tools-section { background-color: #111827 !important; }
html[data-theme="dark"] .filter-btn { background-color: #0f172a !important; }
html[data-theme="dark"] .financing-hook-box { background-color: #0f172a !important; }
html[data-theme="dark"] .hero-arrow {
  color: #e5e7eb !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
}
html[data-theme="dark"] .hero-arrow:hover {
  color: #ffffff !important;
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
html[data-theme="dark"] .hero-dot.active { background-color: #111827 !important; }
html[data-theme="dark"] .hero-price-card { background-color: #0f172a !important; }
html[data-theme="dark"] .hero-price-row.final-price { color: #e5e7eb !important; }
html[data-theme="dark"] .main-vehicle-stage { background-color: #1f2937 !important; }
html[data-theme="dark"] .nav-link { color: #9ca3af !important; }
html[data-theme="dark"] .nav-menu { background-color: #111827 !important; }
html[data-theme="dark"] .nav-menu .nav-link { color: #e5e7eb !important; }
html[data-theme="dark"] .navbar.scrolled { background-color: #111827 !important; }
html[data-theme="dark"] .pill-title { color: #e5e7eb !important; }
html[data-theme="dark"] .pillar-card { background-color: #111827 !important; }
html[data-theme="dark"] .pillar-title { color: #e5e7eb !important; }
html[data-theme="dark"] .promo-expires .blink { background-color: #111827 !important; }
html[data-theme="dark"] .promo-wide-banner { background-color: #111827 !important; }
html[data-theme="dark"] .repair-pill-item { background-color: #0f172a !important; }
html[data-theme="dark"] .search-chip { background-color: #0f172a !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .search-console-group select { background-color: #0f172a !important; color: #e5e7eb !important; }
html[data-theme="dark"] .search-console-group select:focus { background-color: #111827 !important; }
html[data-theme="dark"] .search-console-tab.active { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .search-console-tabs { background-color: #1f2937 !important; }
html[data-theme="dark"] .search-console-title { color: #e5e7eb !important; }
html[data-theme="dark"] .service-card { background-color: #111827 !important; }
html[data-theme="dark"] .service-card.featured { background-color: #111827 !important; }
html[data-theme="dark"] .services-section { background-color: #111827 !important; }
html[data-theme="dark"] .sort-select { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .spec-dash-cell { background-color: #0f172a !important; }
html[data-theme="dark"] .spec-item { background-color: #0f172a !important; color: #9ca3af !important; }
html[data-theme="dark"] .spec-vin-full { background-color: #0f172a !important; }
html[data-theme="dark"] .stage-bg-blur { background-color: #0f172a !important; }
html[data-theme="dark"] .stat-item { background-color: #111827 !important; }
html[data-theme="dark"] .stats-bar { background-color: #0f172a !important; }
html[data-theme="dark"] .tool-feature-item { background-color: #1f2937 !important; color: #9ca3af !important; }
html[data-theme="dark"] .tool-title { color: #e5e7eb !important; }
html[data-theme="dark"] .trust-strip-item { background-color: #0f172a !important; }
html[data-theme="dark"] .v-thumb-img { background-color: #1f2937 !important; }
html[data-theme="dark"] .vehicle-breadcrumb-bar { background-color: #0f172a !important; }
html[data-theme="dark"] .vehicle-card { background-color: #111827 !important; }
html[data-theme="dark"] .vehicle-card-cta.copart-cta { color: #e5e7eb !important; }
html[data-theme="dark"] .vehicle-commercial-card { background-color: #111827 !important; }
html[data-theme="dark"] .wide-banner-desc { color: #cbd5e1 !important; }
html[data-theme="dark"] .wide-banner-features span { color: #9ca3af !important; }
html[data-theme="dark"] .wide-banner-title { color: #e5e7eb !important; }
html[data-theme="dark"] body.print-mode-quote > #calculadora { background-color: #111827 !important; }
html[data-theme="dark"] body.print-mode-sheet > #printSheet { background-color: #111827 !important; }

/* Botones que son blancos a propósito: se quedan claros con texto oscuro en modo noche. */
html[data-theme="dark"] .btn-nissan-white,
html[data-theme="dark"] .btn-nissan-white span {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Secciones de catálogo, visor 360°, oportunidades y cabecera (desde sus hojas de estilo). */
html[data-theme="dark"] #calculadora .calculator-results { background-color: #111827 !important; }
html[data-theme="dark"] .brand-filter-select { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .btn-card-whatsapp { color: #e5e7eb !important; }
html[data-theme="dark"] .catalog-concierge-card { background-color: #0f172a !important; }
html[data-theme="dark"] .catalog-concierge-card h3 { color: #e5e7eb !important; }
html[data-theme="dark"] .catalog-concierge-card p { color: #9ca3af !important; }
html[data-theme="dark"] .catalog-cta-section { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-filters-container { background-color: #0f172a !important; }
html[data-theme="dark"] .catalog-hero-header { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-hero-title { color: #e5e7eb !important; }
html[data-theme="dark"] .catalog-main-tab { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-main-tab.active { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-main-tab.active .tab-text-wrap span { color: #e5e7eb !important; }
html[data-theme="dark"] .catalog-quickbar { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-section { background-color: #111827 !important; }
html[data-theme="dark"] .catalog-section-header { background-color: #0f172a !important; }
html[data-theme="dark"] .catalog-section-title { color: #e5e7eb !important; }
html[data-theme="dark"] .color-meta-name { color: #e5e7eb !important; }
html[data-theme="dark"] .color-price-delta { color: #e5e7eb !important; }
html[data-theme="dark"] .config-card { background-color: #111827 !important; }
html[data-theme="dark"] .config-title { color: #e5e7eb !important; }
html[data-theme="dark"] .filter-btn { background-color: #111827 !important; color: #9ca3af !important; }
html[data-theme="dark"] .import-notice p { color: #cbd5e1 !important; }
html[data-theme="dark"] .legal-item p { color: #cbd5e1 !important; }
html[data-theme="dark"] .legal-transparency-box { background-color: #111827 !important; }
html[data-theme="dark"] .legal-transparency-header { color: #e5e7eb !important; }
html[data-theme="dark"] .legal-transparency-section { background-color: #0f172a !important; }
html[data-theme="dark"] .model-btn-title { color: #e5e7eb !important; }
html[data-theme="dark"] .model-selector-card { background-color: #111827 !important; }
html[data-theme="dark"] .model-thumb { background-color: #0f172a !important; }
html[data-theme="dark"] .model-toggle-btn { background-color: #111827 !important; }
html[data-theme="dark"] .msrp-price { color: #e5e7eb !important; }
html[data-theme="dark"] .opp-btn--ghost { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .opp-card { background-color: #111827 !important; }
html[data-theme="dark"] .opp-chip { background-color: #1f2937 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .opp-modal__dialog { background-color: #111827 !important; }
html[data-theme="dark"] .opp-modal__title { color: #e5e7eb !important; }
html[data-theme="dark"] .opp-nav { color: #e5e7eb !important; }
html[data-theme="dark"] .opp-spec dd { color: #e5e7eb !important; }
html[data-theme="dark"] .opp-title { color: #e5e7eb !important; }
html[data-theme="dark"] .promo-expires .blink { background-color: #111827 !important; }
html[data-theme="dark"] .quickbar-icon { background-color: #111827 !important; }
html[data-theme="dark"] .quickbar-item { background-color: #0f172a !important; color: #e5e7eb !important; }
html[data-theme="dark"] .quickbar-lead { color: #e5e7eb !important; }
html[data-theme="dark"] .quickbar-text b { color: #e5e7eb !important; }
html[data-theme="dark"] .quickbar-title { color: #e5e7eb !important; }
html[data-theme="dark"] .search-container { background-color: #111827 !important; }
html[data-theme="dark"] .search-container input { color: #e5e7eb !important; }
html[data-theme="dark"] .showcase-360-section { background-color: #111827 !important; }
html[data-theme="dark"] .sort-select { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] .spec-item { background-color: #0f172a !important; }
html[data-theme="dark"] .swatch-item.active .swatch-label { color: #e5e7eb !important; }
html[data-theme="dark"] .swatch-label { color: #9ca3af !important; }
html[data-theme="dark"] .tab-icon-wrap { background-color: #1f2937 !important; }
html[data-theme="dark"] .tab-text-wrap span { color: #e5e7eb !important; }
html[data-theme="dark"] .vehicle-card { background-color: #111827 !important; }
html[data-theme="dark"] .vehicle-card-cta { background-color: #0f172a !important; color: #e5e7eb !important; }
html[data-theme="dark"] .vehicle-card-image { background-color: #1f2937 !important; }
html[data-theme="dark"] .vehicle-card-specs { color: #9ca3af !important; }
html[data-theme="dark"] .vehicle-card-title { color: #e5e7eb !important; }
html[data-theme="dark"] .version-badge-name { color: #e5e7eb !important; }
html[data-theme="dark"] .team-cta-badge { color: #93c5fd !important; }
html[data-theme="dark"] .version-features-list li { color: #9ca3af !important; }
html[data-theme="dark"] body { background-color: #111827 !important; color: #e5e7eb !important; }
html[data-theme="dark"] body.print-mode-quote > #calculadora { background-color: #111827 !important; }
html[data-theme="dark"] body.print-mode-sheet > #printSheet { background-color: #111827 !important; }

/* Fondos de sección: sin degradados claros en modo noche. Las tarjetas conservan su propio fondo. */
html[data-theme="dark"] section,
html[data-theme="dark"] .catalog-hero-header,
html[data-theme="dark"] .footer {
  background: #0b1020 !important;
  background-image: none !important;
}

/* Textos secundarios de las tarjetas de oportunidades: más contraste en modo noche. */
html[data-theme="dark"] .opp-meta,
html[data-theme="dark"] .opp-yard,
html[data-theme="dark"] .opp-lot {
  color: #94a3b8 !important;
}

/* El visor 360° muestra fotos de estudio con fondo claro: se presenta como una tarjeta clara dentro del tema noche. */
html[data-theme="dark"] .showcase-360-container {
  background: #e5e7eb !important;
  border-radius: 20px;
}

/* ===== Contraste en modo noche (auditoría 2026-10-21) ===== */

/* Herramientas ejecutivas: la tarjeta tenía un degradado claro que tapaba el fondo oscuro. */
html[data-theme="dark"] .dealership-tool-card {
  background-image: none !important;
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}
html[data-theme="dark"] .dealership-tool-card .tool-title { color: #f3f4f6 !important; }
html[data-theme="dark"] .dealership-tool-card .tool-desc { color: #cbd5e1 !important; }
html[data-theme="dark"] .dealership-tool-card .tool-badge { color: #93c5fd !important; background: rgba(30, 58, 138, 0.6) !important; }
html[data-theme="dark"] .dealership-tool-card.tool-tradein .tool-badge { color: #6ee7b7 !important; background: rgba(6, 78, 59, 0.6) !important; }
html[data-theme="dark"] .dealership-tool-card.tool-tradein .tool-cta { background: #047857 !important; }

/* Etiquetas de sección (azul oscuro sobre fondo oscuro). */
html[data-theme="dark"] .section-tag { color: #93c5fd !important; }

/* Promociones: precio/subtítulo azul sobre tarjeta oscura. */
html[data-theme="dark"] .promo-card-subtitle { color: #93c5fd !important; }

/* Consola de búsqueda: etiquetas de filtro. */
html[data-theme="dark"] .search-console-group label { color: #94a3b8 !important; }

/* Contacto: tarjetas con texto oscuro sobre fondo oscuro. Los botones conservan su color. */
html[data-theme="dark"] .contact-card-info *:not(i):not(.btn),
html[data-theme="dark"] .contact-card-wa *:not(i):not(.btn):not(.btn-whatsapp) { color: #e5e7eb !important; }

/* Pie de página. */
html[data-theme="dark"] .footer-bottom,
html[data-theme="dark"] .footer-bottom p { color: #9ca3af !important; }

/* ===== Contraste en modo noche (ronda 2, 2026-10-21) ===== */

/* Tarjetas de servicios: la hoja de día pone un degradado claro encima del fondo oscuro. */
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .service-card.featured {
  background-image: none !important;
  background-color: #111827 !important;
}

/* CTA "¿No encuentras el modelo?": quitar el degradado claro de la hoja de día. */
html[data-theme="dark"] .catalog-concierge-card {
  background-image: none !important;
  background-color: #0f172a !important;
  border-color: #1e3a8a !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .catalog-concierge-card p { color: #cbd5e1 !important; }

/* Transparencia legal: las cajas eran azul y verde claros con títulos oscuros. */
html[data-theme="dark"] .legal-item {
  background: rgba(30, 58, 138, 0.25) !important;
  border-color: rgba(147, 197, 253, 0.3) !important;
}
html[data-theme="dark"] .legal-item.national {
  background: rgba(6, 78, 59, 0.3) !important;
  border-color: rgba(110, 231, 183, 0.3) !important;
}
html[data-theme="dark"] .legal-item h4 { color: #93c5fd !important; }
html[data-theme="dark"] .legal-item.national h4 { color: #6ee7b7 !important; }
html[data-theme="dark"] .legal-item p,
html[data-theme="dark"] .legal-item.national p { color: #e2e8f0 !important; }

/* Logos de marcas: la hoja de día los pone en escala de grises, y los negros (Jeep, Infiniti, Kia) se pierden en fondo oscuro. Se muestran en blanco. */
html[data-theme="dark"] .brand-item img {
  filter: brightness(0) invert(1) opacity(0.85) !important;
}
html[data-theme="dark"] .brand-item:hover img {
  filter: brightness(0) invert(1) opacity(1) !important;
}
/* Dodge es un escudo negro con el carnero en blanco: con brillo 0 el carnero se pierde. Solo se invierte. */
html[data-theme="dark"] .brand-item img[alt="Dodge"],
html[data-theme="dark"] .brand-item:hover img[alt="Dodge"] {
  filter: invert(1) opacity(0.9) !important;
}

/* Aviso de precio bajo "Lotes destacados" en modo noche. */
html[data-theme="dark"] .opp-note { color: #94a3b8 !important; }
