/* ================================================
   HEADER - Navigation principale
   ================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--color-header);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  z-index: 999;
}

.site-header.scrolled {
  background: var(--color-header);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

/* ================================================
   LOGO
   ================================================ */

.logo img {
  height: 3rem;
  width: 7rem;
  transition: opacity 0.3s ease;
}

.logo a:hover img {
  opacity: 0.8;
}

/* ================================================
   WRAPPER MENU + ACTIONS
   ================================================ */

.header-menu-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* ================================================
   NAVIGATION DESKTOP
   ================================================ */

.main-navigation {
  display: flex;
  align-items: center;
}

.menu {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.menu li a {
  position: relative;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.3s ease;
  display: block;
}

.menu li a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, #0170a8, #19b8d8);
  transition: width 0.3s ease;
}

.menu li a:hover::after {
  width: 100%;
}

/* Menu item actif */
.menu li.active > a {
  color: var(--color-accent-start);
}

.menu li.active > a::after {
  width: 100%;
  animation: slideInActive 0.3s ease;
}

@keyframes slideInActive {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

[data-theme='dark'] .menu li.active > a {
  color: var(--color-accent-end);
}

/* ================================================
   ACTIONS (Darkmode + Devis + Burger)
   ================================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Bouton darkmode */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

/* Bouton Devis */
.btn-primary {
  background: linear-gradient(to right, #0170a8, #19b8d8);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(1, 112, 168, 0.3);
}

/* Divider */
.header-divider {
  width: 1px;
  height: 24px;
  background: #d1d5db;
  opacity: 0.8;
}

[data-theme='dark'] .header-divider {
  background: var(--color-text);
}

/* ================================================
   BURGER MENU (caché en desktop)
   ================================================ */

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.mobile-toggle .bar {
  width: 26px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-toggle.open .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.open .bar:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.open .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
/* === RESPONSIVE - TABLETTE (900px) === */

.mobile-cta-wrapper {
  display: none;
}

@media (max-width: 900px) {
  
  .mobile-toggle {
    display: flex;
  }

  .header-actions .btn-primary {
    display: none;
  }

  .main-navigation {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-header);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem 1rem;
    gap: 1.5rem;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s;
    overflow-y: auto;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
    height: 25rem;
  }

  .main-navigation.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .menu {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .menu li {
    width: 100%;
  }

  .menu li a {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    width: 85%;
    text-align: left;
  }

  [data-theme='dark'] .menu li a {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  .menu li a::after {
    display: none;
  }

  .menu li.active > a {
    background: linear-gradient(to right, rgba(1, 112, 168, 0.1), rgba(25, 184, 216, 0.1));
    border-left: 4px solid var(--color-accent-start);
  }

  .mobile-cta-wrapper {
    width: 50%;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-cta-wrapper .btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(1, 112, 168, 0.25);
  }

  .mobile-cta-wrapper .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(1, 112, 168, 0.35);
  }

  .mobile-cta-wrapper::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(
      to right, 
      transparent, 
      rgba(0, 0, 0, 0.1), 
      transparent
    );
    margin: 0.5rem 0;
  }

  [data-theme='dark'] .mobile-cta-wrapper::before {
    background: linear-gradient(
      to right, 
      transparent, 
      rgba(255, 255, 255, 0.1), 
      transparent
    );
  }

  .header-menu-actions {
    gap: 0.5rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-divider {
    display: none;
  }
}

/* === RESPONSIVE - MOBILE (600px) === */

@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }

  .header-inner {
    height: 70px;
  }

  .logo img {
    height: 2.5rem;
    width: auto;
  }

  .main-navigation {
    top: 70px;
  }

  .theme-toggle {
    font-size: 1.1rem;
  }

  .mobile-cta-wrapper {
    padding: 1rem;
  }

  .mobile-cta-wrapper .btn-primary {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
}

/* === OVERLAY BACKDROP === */

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 900px) {
  .mobile-menu-overlay.active {
    display: block;
    opacity: 1;
  }
}
