/* ==========================================================================
   FLEXIONEX — MOBILE NAVIGATION
   Full-screen drawer, three-level accordion, focus trapped while open.
   ========================================================================== */

.fx-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: var(--fx-mobilenav-z);
  display: flex;
  flex-direction: column;
  background: var(--fx-white);

  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform  var(--fx-dur) var(--fx-ease-in-out),
    visibility var(--fx-dur) var(--fx-ease-in-out);
}

.fx-mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
}

@media (min-width: 1024px) {
  .fx-mobile-nav { display: none; }
}

/* ── HEAD ────────────────────────────────────────────────────────────── */

.fx-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-s4);
  height: var(--fx-header-h-mobile);
  padding-inline: var(--fx-gutter);
  border-bottom: 1px solid var(--fx-border);
  flex-shrink: 0;
}

/* ── BODY ────────────────────────────────────────────────────────────── */

.fx-mobile-nav__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-block: var(--fx-s3);
}

/* ── ACCORDION ITEM ──────────────────────────────────────────────────── */

.fx-macc__item { border-bottom: 1px solid var(--fx-border); }

.fx-macc__trigger,
.fx-macc__direct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-s4);
  width: 100%;
  min-height: 56px;
  padding: var(--fx-s4) var(--fx-gutter);

  font-size: var(--fx-text-base);
  font-weight: 600;
  color: var(--fx-text-strong);
  text-align: start;
  text-decoration: none;
}

.fx-macc__trigger:hover,
.fx-macc__direct:hover { background: var(--fx-bg-subtle); }

.fx-macc__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--fx-steel-500);
  transition: transform var(--fx-dur) var(--fx-ease-in-out);
}

.fx-macc__trigger[aria-expanded="true"] .fx-macc__icon {
  transform: rotate(180deg);
  color: var(--fx-orange-400);
}

/* Collapsible panel — grid-rows technique animates without fixed heights */
.fx-macc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--fx-dur) var(--fx-ease-in-out);
}

.fx-macc__panel > * { overflow: hidden; }

.fx-macc__trigger[aria-expanded="true"] + .fx-macc__panel {
  grid-template-rows: 1fr;
}

.fx-macc__panel-inner {
  padding-block-end: var(--fx-s3);
  background: var(--fx-bg-subtle);
}

/* Level 2 */
.fx-macc__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fx-s3);
  min-height: 48px;
  padding: var(--fx-s3) var(--fx-gutter);
  padding-inline-start: calc(var(--fx-gutter) + var(--fx-s4));

  font-size: var(--fx-text-sm);
  font-weight: 500;
  color: var(--fx-text);
  text-decoration: none;
}

.fx-macc__link:hover { color: var(--fx-orange-400); }

/* Level 3 */
.fx-macc__sublink {
  display: block;
  min-height: 44px;
  padding: var(--fx-s2) var(--fx-gutter);
  padding-inline-start: calc(var(--fx-gutter) + var(--fx-s6));

  font-size: var(--fx-text-sm);
  color: var(--fx-text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.fx-macc__sublink:hover { color: var(--fx-orange-400); }

/* Group label inside a panel */
.fx-macc__group-label {
  padding: var(--fx-s4) var(--fx-gutter) var(--fx-s2);
  padding-inline-start: calc(var(--fx-gutter) + var(--fx-s4));
  font-size: var(--fx-text-2xs);
  font-weight: 600;
  letter-spacing: var(--fx-tracking-wide);
  text-transform: uppercase;
  color: var(--fx-text-subtle);
}

/* ── FOOT ────────────────────────────────────────────────────────────── */

.fx-mobile-nav__foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--fx-s3);
  padding: var(--fx-s5) var(--fx-gutter);
  padding-block-end: max(var(--fx-s5), env(safe-area-inset-bottom));
  border-top: 1px solid var(--fx-border);
  background: var(--fx-white);
}

.fx-mobile-nav__lang {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fx-s2);
}

.fx-mobile-nav__lang a {
  padding: var(--fx-s2) var(--fx-s3);
  font-size: var(--fx-text-sm);
  color: var(--fx-text-muted);
  text-decoration: none;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-xs);
  min-height: var(--fx-touch-min);
  display: inline-flex;
  align-items: center;
}

.fx-mobile-nav__lang a[aria-current="true"] {
  color: var(--fx-text-strong);
  border-color: var(--fx-navy-800);
  font-weight: 600;
}

/* Prevent background scroll while the drawer is open */
body.fx-nav-open { overflow: hidden; }
