/* ═══════════════════════════════════════════════════════════════════════════
   MENU MOBILE — VITA  /menumob/menumob.css
   Breakpoint mobile Divi 5 : 767px
═══════════════════════════════════════════════════════════════════════════ */

/* Masqué par défaut sur tous les écrans — affiché uniquement via JS + mobile */
#vita-mobile-overlay {
  display: none !important;
}

/* Bouton hamburger masqué par défaut sur desktop */
.vita-mob-hamburger {
  display: none !important;
}

@media (max-width: 767px) {

  /* Réactivation de l'overlay sur mobile (géré par JS via les classes open/closed) */
  #vita-mobile-overlay {
    display: flex !important;
  }

  /* Bouton hamburger visible sur mobile */
  .vita-mob-hamburger {
    display: flex !important;
  }

  /* ── Body bloqué quand menu ouvert ───────────────────────────────────── */
  body.vita-no-scroll {
    overflow: hidden !important;
  }


  /* ── Bouton hamburger (col. 3 header Divi) ───────────────────────────── */
  .vita-mob-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    z-index: 99998;
    position: relative;
  }

  .vita-burger-icon {
    width: 44px;
    height: auto;
    display: block;
  }

  /* État fermé : icône burger visible, icône close masquée */
  .vita-burger-open   { display: none  !important; }
  .vita-burger-closed { display: block !important; }

  /* État ouvert : swap des icônes */
  .vita-mob-hamburger[aria-expanded="true"] .vita-burger-closed { display: none  !important; }
  .vita-mob-hamburger[aria-expanded="true"] .vita-burger-open   { display: block !important; }


  /* ── Overlay principal ───────────────────────────────────────────────── */
  /* top et height calculés dynamiquement par JS via --vita-header-h         */
  #vita-mobile-overlay {
    position: fixed !important;
    top: var(--vita-header-h, 0px) !important;
    left: 0;
    width: 100vw !important;
    height: calc(100vh   - var(--vita-header-h, 0px)) !important;
    height: calc(100dvh  - var(--vita-header-h, 0px)) !important; /* exclut la barre URL mobile */
    background: #A50042 !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important; /* le scroll est géré par .vita-mob-inner */
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* États ouvert / fermé */
  #vita-mobile-overlay.vita-mob-closed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
  }
  #vita-mobile-overlay.vita-mob-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }


  /* ── Zone scrollable (tout le contenu du menu) ──────────────────────── */
  .vita-mob-inner {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 28px 20px 40px !important;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }


  /* ── Formulaire de recherche ─────────────────────────────────────────── */
  .vita-mob-search form {
    display: flex !important;
    align-items: center;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 50px !important;
    padding: 0 8px 0 18px !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
  }

  .vita-mob-search input[type="search"] {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 15px !important;
    padding: 12px 0 !important;
    -webkit-appearance: none;
  }

  .vita-mob-search input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.65) !important;
  }

  /* Masque le bouton natif clear sur WebKit */
  .vita-mob-search input[type="search"]::-webkit-search-cancel-button {
    display: none !important;
  }

  .vita-mob-search button[type="submit"] {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #fff !important;
    padding: 10px 8px !important;
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }


  /* ── Navigation principale ───────────────────────────────────────────── */
  .vita-mob-nav {
    width: 100% !important;
  }

  .vita-mob-list,
  .vita-mob-list ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Séparateur entre items de niveau 0 */
  .vita-mob-list > .vita-mi {
    border-bottom: 0px solid rgba(255, 255, 255, 0.18) !important;
  }
  .vita-mob-list > .vita-mi:first-child {
    border-top: 0px solid rgba(255, 255, 255, 0.18) !important;
  }

  /* Bouton parent (non cliquable) */
  .vita-mob-list .vita-parent {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    padding: 18px 0 !important;
    cursor: pointer;
    text-align: left !important;
    transition: color 0.2s ease;
    font-family: inherit !important;
  }

  /* Lien simple de niveau 0 (sans enfants) */
  .vita-mob-list > .vita-mi > a {
    display: block !important;
    color: #fff !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    padding: 18px 0 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
  }
  .vita-mob-list > .vita-mi > a:hover {
    color: #FFC300 !important;
  }

  /* Liens enfants (niveau 1) */
  .vita-mob-list .vita-sub a {
    display: block !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    padding: 6px 0px !important;
    text-decoration: none !important;
    border-bottom: 0px solid rgba(255, 255, 255, 0.1) !important;
    transition: color 0.2s ease;
  }
  .vita-mob-list .vita-sub a:hover {
    color: #FFC300 !important;
  }
  .vita-mob-list .vita-sub li:last-child > a {
    border-bottom: none !important;
  }

  /* Sous-menu accordion (max-height pilotée par JS) */
  .vita-mob-list .vita-sub {
    overflow: hidden;
    transition: max-height 0.35s ease !important;
    padding-left: 8px !important;
    max-height: 0;
  }

  /* Chevron */
  .vita-chevron {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid rgba(255, 255, 255, 0.8);
    transform: rotate(-45deg);
    transition: transform 0.3s ease, border-color 0.2s ease;
    flex-shrink: 0;
    margin-right: 4px;
  }

  /* État ouvert du parent */
  .vita-open > .vita-parent {
    color: #FFC300 !important;
  }
  .vita-open > .vita-parent .vita-chevron {
    transform: rotate(45deg) !important;
    border-color: #FFC300 !important;
  }


  /* ── Sélecteur de langue ─────────────────────────────────────────────── */
  .vita-mob-lang {
    padding-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  }

  .vita-mob-lang-list {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .vita-mob-lang-list li a {
    display: inline-block !important;
    padding: 7px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 4px !important;
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    transition: all 0.2s ease;
  }

  .vita-mob-lang-list .vita-lang-active a,
  .vita-mob-lang-list li a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #FFC300 !important;
    border-color: #FFC300 !important;
  }


  /* ── Masquer le menu desktop Divi sur mobile ─────────────────────────── */
  /* Ajouter la classe CSS "menu-desktop-row" à la row Divi contenant le Mega Menu */
  .menu-desktop-row {
    display: none !important;
  }

} /* fin @media 767px */