/* =========================================
   MIGATEC SA — Feuille de style principale
   ========================================= */

:root {
  --primary:       #1B3A6B;   /* Bleu marine Migatec */
  --primary-dark:  #122850;
  --primary-light: #2A5298;
  --accent:        #C0392B;   /* Rouge acier */
  --accent-light:  #E74C3C;
  --bg:            #F4F6FA;
  --bg-dark:       #0F1E36;
  --white:         #FFFFFF;
  --gray-100:      #F8F9FC;
  --gray-200:      #E9ECF2;
  --gray-400:      #9AA3B5;
  --gray-600:      #5A6478;
  --gray-800:      #2C3347;
  --text:          #1A2035;
  --shadow-sm:     0 2px 8px rgba(27,58,107,0.08);
  --shadow-md:     0 6px 24px rgba(27,58,107,0.12);
  --shadow-lg:     0 16px 48px rgba(27,58,107,0.18);
  --radius:        8px;
  --radius-lg:     16px;
  --transition:    0.25s ease;
  --max-width:     1200px;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--primary); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p  { color: var(--gray-600); }

/* ---- UTILITY ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-dark { background: var(--bg-dark); }
.section-gray { background: var(--gray-100); }

.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-header { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-header p { margin-top: 0.75rem; font-size: 1.05rem; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-ghost:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

/* ========================================
   TOPBAR (notification)
   ======================================== */
.topbar {
  background: var(--accent);
  color: var(--white);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.topbar a { color: inherit; text-decoration: underline; }

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary-dark);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  height: 52px;
  gap: 1.5rem;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 1.25rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  height: 100%;
}
.navbar-logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
}

/* Liens */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  height: 100%;
}
.nav-links li {
  height: 100%;
  display: flex;
  align-items: center;
}
.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  padding: 0 0.7rem;
  white-space: nowrap;
  transition: color var(--transition);
  letter-spacing: 0.01em;
}
/* Underline animé */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.7rem;
  right: 0.7rem;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover {
  color: var(--white);
}
.nav-links a:hover::after {
  transform: scaleX(1);
}
.nav-links a.active {
  color: var(--white);
  font-weight: 600;
}
.nav-links a.active::after {
  transform: scaleX(1);
}

/* Actions droite */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.nav-phone {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  transition: color var(--transition);
}
.nav-phone:hover { color: var(--white); }
.nav-phone svg { width: 13px; height: 13px; fill: var(--accent); flex-shrink: 0; }
.nav-devis {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.nav-devis:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192,57,43,0.4);
}

/* ---- Burger ---- */
.burger {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.burger:hover { background: rgba(255,255,255,0.12); }
.burger-box {
  position: relative;
  width: 20px;
  height: 14px;
}
.burger span {
  position: absolute;
  left: 0;
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 6px; }
.burger span:nth-child(3) { top: 12px; }

/* Burger ouvert → croix */
.burger.open span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---- Mobile menu ---- */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-dark);
  border-top: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  opacity: 0;
}
.mobile-menu.open {
  display: flex;
  max-height: 600px;
  opacity: 1;
}
.mobile-nav-links {
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.06);
  border-left-color: var(--accent);
}
.mobile-nav-links a.active {
  font-weight: 600;
}
.mobile-menu-footer {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.mobile-menu-footer .mob-phone {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  font-weight: 600;
}
.mobile-menu-footer .mob-phone svg { width: 16px; height: 16px; fill: var(--accent); }
.mobile-menu-footer .mob-devis {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.mobile-menu-footer .mob-devis:hover { background: var(--accent-light); }

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 40%, var(--primary) 100%);
  color: var(--white);
  padding: 6rem 0 5rem;
  min-height: 520px;
  display: flex;
  align-items: center;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.hero h1 { color: var(--white); margin-bottom: 1.25rem; max-width: 700px; }
.hero p  { color: rgba(255,255,255,0.75); font-size: 1.15rem; max-width: 580px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-inner {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary-dark) 60%, var(--primary) 100%);
  color: var(--white);
  padding: 4rem 0 3rem;
}
.hero-inner .container { display: flex; align-items: center; gap: 1rem; }
.hero-inner h1 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.4rem); }
.hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.75rem;
}
.hero-breadcrumb a { color: rgba(255,255,255,0.6); }
.hero-breadcrumb a:hover { color: white; }
.hero-breadcrumb span { color: rgba(255,255,255,0.4); }

/* ========================================
   CARDS
   ======================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}
.card-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}
.card h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.card p { font-size: 0.9rem; }
.card ul {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card ul li {
  font-size: 0.875rem;
  color: var(--gray-600);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.card ul li::before {
  content: '›';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ========================================
   STATS BAR
   ======================================== */
.stats-bar {
  background: var(--primary);
  color: var(--white);
  padding: 2.5rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  text-align: center;
}
.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   ABOUT SECTION (homepage)
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-text h2 { margin-bottom: 1rem; }
.about-text p  { margin-bottom: 1rem; }
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.tag {
  background: var(--bg);
  border: 1px solid var(--gray-200);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}
.about-image-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.about-image-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.about-image-icon {
  font-size: 5rem;
  position: relative;
  opacity: 0.8;
}

/* ========================================
   TABLE
   ======================================== */
.machines-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.9rem;
}
thead {
  background: var(--primary);
  color: var(--white);
}
thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-100); }
tbody td {
  padding: 0.9rem 1.25rem;
  color: var(--gray-600);
}
tbody td:first-child { color: var(--text); font-weight: 500; }
.table-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 0.75rem;
  font-style: italic;
}
.machine-cat {
  background: var(--primary);
  color: var(--white) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem !important;
}

/* ========================================
   MACHINE GALLERY
   ======================================== */
.machine-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.machine-card {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition);
}
.machine-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-3px);
}
.machine-card img {
  height: 120px;
  width: 100%;
  object-fit: contain;
  margin-bottom: 0.75rem;
}
.machine-card span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}

/* ========================================
   CONTACT PAGE
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: start;
}
.contact-info-card {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.contact-info-card h3 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 2rem;
}
.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: flex-start;
}
.contact-item-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.contact-item-text { font-size: 0.9rem; color: rgba(255,255,255,0.85); }
.contact-item-text strong { display: block; color: var(--white); margin-bottom: 0.2rem; }
.contact-item-text a { color: rgba(255,255,255,0.85); transition: color var(--transition); }
.contact-item-text a:hover { color: var(--white); }

.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}
.map-wrap iframe {
  width: 100%;
  height: 420px;
  border: none;
  display: block;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-200);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--gray-600); font-weight: 600; margin-bottom: 0.5rem; }
.empty-state p  { color: var(--gray-400); font-size: 0.9rem; }

/* ========================================
   CTA SECTION
   ======================================== */
.cta-secti