/* ==========================================================================
   ANY AUTOMATION - Modern Industrial Design System
   Charte Graphique Officielle basée sur le Logo ANY AUTOMATION (logo_ANY.png)
   - Bleu Royal Technique (#0056B3) : Précision, Automatisme & Technologie
   - Rouge Vif Dynamique (#E52421) : Énergie, Réactivité & Industrie 4.0
   ========================================================================== */

:root {
  /* COULEURS OFFICIELLES CHARTE ANY AUTOMATION */
  --brand-blue: #0056b3;
  --brand-blue-hover: #004494;
  --brand-blue-light: #e8f1fa;
  --brand-red: #e52421;
  --brand-red-hover: #c81e1b;
  --brand-red-light: #fef2f2;

  /* THÈME CLAIR (DÉFAUT) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;

  --primary: #0056b3;
  --primary-light: #0066ff;
  --primary-dark: #004085;
  --accent: #e52421;
  --accent-glow: rgba(229, 36, 33, 0.2);

  --industrial-orange: #ea580c;
  --industrial-green: #059669;
  --industrial-amber: #d97706;
  --industrial-red: #e52421;
  --industrial-blue: #0056b3;

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;

  --border: rgba(148, 163, 184, 0.28);
  --border-active: rgba(0, 86, 179, 0.38);
  --border-focus: #0056b3;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(0, 86, 179, 0.15);

  --header-bg: rgba(255, 255, 255, 0.94);
  --section-alt-bg: #f1f5f9;
  --ladder-bg: #ffffff;
  --ladder-rail: #94a3b8;
  --ladder-line: #cbd5e1;
  --ladder-box: #f8fafc;
  --grid-line: rgba(15, 23, 42, 0.04);
  --drawer-bg: #ffffff;

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* THÈME SOMBRE */
[data-theme="dark"] {
  --brand-blue: #0066ff;
  --brand-blue-hover: #0052cc;
  --brand-blue-light: rgba(0, 102, 255, 0.15);
  --brand-red: #ff3b38;
  --brand-red-hover: #e52421;
  --brand-red-light: rgba(229, 36, 33, 0.15);

  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);

  --primary: #0066ff;
  --primary-light: #38bdf8;
  --primary-dark: #0052cc;
  --accent: #ff3b38;
  --accent-glow: rgba(255, 59, 56, 0.25);

  --industrial-orange: #f97316;
  --industrial-green: #10b981;
  --industrial-amber: #f59e0b;
  --industrial-red: #ff3b38;
  --industrial-blue: #0066ff;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border: rgba(148, 163, 184, 0.14);
  --border-active: rgba(0, 102, 255, 0.45);
  --border-focus: #0066ff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 102, 255, 0.25);

  --header-bg: rgba(9, 13, 22, 0.88);
  --section-alt-bg: rgba(15, 23, 42, 0.5);
  --ladder-bg: #070b14;
  --ladder-rail: #334155;
  --ladder-line: #334155;
  --ladder-box: #0b1325;
  --grid-line: rgba(255, 255, 255, 0.015);
  --drawer-bg: #0f172a;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Technological Grid Overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

[data-theme="dark"] a:hover {
  color: var(--accent);
}

ul {
  list-style: none;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.section {
  padding: 5rem 0;
  position: relative;
}

.section-alt {
  background-color: var(--section-alt-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Section Headers */
.section-header {
  text-align: center;
  max-width: 760px;
  width: 100%;
  margin: 0 auto 3.5rem auto;
  box-sizing: border-box;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  background: rgba(0, 86, 179, 0.08);
  color: var(--brand-blue);
  border: 1px solid rgba(0, 86, 179, 0.22);
  margin-bottom: 1rem;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}

.badge svg {
  flex-shrink: 0;
}

.badge-red {
  background: rgba(229, 36, 33, 0.08);
  color: var(--brand-red);
  border: 1px solid rgba(229, 36, 33, 0.22);
}

.badge-green {
  background: rgba(5, 150, 105, 0.12);
  color: var(--industrial-green);
  border-color: rgba(5, 150, 105, 0.3);
}

.badge-amber {
  background: rgba(217, 119, 6, 0.12);
  color: var(--industrial-amber);
  border-color: rgba(217, 119, 6, 0.3);
}

.section-title {
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.section-title .text-gradient {
  background: linear-gradient(135deg, var(--brand-blue) 10%, #004ba0 55%, var(--brand-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .section-title .text-gradient {
  background: linear-gradient(135deg, #38bdf8 15%, #60a5fa 55%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #004494 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 86, 179, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #004494 0%, var(--brand-blue) 100%);
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.42);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: linear-gradient(135deg, var(--brand-red) 0%, #c81e1b 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(229, 36, 33, 0.3);
}

.btn-accent:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(229, 36, 33, 0.4);
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: #20ba5a;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

/* ==========================================================================
   Navigation Bar (Inspirée du style AEI Formation - Élégant, Précis & Moderne)
   ========================================================================== */

/* Top Bar (Bandeau Supérieur d'Informations Rapides) */
/* Top Bar (Bandeau Supérieur d'Informations Rapides) */
.top-bar {
  background: var(--section-alt-bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  z-index: 101;
  transition: var(--transition);
}

.top-bar .container,
.site-header .container {
  max-width: 1440px;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  flex-wrap: nowrap;
  gap: 1rem;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.top-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.81rem;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-bar-item span,
.top-bar-item strong {
  white-space: nowrap;
}

.top-bar-item:hover {
  color: var(--primary);
}

.top-bar-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.top-bar-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-bar-tag .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--industrial-green);
  box-shadow: 0 0 6px var(--industrial-green);
}

/* Header Principal */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 0.8rem;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 50px;
  flex-shrink: 0;
}

.logo-img {
  height: 46px;
  width: auto;
  transition: opacity 0.2s ease;
}

/* Desktop Navigation - GARANTIE STRICTEMENT SUR 1 SEULE LIGNE */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.89rem;
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link svg.nav-chevron {
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

/* Effet au survol : CHANGEMENT DE FOND DE COULEUR + COULEUR TEXTE */
.nav-link:hover,
.nav-item-dropdown:hover > .nav-link,
.nav-item-dropdown:focus-within > .nav-link {
  color: var(--brand-blue);
  background: rgba(0, 86, 179, 0.08);
  border-color: rgba(0, 86, 179, 0.18);
  box-shadow: 0 2px 8px rgba(0, 86, 179, 0.08);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-item-dropdown:hover > .nav-link,
[data-theme="dark"] .nav-item-dropdown:focus-within > .nav-link {
  color: #ffffff;
  background: rgba(0, 102, 255, 0.22);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2);
}

/* Bouton actif dans la navigation */
.nav-link.active {
  color: var(--brand-blue);
  background: rgba(0, 86, 179, 0.12);
  border-color: rgba(0, 86, 179, 0.28);
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="dark"] .nav-link.active {
  color: #ffffff;
  background: rgba(0, 102, 255, 0.32);
  border-color: rgba(56, 189, 248, 0.4);
  white-space: nowrap;
}

/* Dropdown Menus (Style AEI Formation) */
.nav-item-dropdown {
  position: relative;
}

.nav-item-dropdown:hover .nav-link svg.nav-chevron,
.nav-item-dropdown:focus-within .nav-link svg.nav-chevron {
  transform: rotate(180deg);
  color: var(--brand-blue);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  min-width: 370px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  overflow: hidden;
}

/* Signature bicolore (Rouge ANY + Bleu AUTOMATION) en haut du sous-menu */
.dropdown-menu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-blue) 100%);
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-active);
  border-top: 1px solid var(--border-active);
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s ease;
  position: relative;
  z-index: 1;
}

.dropdown-item:hover {
  background: rgba(0, 86, 179, 0.07);
}

.dropdown-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 86, 179, 0.1);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: var(--transition);
}

.dropdown-item:hover .dropdown-icon {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

.dropdown-content {
  flex-grow: 1;
}

.dropdown-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.dropdown-footer {
  margin-top: 0.6rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
  font-size: 0.78rem;
}

.dropdown-footer a {
  color: var(--brand-blue);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s ease;
}

.dropdown-footer a:hover {
  color: var(--brand-red);
}

.nav-badge-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--brand-red);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(229, 36, 33, 0.35);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Header CTA Button (Style AEI Formation) */
.header-cta-btn {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #004494 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 14px rgba(0, 86, 179, 0.32);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.header-cta-btn:hover {
  background: linear-gradient(135deg, var(--brand-red) 0%, #c81e1b 100%);
  box-shadow: 0 6px 18px rgba(229, 36, 33, 0.4);
  transform: translateY(-2px);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--border-active);
  background: var(--bg-secondary);
}

/* Currency Switcher */
.currency-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
}

.currency-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.currency-btn.active {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 86, 179, 0.35);
}

/* Quote Cart trigger */
.cart-trigger-btn {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition);
}

.cart-trigger-btn:hover {
  border-color: var(--brand-blue);
  background: var(--bg-secondary);
}

.cart-badge {
  background: var(--brand-red);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(229, 36, 33, 0.35);
}

/* Mobile Toggle */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Nav Drawer - Masqué par défaut sur PC / grand écran */
.mobile-nav-drawer {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 5rem 0 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.hero-title {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
  color: var(--text-main);
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
  max-width: 100%;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 100%;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.highlight-item svg {
  color: var(--industrial-green);
  flex-shrink: 0;
}

/* Hero Simulator Preview Frame */
.hero-visual {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.simulator-hero-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.simulator-hero-card::before {
  content: "APERÇU TECHNIQUE INTERACTIF";
  position: absolute;
  top: -12px;
  right: 24px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red));
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 86, 179, 0.35);
  white-space: nowrap;
  z-index: 5;
}

/* ==========================================================================
   Stats Banner
   ========================================================================== */
.stats-banner {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #004494 50%, var(--brand-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .stat-num {
  background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 50%, #ff5252 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   4 Pillars Grid
   ========================================================================== */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-blue));
  opacity: 0;
  transition: var(--transition);
}

.pillar-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-icon-box {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  background: rgba(0, 86, 179, 0.1);
  border: 1px solid rgba(0, 86, 179, 0.22);
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.pillar-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

.pillar-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.pillar-list {
  margin-bottom: 1.5rem;
}

.pillar-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.pillar-list li svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ==========================================================================
   Interactive PLC Simulator Widget
   ========================================================================== */
.sim-panel {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
}

.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2rem;
}

.sim-plc-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.plc-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: var(--transition);
}

.plc-led.led-green.active {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.plc-led.led-amber.active {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.plc-led.led-cyan.active {
  background: #0284c7;
  box-shadow: 0 0 10px #0284c7;
}

.sim-body {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 1.5rem;
}

.sim-col-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  text-align: center;
  font-weight: 700;
}

/* Control Buttons & Inputs */
.sim-io-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sim-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.sim-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-active);
}

.sim-btn.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.sim-btn.btn-emergency.active {
  background: rgba(220, 38, 38, 0.15);
  border-color: var(--industrial-red);
  color: var(--industrial-red);
}

/* Central Ladder Diagram */
.sim-ladder-diagram {
  background: var(--ladder-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 220px;
}

.ladder-rung {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0.8rem 0;
  width: 100%;
  box-sizing: border-box;
}

.ladder-rail {
  width: 4px;
  height: 54px;
  background: var(--ladder-rail);
  border-radius: 2px;
  flex-shrink: 0;
  z-index: 1;
}

.ladder-rail-left,
.ladder-rail-right {
  /* In-flow flex items positioned at start and end of rung */
}

.ladder-branch {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 2;
}

.lbl-desktop {
  display: inline;
}

.lbl-mobile {
  display: none;
}

.ladder-line {
  height: 2px;
  background: var(--ladder-line);
  flex-grow: 1;
  position: relative;
  transition: var(--transition);
}

.ladder-line.active {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.5);
}

.ladder-element {
  background: var(--ladder-box);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: bold;
  text-align: center;
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.ladder-element.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(2, 132, 199, 0.1);
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.25);
}

.ladder-element.coil.active {
  border-color: var(--industrial-green);
  color: var(--industrial-green);
  background: rgba(5, 150, 105, 0.1);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.25);
}

/* Outputs Indicators */
.sim-indicator {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: var(--transition);
  font-weight: 600;
}

.sim-indicator.active {
  background: rgba(5, 150, 105, 0.15);
  border-color: var(--industrial-green);
  color: var(--industrial-green);
}

.sim-indicator.active.alarm {
  background: rgba(220, 38, 38, 0.15);
  border-color: var(--industrial-red);
  color: var(--industrial-red);
}

.sim-footer-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 1rem;
}

/* ==========================================================================
   Card Grids: Formations, Composants, Livres
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.catalog-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.card-header-banner {
  padding: 1.4rem;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.06), rgba(241, 245, 249, 0.8));
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

[data-theme="dark"] .card-header-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(15, 23, 42, 0.8));
}

.card-body {
  padding: 1.6rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.4rem;
  flex-grow: 1;
}

.card-specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.4rem;
  border: 1px solid var(--border);
}

.spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.spec-label {
  color: var(--text-dim);
}

.spec-val {
  color: var(--text-main);
  font-weight: 600;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.price-box {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.price-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Quiz Widget
   ========================================================================== */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red));
  width: 20%;
  transition: width 0.3s ease;
}

.quiz-question-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-option-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 500;
}

.quiz-option-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-active);
}

.quiz-option-btn.selected {
  background: rgba(0, 86, 179, 0.1);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 600;
}

.quiz-nav-btns {
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   Concours Automatisme Section
   ========================================================================== */
.concours-box {
  background: linear-gradient(135deg, var(--bg-secondary), rgba(2, 132, 199, 0.08));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 3rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.laureat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.laureat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.medal-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.medal-1 {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid #f59e0b;
}

.medal-2 {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  border: 1px solid #94a3b8;
}

[data-theme="dark"] .medal-2 {
  color: #cbd5e1;
}

/* ==========================================================================
   Quotation Cart Drawer Modal
   ========================================================================== */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 460px;
  height: 100%;
  background: var(--drawer-bg);
  border-left: 1px solid var(--border);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  box-shadow: var(--shadow-lg);
  visibility: hidden;
}

.cart-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  font-size: 1.4rem;
  line-height: 1;
}

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

.cart-items-list {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-empty-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.cart-item-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-item-info {
  flex-grow: 1;
  padding-right: 0.8rem;
}

.cart-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 700;
}

.cart-remove-btn {
  background: transparent;
  border: none;
  color: var(--industrial-red);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.3rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.cart-total-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-total-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Filter Buttons Bar
   ========================================================================== */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  justify-content: center;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
  color: var(--primary);
  border-color: var(--border-active);
}

.filter-btn.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 86, 179, 0.35);
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  width: 100%;
}

.form-full {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-select {
  cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Contact Page Grid & Cards */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 2.5rem;
  align-items: flex-start;
  width: 100%;
}

.contact-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

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

.contact-billing-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
}

/* Pillar Variants */
.pillars-3 {
  grid-template-columns: repeat(3, 1fr);
}

.pillars-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  border: 1px solid var(--primary);
  color: #ffffff;
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #090d16;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4.5rem 0 2rem 0;
  position: relative;
  z-index: 1;
  color: #f8fafc;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 1.2rem;
}

.footer-col-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #38bdf8;
  transform: translateX(4px);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}

.footer-contact-item svg {
  color: #38bdf8;
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* Universal Grid Child Containment Rule */
.hero-grid > *,
.cards-grid > *,
.pillars-grid > *,
.stats-grid > *,
.footer-grid > *,
.contact-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 3rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sim-body {
    grid-template-columns: 1fr;
  }

  .concours-box {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .pillars-3,
  .pillars-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Adaptation Laptops (1025px - 1300px) : aucun retour à la ligne toléré */
@media (max-width: 1300px) {
  .nav-desktop {
    gap: 0.15rem;
  }

  .nav-link {
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
  }

  .top-bar-tag {
    display: none;
  }

  .header-cta-btn {
    padding: 0.5rem 0.95rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 1100px) {
  /* Masque le 2e email dans la top-bar pour laisser une aisance totale sur écrans moyens */
  .top-bar-left a:nth-child(2) {
    display: none;
  }
}

/* Bascule Tablettes & Mobiles (<= 1024px) */
@media (max-width: 1024px) {
  .top-bar {
    display: none;
  }

  .header-cta-btn {
    display: none;
  }

  .nav-desktop {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  /* Mobile Nav Drawer */
  .mobile-nav-drawer {
    display: flex;
    position: fixed;
    top: 78px;
    left: 0;
    width: 100%;
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-active);
    padding: 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateY(-120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
  }

  .mobile-nav-drawer.open {
    transform: translateY(0);
  }
}

/* Tablettes et Écrans Moyens (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .hero-section {
    padding: 3.5rem 0 2.5rem 0;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pillars-grid,
  .pillars-3,
  .pillars-4 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }

  .pillar-card {
    padding: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-full {
    grid-column: span 1;
  }

  .contact-form-card {
    padding: 1.8rem 1.4rem;
  }

  .contact-info-card,
  .contact-billing-card {
    padding: 1.5rem 1.2rem;
  }

  .cart-drawer {
    max-width: 100%;
  }

  .mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
  }

  .mobile-nav-drawer .nav-link {
    white-space: normal;
    width: 100%;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    box-sizing: border-box;
  }

  .mobile-nav-group-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.06em;
    margin-top: 0.6rem;
    margin-bottom: 0.1rem;
    padding-left: 0.4rem;
  }

  .mobile-nav-sublink {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: var(--transition);
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
  }

  .mobile-nav-sublink:hover {
    color: var(--primary);
    background: rgba(0, 86, 179, 0.08);
  }
}

/* Smartphones Portables (<= 480px) - Optimisé pour 360px x 713px */
@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .section {
    padding: 2.8rem 0;
  }

  /* Header & Navigation */
  .header-inner {
    height: 64px;
    gap: 0.4rem;
  }

  .logo-link {
    height: 38px;
  }

  .logo-img {
    height: 34px;
    max-width: 125px;
    width: auto;
    object-fit: contain;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .cart-trigger-btn {
    padding: 0.45rem 0.65rem;
    gap: 0.35rem;
    font-size: 0.8rem;
  }

  .cart-trigger-btn span:not(.cart-badge) {
    display: none;
  }

  .mobile-menu-btn {
    padding: 0.35rem;
  }

  /* Mobile Drawer */
  .mobile-nav-drawer {
    top: 64px;
    max-height: calc(100vh - 64px);
    padding: 1rem 0.85rem;
    gap: 0.35rem;
  }

  .mobile-drawer-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-drawer-header span {
    font-size: 0.88rem !important;
  }

  .mobile-nav-group-title {
    font-size: 0.68rem;
    margin-top: 0.5rem;
  }

  .mobile-nav-drawer .nav-link {
    padding: 0.5rem 0.65rem;
    font-size: 0.88rem;
  }

  .mobile-nav-drawer .mobile-nav-sublink {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Badge mobile */
  .badge {
    font-size: 0.68rem;
    padding: 0.35rem 0.65rem;
    line-height: 1.35;
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    white-space: normal;
  }

  .badge svg {
    flex-shrink: 0;
  }

  /* Hero Section */
  .hero-section {
    padding: 2rem 0 1.6rem 0;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 2rem;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero-title {
    font-size: clamp(1.42rem, 6.2vw, 1.75rem);
    line-height: 1.22;
    margin-bottom: 0.9rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }

  .hero-lead {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.4rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }

  .btn {
    white-space: normal;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-lg {
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.6rem;
    width: 100%;
    max-width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    box-sizing: border-box;
  }

  .hero-highlights {
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1.2rem;
    width: 100%;
    max-width: 100%;
  }

  .highlight-item {
    font-size: 0.82rem;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
  }

  /* Simulator Card & Ladder */
  .simulator-hero-card {
    padding: 1.15rem 0.55rem 0.75rem 0.55rem;
    border-radius: var(--radius-md);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .simulator-hero-card::before {
    font-size: 0.60rem;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    padding: 2px 10px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .sim-panel {
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.6rem;
    margin-bottom: 0.75rem;
  }

  .sim-plc-status {
    gap: 0.35rem;
  }

  .sim-plc-status span {
    font-size: 0.74rem !important;
  }

  .plc-led {
    width: 8px;
    height: 8px;
  }

  .sim-body {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .sim-body > div {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .sim-col-title {
    font-size: 0.70rem;
    margin-bottom: 0.4rem;
  }

  .sim-io-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
  }

  .sim-btn {
    padding: 0.42rem 0.65rem;
    font-size: 0.76rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
  }

  .sim-btn span:first-child {
    font-weight: 700;
  }

  .sim-btn span:last-child {
    font-size: 0.66rem !important;
    opacity: 0.75;
  }

  .sim-indicator {
    padding: 0.42rem 0.65rem;
    font-size: 0.76rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .sim-indicator svg {
    width: 16px;
    height: 16px;
  }

  .sim-ladder-diagram {
    padding: 0.6rem 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .ladder-rung {
    width: 100%;
    padding: 0.35rem 0;
    box-sizing: border-box;
  }

  .ladder-rail {
    width: 3px;
    height: 52px;
  }

  .ladder-line {
    flex: 1 1 6px;
    min-width: 4px;
  }

  .ladder-branch {
    gap: 0.35rem;
  }

  .ladder-element {
    padding: 2px 4px;
    font-size: 0.63rem;
    min-width: 52px;
    white-space: nowrap;
    letter-spacing: -0.01em;
    user-select: none;
    -webkit-user-select: none;
  }

  .lbl-desktop {
    display: none;
  }

  .lbl-mobile {
    display: inline;
  }

  .sim-footer-note {
    font-size: 0.66rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    line-height: 1.35;
  }

  /* Stats Grid */
  .stats-banner {
    padding: 1.5rem 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .stat-num {
    font-size: 1.7rem;
  }

  .stat-label {
    font-size: 0.76rem;
  }

  /* Section Titles */
  .section-title {
    font-size: clamp(1.45rem, 6vw, 1.75rem);
    line-height: 1.22;
    word-break: break-word;
  }

  .section-desc {
    font-size: 0.92rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  /* Catalog Cards (Formations, Composants, Livres) */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .catalog-card {
    border-radius: var(--radius-md);
  }

  .card-header-banner {
    padding: 0.9rem 1rem;
  }

  .card-body {
    padding: 1.1rem 1rem;
  }

  .card-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
  }

  .card-desc {
    font-size: 0.88rem;
    margin-bottom: 1rem;
  }

  .card-specs {
    padding: 0.65rem 0.8rem;
    margin-bottom: 1rem;
  }

  .spec-item {
    font-size: 0.78rem;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .card-footer .price-box {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .card-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }

  /* Pillars */
  .pillars-grid,
  .pillars-3,
  .pillars-4 {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .pillar-card {
    padding: 1.2rem 1rem;
    border-radius: var(--radius-md);
  }

  .pillar-title {
    font-size: 1.1rem;
  }

  .pillar-text {
    font-size: 0.88rem;
  }

  /* Quiz Widget */
  .quiz-container {
    padding: 1.2rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .quiz-question-title {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }

  .quiz-option-btn {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .quiz-nav-btns {
    flex-direction: column;
    gap: 0.6rem;
  }

  .quiz-nav-btns .btn {
    width: 100%;
  }

  /* Concours Box */
  .concours-box {
    padding: 1.2rem 0.85rem;
    border-radius: var(--radius-md);
    gap: 1.5rem;
  }

  .laureat-card {
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
  }

  .medal-badge {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  /* Filters Bar */
  .filters-bar {
    gap: 0.35rem;
    margin-bottom: 1.5rem;
  }

  .filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
  }

  /* Forms */
  .contact-form-card {
    padding: 1.25rem 0.85rem;
  }

  .contact-info-card,
  .contact-billing-card {
    padding: 1.2rem 0.85rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Empêche le zoom auto sur mobile */
    padding: 0.7rem 0.85rem;
  }

  /* Cart Drawer Mobile */
  .cart-drawer {
    max-width: 100vw;
  }

  .cart-header {
    padding: 1rem 0.85rem;
  }

  .cart-body {
    padding: 0.85rem;
  }

  .cart-footer {
    padding: 1rem 0.85rem;
  }

  .cart-item-row {
    padding: 0.75rem;
  }

  .cart-item-title {
    font-size: 0.88rem;
  }

  /* Footer */
  .site-footer {
    padding: 3rem 0 1.5rem 0;
  }

  .footer-grid {
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding-top: 1.5rem;
  }
}

/* Optimisation chirurgicale Ultra-Mobile (360px x 713px et inférieurs) */
@media (max-width: 360px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .logo-img {
    max-width: 112px;
    height: 30px;
  }

  .cart-trigger-btn {
    padding: 0.35rem 0.5rem;
  }

  .hero-title {
    font-size: 1.38rem;
    line-height: 1.22;
  }

  .card-body {
    padding: 1rem 0.8rem;
  }

  .pillar-card {
    padding: 1rem 0.8rem;
  }

  .stat-num {
    font-size: 1.5rem;
  }

  /* Simulator Card Ultra-Mobile 360px */
  .simulator-hero-card {
    padding: 1.1rem 0.35rem 0.6rem 0.35rem;
  }

  .sim-panel {
    padding: 0.65rem 0.35rem;
  }

  .ladder-rung {
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0;
  }

  .ladder-element {
    font-size: 0.60rem;
    min-width: 48px;
    padding: 1px 2px;
  }

  .sim-btn {
    padding: 0.38rem 0.5rem;
    font-size: 0.72rem;
  }

  .sim-indicator {
    padding: 0.38rem 0.5rem;
    font-size: 0.72rem;
  }
}