/* ================================================================
   GLOBAL CS — Navigation mobile · mobile-nav.css
   Version 1.1 — 2026
   ----------------------------------------------------------------
   Compatible iOS (Safari) & Android (Chrome / Samsung Internet)
   ================================================================ */

/* ── Par défaut (desktop) : tout masqué ─────────────────────────── */
#m-hamburger,
#m-panel {
  display: none;
}

/* ── Breakpoint mobile (smartphones portrait + paysage) ─────────── */
@media (max-width: 900px) {

  /* ── Logo réduit pour libérer la place du hamburger ─────────── */
  .brand-dot {
    width: 180px;
    height: 32px;
  }
  .nav-in {
    gap: 10px;
    padding: 0 4%;
  }

  /* Masque les items desktop du nav (extension de la règle 720px existante) */
  .nav-links > a:not(.btn-nav) { display: none; }
  .nav-links > .nav-item       { display: none; }
  .nav-links .btn-nav          { display: none; }

  /* La nav-links ne doit pas être écrasée par les éléments masqués */
  .nav-links {
    gap: 8px;
  }

  /* ── Bouton hamburger ───────────────────────────────────────── */
  #m-hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.16);
    border-radius: 7px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    /* Empêche tout effet de iOS "double-tap to zoom" */
    user-select: none;
    -webkit-user-select: none;
  }
  #m-hamburger:active {
    background: rgba(140,191,68,.20);
    border-color: rgba(140,191,68,.45);
  }
  #m-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .15s;
    transform-origin: center;
    pointer-events: none;          /* clic sur span → bubble au button */
  }
  #m-hamburger.m-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  #m-hamburger.m-open span:nth-child(2) {
    opacity: 0;
  }
  #m-hamburger.m-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ── Panneau mobile ─────────────────────────────────────────── */
  #m-panel {
    display: block !important;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a222e;
    z-index: 98;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* État fermé */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                opacity .22s ease,
                visibility 0s linear .28s;
    padding-top: 8px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #m-panel.m-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                opacity .22s ease,
                visibility 0s linear 0s;
  }
  .m-inner {
    padding: 8px 16px 0;
    max-width: 540px;
    margin: 0 auto;
  }

  /* ── Sections accordéon ─────────────────────────────────────── */
  .m-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 6px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 14.5px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-height: 48px;
    user-select: none;
    -webkit-user-select: none;
  }
  .m-toggle > * {
    pointer-events: none;          /* tap sur <span>/<svg> → button */
  }
  .m-toggle:active {
    background: rgba(140,191,68,.08);
  }
  .m-toggle .m-arrow {
    width: 14px;
    height: 14px;
    stroke: rgba(255,255,255,.5);
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .25s, stroke .15s;
    flex-shrink: 0;
  }
  .m-toggle.m-active { color: #8cbf44; }
  .m-toggle.m-active .m-arrow {
    transform: rotate(180deg);
    stroke: #8cbf44;
  }

  /* ── Sous-menus (accordion) ─────────────────────────────────── */
  .m-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4,0,.2,1);
  }
  .m-sub.m-show { max-height: 800px; }
  .m-sub-inner { padding: 6px 0 14px 8px; }
  .m-sub a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 12px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 8px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    transition: background .12s, color .12s;
  }
  .m-sub a:active {
    background: rgba(140,191,68,.13);
    color: #fff;
  }
  .m-sub a::before {
    content: '';
    width: 6px; height: 6px;
    background: rgba(140,191,68,.5);
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .12s;
  }
  .m-sub a:active::before { background: #8cbf44; }

  /* ── Lien simple sans dropdown ──────────────────────────────── */
  .m-link {
    display: flex;
    align-items: center;
    padding: 17px 6px;
    color: #fff;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.07);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    transition: color .12s, background .12s;
  }
  .m-link:active {
    color: #8cbf44;
    background: rgba(140,191,68,.08);
  }

  /* ── CTA final ──────────────────────────────────────────────── */
  .m-cta {
    display: block;
    margin: 22px 6px 8px;
    padding: 15px;
    background: #8cbf44;
    color: #242e3d;
    text-align: center;
    font-weight: 800;
    font-size: 14px;
    border-radius: 9px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, transform .1s;
    box-shadow: 0 4px 14px rgba(140,191,68,.22);
  }
  .m-cta:active {
    background: #9dd050;
    transform: scale(.98);
  }

  /* ── Verrou body quand panel ouvert ─────────────────────────── */
  body.m-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* ── Très petits écrans (< 380 px) ──────────────────────────────── */
@media (max-width: 380px) {
  .brand-dot { width: 150px; height: 28px; }
  .nav-in { padding: 0 3%; gap: 6px; }
  #m-hamburger { width: 40px; height: 40px; }
}
