/**
 * MCPRO — Thème clair / sombre (charte #4A2C2A · #E85D04 · #F5F1E8)
 */
html[data-theme="dark"],
body.theme-dark {
  color-scheme: dark;
  --cp-brown: #4a2c2a;
  --cp-orange: #e85d04;
  --cp-orange-light: #f4a261;
  --cp-cream: #f5f1e8;
  --cp-dark: #f5f1e8;
  --cp-text: #f5f1e8;
  --cp-muted: #c9bfb0;
  --cp-bg: #1a1211;
  --cp-surface: #2a1e1c;
  --cp-border: #5e3a37;
  --cp-primary: #f5f1e8;
  --cp-primary-soft: #d4c4b8;
  --mcp-primary: #f5f1e8;
  --mcp-bg: #1a1211;
  --mcp-surface: #2a1e1c;
  --mcp-border: #5e3a37;
  --mcp-accent: #e85d04;
  --cp-accent: #e85d04;
  --cp-accent-light: rgba(232, 93, 4, 0.22);
  --cp-cta: #e85d04;
  --cp-cta-hover: #f4a261;
  --cp-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --cp-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body,
body.theme-dark {
  background: var(--cp-bg);
  color: var(--cp-text);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .main-navbar,
html[data-theme="dark"] .navbar-search-row,
body.theme-dark .site-header,
body.theme-dark .main-navbar,
body.theme-dark .navbar-search-row {
  background: var(--cp-surface);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .nav-menu a,
html[data-theme="dark"] .navbar-icon-link,
html[data-theme="dark"] .navbar-cart,
html[data-theme="dark"] .mcpro-hdr-btn:not(.mcpro-hdr-btn--cat),
body.theme-dark .mcpro-hdr-btn:not(.mcpro-hdr-btn--cat),
html[data-theme="dark"] .cat-hamburger-btn,
html[data-theme="dark"] .nav-mobile-toggle,
html[data-theme="dark"] .navbar-theme-toggle,
html[data-theme="dark"] .lang-switcher-btn,
body.theme-dark .cat-hamburger-btn,
body.theme-dark .nav-mobile-toggle,
body.theme-dark .navbar-theme-toggle,
body.theme-dark .lang-switcher-btn {
  background: #3d2826;
  border-color: var(--cp-border);
  color: var(--cp-cream);
}

html[data-theme="dark"] .search-bar input,
body.theme-dark .search-bar input {
  background: #1a1211;
  border-color: var(--cp-border);
  color: var(--cp-cream);
}

html[data-theme="dark"] .search-bar input::placeholder,
body.theme-dark .search-bar input::placeholder {
  color: #a89888;
  opacity: 1;
}

html[data-theme="dark"] .lang-switcher-menu,
body.theme-dark .lang-switcher-menu {
  background: var(--cp-surface);
  border-color: var(--cp-border);
  color: var(--cp-text);
}

html[data-theme="dark"] .lang-option,
body.theme-dark .lang-option {
  color: var(--cp-text);
}

html[data-theme="dark"] .lang-option:hover,
body.theme-dark .lang-option:hover {
  background: rgba(232, 93, 4, 0.15);
}

html[data-theme="dark"] .btn-primary,
body.theme-dark .btn-primary {
  background: var(--cp-cta);
  border-color: var(--cp-cta);
  color: #fff;
}

html[data-theme="dark"] .btn-primary:hover,
body.theme-dark .btn-primary:hover {
  background: var(--cp-cta-hover);
}

html[data-theme="dark"] .btn-outline,
body.theme-dark .btn-outline {
  color: var(--cp-cream);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .btn-secondary,
body.theme-dark .btn-secondary {
  background: var(--cp-primary-soft);
  color: #fff;
}

html[data-theme="dark"] .badge-stock,
body.theme-dark .badge-stock {
  background: rgba(5, 150, 105, 0.25);
  color: #6ee7b7;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-flat,
html[data-theme="dark"] .pro-panel,
body.theme-dark .card,
body.theme-dark .card-flat,
body.theme-dark .pro-panel {
  background: var(--cp-surface);
  border-color: var(--cp-border);
  color: var(--cp-text);
}

html[data-theme="dark"] .card p,
html[data-theme="dark"] .card-flat p,
html[data-theme="dark"] .pro-panel p,
html[data-theme="dark"] .form-hint,
body.theme-dark .card p,
body.theme-dark .card-flat p,
body.theme-dark .pro-panel p,
body.theme-dark .form-hint {
  color: var(--cp-muted);
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .footer-categories,
body.theme-dark .site-footer,
body.theme-dark .footer-categories {
  background: #140e0d;
  border-color: var(--cp-border);
  color: var(--cp-muted);
}

html[data-theme="dark"] .site-footer h4,
html[data-theme="dark"] .footer-categories strong,
body.theme-dark .site-footer h4,
body.theme-dark .footer-categories strong {
  color: var(--cp-cream);
}

html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .footer-categories a,
body.theme-dark .site-footer a,
body.theme-dark .footer-categories a {
  color: var(--cp-muted);
}

html[data-theme="dark"] .site-footer a:hover,
body.theme-dark .site-footer a:hover {
  color: var(--cp-orange-light);
}

/* Hero sans photo (pages internes) */
html[data-theme="dark"] .hero-pro:not(.hero-pro-cover),
body.theme-dark .hero-pro:not(.hero-pro-cover) {
  background: linear-gradient(135deg, #2a1e1c 0%, #4a2c2a 55%, #1a1211 100%);
  color: var(--cp-cream);
}

/* Accueil — garder la photo avec voile sombre pour lisibilité */
html[data-theme="dark"] .hero-pro.hero-pro-cover,
body.theme-dark .hero-pro.hero-pro-cover {
  background:
    linear-gradient(135deg, rgba(26, 18, 17, 0.68) 0%, rgba(74, 44, 42, 0.52) 50%, rgba(26, 18, 17, 0.74) 100%),
    url("../images/categories/hero-procurement.webp") center center / cover no-repeat;
  color: var(--cp-cream);
}

html[data-theme="dark"] .hero-pro.hero-pro-cover h1,
html[data-theme="dark"] .hero-pro.hero-pro-cover .lead,
html[data-theme="dark"] .hero-pro.hero-pro-cover .badge,
html[data-theme="dark"] .hero-pro.hero-pro-cover .hero-stats span,
body.theme-dark .hero-pro.hero-pro-cover h1,
body.theme-dark .hero-pro.hero-pro-cover .lead,
body.theme-dark .hero-pro.hero-pro-cover .badge,
body.theme-dark .hero-pro.hero-pro-cover .hero-stats span {
  color: #f5f1e8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .hero-pro.hero-pro-cover .badge,
body.theme-dark .hero-pro.hero-pro-cover .badge {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"] .hero-pro .lead,
html[data-theme="dark"] .hero-pro .badge,
body.theme-dark .hero-pro .lead,
body.theme-dark .hero-pro .badge {
  color: var(--cp-muted);
}

@media (max-width: 900px) {
  html[data-theme="dark"] .hero-pro.hero-pro-cover,
  body.theme-dark .hero-pro.hero-pro-cover {
    background:
      linear-gradient(160deg, rgba(26, 18, 17, 0.72) 0%, rgba(74, 44, 42, 0.55) 55%, rgba(26, 18, 17, 0.78) 100%),
      url("../images/categories/hero-procurement.webp") center 35% / cover no-repeat;
  }
}

html[data-theme="dark"] .trust-bar,
body.theme-dark .trust-bar {
  background: var(--cp-surface);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .trust-item strong,
body.theme-dark .trust-item strong {
  color: var(--cp-cream);
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .page-header h1,
body.theme-dark .section-title,
body.theme-dark .page-header h1 {
  color: var(--cp-cream);
}

html[data-theme="dark"] .page-header,
body.theme-dark .page-header {
  background: var(--cp-surface);
  border-color: var(--cp-border);
}

html[data-theme="dark"] body.mcpro-public-site .card-body h3,
html[data-theme="dark"] body.mcpro-public-site .card-body h3 a,
body.theme-dark.mcpro-public-site .card-body h3,
body.theme-dark.mcpro-public-site .card-body h3 a {
  color: var(--cp-cream);
}

html[data-theme="dark"] body.mcpro-public-site .card-meta,
html[data-theme="dark"] body.mcpro-public-site .card-price,
body.theme-dark.mcpro-public-site .card-meta,
body.theme-dark.mcpro-public-site .card-price {
  color: var(--cp-muted);
}

html[data-theme="dark"] .mobile-bottom-nav,
body.theme-dark .mobile-bottom-nav {
  background: var(--cp-surface);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .mobile-nav-item,
body.theme-dark .mobile-nav-item {
  color: var(--cp-muted);
}

html[data-theme="dark"] .cat-drawer,
html[data-theme="dark"] .nav-mobile-drawer,
body.theme-dark .cat-drawer,
body.theme-dark .nav-mobile-drawer {
  background: var(--cp-surface);
  color: var(--cp-text);
}

html[data-theme="dark"] .page-header .breadcrumb,
html[data-theme="dark"] .page-header .breadcrumb a,
body.theme-dark .page-header .breadcrumb,
body.theme-dark .page-header .breadcrumb a {
  color: var(--cp-muted);
}

html[data-theme="dark"] .page-content,
body.theme-dark .page-content {
  background: var(--cp-bg);
  color: var(--cp-text);
}

html[data-theme="dark"] .catalog-filters select,
html[data-theme="dark"] .catalog-filters input[type="number"],
html[data-theme="dark"] .catalog-search-suggest,
body.theme-dark .catalog-filters select,
body.theme-dark .catalog-filters input[type="number"],
body.theme-dark .catalog-search-suggest {
  background: var(--cp-surface);
  color: var(--cp-text);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .site-header--public .navbar-theme-toggle,
body.theme-dark .site-header--public .navbar-theme-toggle {
  pointer-events: auto !important;
  cursor: pointer;
  position: relative;
  z-index: 1501;
}

html[data-theme="dark"] .cat-tile-label,
body.theme-dark .cat-tile-label {
  color: #fff;
}

/* ─── Formulaires : saisie lisible en mode sombre ─── */
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .auth-input-wrap input,
body.theme-dark .form-group input,
body.theme-dark .form-group select,
body.theme-dark .form-group textarea,
body.theme-dark .auth-input-wrap input {
  background: var(--cp-surface);
  color: var(--cp-text);
  border-color: var(--cp-border);
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder,
body.theme-dark .form-group input::placeholder,
body.theme-dark .form-group textarea::placeholder {
  color: var(--cp-muted);
  opacity: 1;
}

/* Barre d'outils catalogue */
html[data-theme="dark"] .shop-toolbar select,
body.theme-dark .shop-toolbar select {
  background: var(--cp-surface);
  color: var(--cp-text);
  border-color: var(--cp-border);
}

/* En-tête du dropdown langue (fond blanc non remplacé par défaut) */
html[data-theme="dark"] .lang-switcher-menu-head,
body.theme-dark .lang-switcher-menu-head {
  background: var(--cp-surface);
  border-color: var(--cp-border);
}

/* Promo-cards et section-sub */
html[data-theme="dark"] .promo-card h3,
body.theme-dark .promo-card h3 {
  color: var(--cp-cream);
}

html[data-theme="dark"] .section-sub,
body.theme-dark .section-sub {
  color: var(--cp-muted);
}
