/* The phone and tablet menu (below 1024px). The kit's sheet (.nav__links in an accordion) is replaced by
   .mnav, a plain list a visitor reads at a glance: the emergency call first, then the two kinds of work,
   then the rest of the site. The desktop bar (1024 and up) is untouched: .mnav never shows there. */
.mnav { display: none; }

@media (max-width: 1023px) {
  /* the menu button: the icon and a visible word ("Menu", "Fermer" once open; the kit swaps the icon) */
  .nav__toggle {
    width: auto; height: 44px; padding: 0 14px 0 12px; gap: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font: 600 15px/1 var(--font-text); color: var(--ink);
  }
  .nav__toggle::after { content: "Menu"; }
  .nav__toggle[aria-expanded="true"]::after { content: "Fermer"; }
  .nav__toggle svg { flex: none; }
  .nav__toggle:focus-visible, .mnav a:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }

  /* the kit's sheet stays closed: .mnav takes its place */
  .nav.is-open .nav__links, .nav.is-open .nav__actions { display: none; }

  .nav.is-open .mnav {
    display: block; position: fixed; top: var(--nav); left: 0; right: 0; bottom: 0; z-index: 51;
    background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line);
    animation: mnav-in 180ms var(--ease, ease-out) both;
  }
  html:has(body.nav-locked) { overflow: hidden; }

  .mnav__inner { padding-top: 16px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); max-width: 640px; }

  /* 1. the emergency: one big call button */
  .mnav__urgent { background: var(--surface); border-radius: var(--r-md, 12px); padding: 16px; display: grid; gap: 10px; }
  .mnav__kicker { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
  .mnav__call {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 16px;
    border-radius: var(--r-btn, 8px); background: var(--p-accent); color: var(--p-accent-ink, #fff);
    font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap;
  }
  .mnav__call .ic-phone { width: 20px; height: 20px; color: currentColor; }
  .mnav__call:active { filter: brightness(.92); }
  .mnav__note { margin: 0; font-size: 15px; color: var(--ink); text-align: center; }

  /* 2-4. the groups: a small heading, then rows of 56px or more */
  .mnav__group { margin-top: 24px; }
  .mnav__title {
    margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  }
  .mnav__group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
  .mnav__group li { border-bottom: 1px solid var(--line); }
  .mnav__link {
    position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
    align-content: center; min-height: 60px; padding: 10px 4px 10px 12px; color: var(--ink); text-decoration: none;
  }
  .mnav__name { grid-column: 1; font-size: 17px; font-weight: 600; line-height: 1.25; }
  .mnav__line { grid-column: 1; font-size: 14px; line-height: 1.35; color: var(--muted); }
  .mnav__chev { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 16px; height: 16px; color: var(--muted); }
  .mnav__link:active { background: var(--surface); }
  /* the page you are on: an accent bar on the left, a tinted row, the word "ici" for screen and eye alike */
  .mnav__link[aria-current="page"] { background: var(--surface); }
  .mnav__link[aria-current="page"]::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 2px; background: var(--p-accent);
  }
  .mnav__link[aria-current="page"] .mnav__name::after {
    content: "Vous êtes ici"; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); vertical-align: 1px;
  }
}

/* a phone: the bar is the logo and the menu button; the bottom bar keeps its two actions with the icon */
@media (max-width: 639px) {
  .nav__toggle { height: 44px; }
  .actionbar .btn .ic-phone { width: 18px; height: 18px; margin-right: 8px; }
}

@keyframes mnav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .nav.is-open .mnav { animation: none; }
}
@media (scripting: none) { .mnav { display: none !important; } }
