/* Menu Mobile Premium SFC - Nouvelle Version */

/* Variables de couleurs SFC */
:root {
  --primary: #152fc2;
  --secondary: #1743df;
  --bg: #0F172A;
  --surface: #1E293B;
  --text: #FFFFFF;
  --muted: #CBD5E1;
  --sfc-navy: #061638;
  --sfc-orange: #f47716;
  --sfc-blue: #152fc2;
}

/* 1. Animation du Header - Apparition */
@keyframes fadeSlideTop {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-header {
  animation: fadeSlideTop 0.5s ease-out;
}

/* 2. Animation du Hamburger - Transformation */
.hamburger-btn {
  transition: all 0.3s ease;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: none;
  align-items: center;
  justify-content: center;
}

.hamburger-btn span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--sfc-navy, #061638);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 3. Ouverture du menu - Glassmorphism */
@keyframes menuReveal {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-menu {
  position: fixed;
  top: 72px;
  right: 0;
  bottom: 0;
  width: min(390px, 88vw);
  max-width: 390px;
  background: rgba(6, 22, 56, 0.98);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(21, 47, 194, 0.15);
  animation: menuReveal 0.35s ease;
  z-index: 9997;
  overflow-y: auto;
  padding: 20px;
}

/* Grille technologique en arrière-plan */
.mobile-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(21, 47, 194, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 47, 194, 0.04) 1px, transparent 1px);
  background-size: 25px 25px;
  pointer-events: none;
  z-index: 0;
}

.mobile-menu-content {
  position: relative;
  z-index: 1;
}

/* 4. Animation des liens */
@keyframes itemAppear {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.menu-item {
  opacity: 0;
  transform: translateX(20px);
  animation: itemAppear 0.4s forwards;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.menu-item:nth-child(1) { animation-delay: 0.1s; }
.menu-item:nth-child(2) { animation-delay: 0.15s; }
.menu-item:nth-child(3) { animation-delay: 0.2s; }
.menu-item:nth-child(4) { animation-delay: 0.25s; }
.menu-item:nth-child(5) { animation-delay: 0.3s; }
.menu-item:nth-child(6) { animation-delay: 0.35s; }

.menu-item:hover {
  background: rgba(21, 47, 194, 0.1);
  padding-left: 25px;
}

/* 5. Hover / Touch */
.menu-item:active {
  transform: scale(0.95);
}

/* 6. Sous-menu accordéon */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-left: 20px;
  border-left: 2px solid var(--sfc-orange);
}

.submenu.active {
  max-height: 500px;
}

.submenu-item {
  padding: 12px 20px;
  color: var(--muted);
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: all 0.3s ease;
}

.submenu-item:hover {
  color: var(--primary);
  padding-left: 25px;
}

/* Indicateur de sous-menu */
.submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.submenu-toggle i {
  transition: transform 0.3s ease;
}

.submenu-toggle.active i {
  transform: rotate(180deg);
}

/* 7. Barre inférieure - Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  z-index: 9996;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  transition: all 0.3s ease;
  position: relative;
}

.bottom-nav-item i {
  font-size: 20px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* 8. Indicateur de page active */
.menu-item.active {
  color: var(--primary);
  position: relative;
  background: rgba(21, 47, 194, 0.15);
}

.menu-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--sfc-orange);
  animation: activeLine 0.3s ease forwards;
}

@keyframes activeLine {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Bouton de fermeture du menu */
.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-close:hover {
  background: rgba(244, 119, 22, 0.2);
  border-color: #f47716;
  color: #f47716;
  transform: rotate(90deg);
}

.mobile-menu-close:active {
  transform: rotate(90deg) scale(0.95);
}

/* 9. Bouton WhatsApp flottant */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.whatsapp-float {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 9995;
  animation: pulse 2s infinite;
  transition: all 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

/* Cacher WhatsApp sur desktop */
@media (min-width: 768px) {
  .whatsapp-float {
    display: none;
  }
}

/* Overlay pour le menu mobile */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 15, 38, 0.48);
  backdrop-filter: blur(5px);
  z-index: 9996;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Override pour masquer l'ancien menu mobile */
@media (max-width: 1279px) {
  .sfc-site-header .navbar {
    display: none !important;
  }

  .sfc-site-header .mobile-nav-show,
  .sfc-site-header .mobile-nav-hide {
    display: none !important;
  }

  /* Nouveau bouton hamburger */
  .sfc-site-header .hamburger-btn {
    display: flex !important;
  }

  /* Cacher le bouton CTA sur mobile */
  .sfc-site-header .sfc-header-cta {
    display: none !important;
  }
}

/* Bouton hamburger personnalisé */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10000;
}

@media (max-width: 1279px) {
  .hamburger-btn {
    display: flex !important;
  }
}

/* Mobile fermé par défaut */
.mobile-menu {
  display: none;
}

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

.mobile-menu-overlay.active {
  display: block;
}

/* Responsive ajustements */
@media (max-width: 575px) {
  .mobile-menu {
    top: 64px;
    width: 100%;
    max-width: 100%;
  }

  .whatsapp-float {
    bottom: 70px;
    right: 15px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .bottom-nav {
    padding: 10px 0;
  }

  .bottom-nav-item i {
    font-size: 18px  }
}
