/* ============================================================
   BURGER MENU MODERNE - Remplacement du select mobile
   Compatible avec le thème existant (couleurs, fonts)
   Breakpoint : max-width 768px
   ============================================================ */

/* ---- Bouton burger (caché sur desktop) ---- */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.burger-btn:hover,
.burger-btn:focus {
  background: rgba(255, 111, 8, 0.15);
  outline: none;
}

/* Les trois barres */
.burger-btn .bar {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.25s ease,
    width 0.25s ease;
  transform-origin: center;
}

.burger-btn .bar + .bar {
  margin-top: 6px;
}

/* Animation croix quand ouvert */
.burger-btn.is-open .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-btn.is-open .bar:nth-child(2) {
  opacity: 0;
  width: 0;
}

.burger-btn.is-open .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---- Overlay sombre derrière le menu ---- */
.burger-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.burger-overlay.is-visible {
  display: block;
  opacity: 1;
}

/* ---- Panneau de navigation mobile ---- */
.mobile-nav-panel {
  display: none; /* caché sur desktop */
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  max-width: 90vw;
  height: 100%;
  background: #1a1a1a;
  z-index: 1060;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-panel.is-open {
  transform: translateX(0);
}

/* En-tête du panneau */
.mobile-nav-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: #111;
  border-bottom: 2px solid #ff6f08;
  min-height: 60px;
}

.mobile-nav-panel__logo {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.mobile-nav-panel__close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.mobile-nav-panel__close:hover {
  background: rgba(255, 111, 8, 0.2);
  color: #ff6f08;
}

/* Numéro de téléphone en haut du panneau */
.mobile-nav-panel__phone {
  display: block;
  padding: 12px 18px;
  background: #ff6f08;
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none !important;
  letter-spacing: 0.5px;
  transition: background 0.2s ease;
}

.mobile-nav-panel__phone:hover {
  background: #e05e00;
  color: #fff !important;
}

/* ---- Liste de navigation principale ---- */
.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin: 0;
}

/* Lien de premier niveau */
.mobile-nav-list > li > .mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: #e8e8e8 !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;

  letter-spacing: 0.4px;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  cursor: pointer;
}

.mobile-nav-list > li > .mobile-nav-link:hover,
.mobile-nav-list > li.is-active > .mobile-nav-link {
  background: rgba(255, 111, 8, 0.12);
  color: #ff6f08 !important;
}

.mobile-nav-list > li.is-active > .mobile-nav-link {
  color: #ff6f08 !important;
}

/* Flèche pour les items avec sous-menu */
.mobile-nav-link__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: #888;
}

.mobile-nav-link__arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rotation de la flèche quand sous-menu ouvert */
.mobile-nav-list > li.submenu-open > .mobile-nav-link .mobile-nav-link__arrow {
  transform: rotate(180deg);
  color: #ff6f08;
}

/* ---- Sous-menus ---- */
.mobile-nav-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #111;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-nav-submenu.is-open {
  max-height: 1000px; /* valeur large pour l'animation */
}

.mobile-nav-submenu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-nav-submenu li:last-child {
  border-bottom: none;
}

.mobile-nav-submenu a {
  display: block;
  padding: 10px 18px 10px 18px;
  color: #b0b0b0 !important;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none !important;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    padding-left 0.2s ease;
  position: relative;
}

/* .mobile-nav-submenu a::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #555;
  transition: background 0.2s ease;
} */

.mobile-nav-submenu a:hover {
  background: rgba(255, 111, 8, 0.08);
  color: #fff !important;
  padding-left: 36px;
}

.mobile-nav-submenu a:hover::before {
  background: #ff6f08;
}

/* Lien "DEVIS GRATUIT" dans le sous-menu */
.mobile-nav-submenu a.devis-link {
  color: #ff6f08 !important;
  font-weight: 600;
}

.mobile-nav-submenu a.devis-link::before {
  background: #ff6f08;
}

/* ---- Bouton DEVIS GRATUIT en bas du panneau ---- */
.mobile-nav-panel__cta {
  padding: 18px 18px 100px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 8px;
}

.mobile-nav-panel__cta a {
  display: block;
  padding: 14px;
  background: #ff6f08;
  color: #fff !important;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 4px;
  text-decoration: none !important;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}

.mobile-nav-panel__cta a:hover {
  background: #e05e00;
  transform: translateY(-1px);
}

header {
  height: auto;
}

#logo img {
  max-width: 200px;
}

/* ============================================================
   MEDIA QUERIES
   ============================================================ */

@media (max-width: 959px) {
  /* Afficher le bouton burger */
  .burger-btn {
    display: flex;
  }

  /* Afficher le panneau mobile */
  .mobile-nav-panel {
    display: block;
  }

  /* Masquer le menu desktop (superfish) */
  nav#main_menu {
    display: none !important;
  }

  /* Masquer le select généré par superfish (au cas où) */
  select#mobileMenu_mm1,
  select.mobileMenu {
    display: none !important;
  }

  /* Ajustement du header pour le burger */
  #header .container {
    position: relative;
    /*min-height: 60px;*/
  }

  /* Réduire le logo sur mobile */
  #logo {
    float: none !important;
    text-align: left;
    padding-right: 60px; /* espace pour le burger */
  }

  #logo img {
    max-height: 55px;
    margin: 8px;
    width: auto;
  }

  /* Masquer le numéro de tel dans la topnav (il est dans le panneau) */
  .topnav.navRight {
    display: none;
  }
}

@media (min-width: 960px) {
  /* S'assurer que le panneau est caché sur desktop */
  .mobile-nav-panel,
  .burger-overlay,
  .burger-btn {
    display: none !important;
  }
}

@media (max-width: 959px) {
  #mainbody .row {
    display: flex;
    flex-direction: column;
  }

  #mainbody .span9 {
    order: 1;
  }

  #mainbody .span3 {
    order: 2;
  }
}
