/* Mobile Menu Widget */

/* ── Toggle button ────────────────────────────────────────────────────────── */

.toggle-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0 solid transparent;
  cursor: pointer;
  padding: 15px 20px;
  transition: background-color 0.2s, border-color 0.2s;
}

.toggle-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  transition: color 0.2s;
}
.toggle-menu__icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: fill 0.2s;
}

/* swap open ↔ close icons */
.toggle-menu__icon--close           { display: none; }
.toggle-menu.menu-open .toggle-menu__icon--open  { display: none; }
.toggle-menu.menu-open .toggle-menu__icon--close { display: inline-flex; }

.toggle-menu__text {
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s;
}

/* ── Overlay ──────────────────────────────────────────────────────────────── */

.mobile-menu-overlay {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  width: 100%;
  height: calc(100vh - var(--id-menu-offset, 0px));
  overflow: hidden;
}
.mobile-menu-overlay.is-visible {
  display: block;
}
.mobile-menu-overlay > .d-flex {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Allow level-2 panel to fill the overlay height */
.mobile-menu-header {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.mobile-menu-wrapper {
  height: 100%;
  position: relative;
}

/* ── List wrappers ────────────────────────────────────────────────────────── */

.list-wrapper {
  overflow-y: auto;
}
.list-wrapper > .menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-wrapper > .menu > li {
  overflow: hidden;
}
.list-wrapper > .menu > li.no-children > div {
  padding: 10px;
}
.list-wrapper > .menu > li > a {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  padding: 10px;
}
.list-wrapper > .menu > li > a:hover {}
.list-wrapper > .menu > li > a:after { content: none; }
.list-wrapper > .menu > li.no-children > a .menu-item-icon { display: none; }
.list-wrapper:nth-child(2), .list-wrapper:nth-child(3) {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  transform: translateX(100%);
  backface-visibility: hidden;
  transition: transform 0.5s;
}
.list-wrapper:nth-child(2).is-visible, .list-wrapper:nth-child(3).is-visible {
  transform: none;
}
.list-wrapper-level-2.is-visible {
  height: calc(100vh - var(--id-menu-offset, 0px));
}
.list-wrapper:nth-child(1) > ul > li > .sub-menu,
.list-wrapper:nth-child(1) .level-3,
.list-wrapper:nth-child(2) > ul > li > .sub-menu,
.list-wrapper:nth-child(2) .level-3 {
  display: none;
}

/* ── Nav links ────────────────────────────────────────────────────────────── */

.mobile-menu-wrapper ul a {
  position: relative;
  color: #fff;
  text-decoration: none;
}
.mobile-menu-wrapper ul a:hover,
.mobile-menu-wrapper ul a.is-active {}

/* ── Sub-menu panel ───────────────────────────────────────────────────────── */

.sub-menu-wrapper .subnav-desc {
  padding: 10px;
}
.sub-menu-wrapper .subnav-desc .nav-pane-title {
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.5rem;
}
.sub-menu-wrapper .subnav-desc p {
  font-size: 1rem;
  color: #fff;
}
.sub-menu-wrapper .subnav-desc *:last-child {
  margin-bottom: 0;
}
.sub-menu-wrapper .subnav-wrapper {}

.nav-pane-links > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-pane-links > ul > li > a {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  padding: 10px;
}
.nav-pane-links > ul > li > a:after { content: none; }
.nav-pane-links > ul > li > a:hover {}

/* ── Back button ──────────────────────────────────────────────────────────── */

.back-wrapper {}

.back-one-level {
  display: flex;
  align-items: center;
  color: #fff;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  line-height: 1;
  padding: 10px;
  border-radius: 0;
}
.back-one-level:hover {}

/* ── Menu item icon spans (level 1, level 2, back button) ────────────────── */

.menu-item-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: inherit;
  color: inherit;
  transition: color 0.2s;
}
.menu-item-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: fill 0.2s;
}

/* Push to far end of the flex link */
.list-wrapper > .menu > li > a .menu-item-icon--after,
.nav-pane-links > ul > li > a .menu-item-icon--after {
  margin-left: auto;
}

/* Gap between icon and label */
.back-one-level .menu-item-icon--before { margin-right: 0.5em; }
.back-one-level .menu-item-icon--after  { margin-left: 0.5em; }
