/*
 Theme Name:     Hello Elementor Child
 Template:       hello-elementor
 Version:        1.0
 Description:    Thème enfant propre basé sur Hello Elementor.
 Author:         ART Serrurerie Multi-Service
*/

/* ===================== FONDATION GLOBALE ===================== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

/* Empêche tout débordement horizontal des éléments enfants */
body * {
  box-sizing: border-box;
}

img,
svg {
  max-width: 100%;
  height: auto;
}


/* ===================== FIX OVERFLOW BODY ===================== */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* ===================== RESET ===================== */
body {
  margin: 0;
  font-family: sans-serif;
}

/* ===================== HEADER ===================== */
.site-header {
  width: 100%;
  max-width: 100vw !important;
  padding: 1rem 2rem;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  gap: 2rem;
}
.site-logo img {
  max-height: 60px;
}

/* ===================== MENU PRINCIPAL - DESKTOP ===================== */
@media screen and (min-width: 1025px) {
  .main-navigation {
    display: flex;
    margin-left: auto;
  }

  .nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    align-items: center;
  }

  .nav-menu li {
    position: relative;
    display: flex;
  }

  .nav-menu li a {
    color: #003366;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    display: block;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  .nav-menu li a:hover,
  .nav-menu li a:focus {
    background-color: #003366;
    color: white;
    border-radius: 0.3rem;
    outline: none;
  }

  .nav-menu li > ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    border-radius: 6px;
    min-width: 220px;
    flex-direction: column;
    z-index: 1000;
  }

  .nav-menu li:hover > ul.sub-menu,
  .nav-menu li:focus-within > ul.sub-menu {
    display: flex;
  }

  .nav-menu li ul.sub-menu li a {
    font-weight: 400;
    padding: 0.5rem 1.2rem;
    color: #003366;
  }

  .nav-menu li ul.sub-menu li a:hover,
  .nav-menu li ul.sub-menu li a:focus {
    background-color: #003366;
    color: white;
    border-radius: 0.3rem;
  }

  .submenu-toggle {
    display: none !important;
  }
}

/* ===================== BOUTON HAMBURGER - MOBILE ===================== */
/* ===================== MENU MOBILE RESPONSIVE ===================== */
@media screen and (max-width: 1024px) {
  .main-navigation {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    gap: 4px;
  }

  .mobile-menu-toggle .hamburger-line {
    width: 24px;
    height: 3px;
    background: #003366;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .mobile-menu {
    display: none;
    flex-direction: column;
    background-color: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 999;
  }

  .mobile-menu.open {
    display: flex !important;
  }

  .mobile-menu li {
    padding: 0.5rem 0;
  }

  .mobile-menu a {
    color: #003366;
    font-weight: 600;
    text-decoration: none;
  }

  .mobile-menu .submenu-toggle {
    display: inline-block;
    background: none;
    border: none;
    font-size: 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
  }
}


/* ===================== ACCESSIBILITÉ BOUTONS ===================== */
button.submenu-toggle,
button.accordion-button,
button.submenu-toggle:focus,
button.accordion-button:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
.submenu-toggle,
.accordion-button {
  border: none;
  background: transparent;
}

/* ===================== FIXES GLOBAUX ===================== */
.carousel-track {
  min-height: 400px !important;
}

/* ===================== ANIMATION AU SCROLL (.fade-zoom) ===================== */
.fade-zoom:not(.in-view) {
  opacity: 0;
  transform: translateY(40px);
}

.fade-zoom.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.65s ease-in-out;
}

.no-scroll {
  overflow: hidden !important;
  height: 100vh;
}

/* ===================== MASQUER LE MENU MOBILE SUR DESKTOP ===================== */
@media screen and (min-width: 1025px) {
  .mobile-menu {
    display: none !important;
  }
}

/* ===================== CORRECTIONS MENU MOBILE ===================== */

/* Scroll du menu mobile s’il dépasse la hauteur de l’écran */
.mobile-menu.open {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
}

/* Sous-menus masqués par défaut sur mobile */
@media screen and (max-width: 1024px) {
  .mobile-menu .sub-menu {
    display: none;
    margin-left: 1rem;
  }

  .mobile-menu .menu-item.open > .sub-menu {
    display: block;
  }
}


