/* ==========================================================================
   mobile-menu.css
   Drill-down mobile menu for the existing Bootstrap navbar (.web_menu).
   Active only below 1200px (Bootstrap xl). Desktop menu is untouched.
   Colours come from your own variables: --primary, --white, --secondary.
   ========================================================================== */

@media (max-width: 1199.98px) {

  /* ---- 1. The toggler becomes a "☰ MENU" bar (turns into "✕ MENU" when open) ---- */
  .web_menu .navbar .container-fluid {
    justify-content: flex-start !important;
  }
  .web_menu .navbar .navbar-toggler {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 0;
    color: var(--white, #fff);
  }
  .web_menu .navbar .navbar-toggler::after {
    content: "MENU";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .06em;
    line-height: 1;
  }
  .web_menu .navbar .navbar-toggler:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: -3px;
  }
  /* the icon is inverted to white by your existing filter, so any colour works here */
  .web_menu .navbar .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-width='2.4' d='M6 6l18 18M24 6L6 24'/%3E%3C/svg%3E");
  }

  /* ---- 2. The page is pushed to the right while the drawer is open ---- */
  body {
    transition: transform .32s cubic-bezier(.3, .7, .2, 1);
  }
  html.mm-open {
    overflow: hidden;
  }
  html.mm-open body {
    transform: translateX(var(--mm-w));
  }
}

/* ---- 3. Drawer ---- */
.mm-drawer,
.mm-scrim {
  --mm-w: clamp(260px, 80vw, 360px);
  --mm-head: var(--primary, #0b4a9c);
  --mm-bg: #0a2a52;
  --mm-prev: #06193a;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .mm-drawer {
    --mm-bg: color-mix(in srgb, var(--primary, #0b4a9c) 42%, #000);
    --mm-prev: color-mix(in srgb, var(--primary, #0b4a9c) 22%, #000);
  }
}
:root { --mm-w: clamp(260px, 80vw, 360px); }

.mm-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--mm-w);
  z-index: 1050;
  overflow: hidden;
  background: var(--mm-bg);
  color: #fff;
  font-size: 14px;
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.3, .7, .2, 1), visibility 0s linear .32s;
}
html.mm-open .mm-drawer {
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* tap area over the pushed page: closes the menu */
.mm-scrim {
  position: fixed;
  top: 0;
  bottom: 0;
  left: var(--mm-w);
  right: 0;
  z-index: 1049;
  background: rgba(0, 0, 0, .14);
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s, visibility 0s linear .32s;
}
html.mm-open .mm-scrim {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@media (min-width: 1200px) {
  .mm-drawer,
  .mm-scrim { display: none !important; }
}

/* ---- 4. Panels: root list, then each submenu level slides in from the right ---- */
.mm-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--mm-bg);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.3, .7, .2, 1), visibility 0s linear .32s;
}
.mm-panel.is-behind {
  transform: translateX(-100%);
}
.mm-panel.is-active {
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.mm-title {
  flex: none;
  margin: 0;
  padding: 14px 14px;
  background: var(--mm-head);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  overflow-wrap: anywhere;
}
.mm-title:focus { outline: 0; }
.mm-panel[data-root] .mm-title {
  padding: 18px 14px;
  font-size: 18px;
}

.mm-prev {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  background: var(--mm-prev);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.mm-prev::after {
  content: "";
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-left: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.mm-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #9db2d6 transparent;
}
.mm-list::-webkit-scrollbar { width: 6px; }
.mm-list::-webkit-scrollbar-thumb { background: #9db2d6; border-radius: 3px; }
.mm-list > li { border-bottom: 1px solid rgba(255, 255, 255, .09); }

.mm-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  line-height: 1.38;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.mm-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mm-item:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: -3px;
}
.mm-item.has-sub::before {      /* small ‹ in the left gutter marks items that open a submenu */
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border: 2px solid currentColor;
  border-top: 0;
  border-right: 0;
  transform: rotate(45deg);
  opacity: .85;
}
.mm-overview { font-weight: 600; }

.mm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .mm-drawer,
  .mm-scrim,
  .mm-panel { transition: none !important; }
}
