/* ==========================================================================
   Mobile Menu Sidedraw
   Augments Avada's mobile menu with [navdrawer_sidebar]-style drill-down:
   child menus slide in over the parent, with a Back button per level.

   Everything is scoped under `.nav-drawer-mobile` (a class our JS adds to the
   `.fusion-mobile-nav-holder`). That holder is hidden by Avada above the
   responsive header breakpoint, so these rules are naturally mobile-only — no
   media query needed. We intentionally do NOT restyle item typography/colours;
   those continue to come from Avada's theme options.

   Our JS flattens every submenu out to a direct child of the holder, so the
   holder is the single positioning context for all sliding panels (Avada gives
   each `.fusion-mobile-nav-item` li `position:relative`, which would otherwise
   anchor an overlay to its own li rather than to the menu).
   ========================================================================== */

/* The holder is the panel viewport (positioning + clip context). */
.nav-drawer-mobile {
    position: relative;
    overflow: hidden;
}

/* The base (top-level) menu drives the wrapper height: a full viewport tall. */
.nav-drawer-mobile .nav-drawer-mobile__panel--base {
    min-height: 100vh!important;
}

/* Each child menu becomes a full-height panel that slides in from the right and
   sits OVER the level beneath it. Opaque background so nothing shows through;
   the default #fff matches a light Avada mobile menu — adjust if the menu
   background differs. */
.nav-drawer-mobile .nav-drawer-mobile__panel--overlay {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0 !important;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
}

.nav-drawer-mobile .nav-drawer-mobile__panel--overlay.nav-drawer-mobile__panel--active {
    transform: translateX(0);
}

/* Panel header row (Back button + parent title / View All). It is an <li> so it
   sits validly inside the panel <ul>; reset the list-item chrome. */
.nav-drawer-mobile .nav-drawer-mobile__panel-header {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.nav-drawer-mobile .nav-drawer-mobile__panel-header::before {
    content: none !important; /* defeat any theme list-marker pseudo */
}

/* Back button — mirrors .nav-drawer-sidebar__back-btn (chevron-left glyph). */
.nav-drawer-mobile .nav-drawer-mobile__back {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 5px 0;
    margin: 0;
    cursor: pointer;
    font-size: var(--nav_dropdown_font_size);
    color: #00a8e3;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-drawer-mobile .nav-drawer-mobile__back::before {
    content: '\f053';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
    margin-right: 8px;
}

.nav-drawer-mobile .nav-drawer-mobile__back:hover,
.nav-drawer-mobile .nav-drawer-mobile__back:focus {
    color: #2c4551;
    outline: none;
}

/* Parent title + View All affordance in the panel header. */
.nav-drawer-mobile .nav-drawer-mobile__panel-title {
    flex: 1 1 100%;
    font-weight: 600;
}

.nav-drawer-mobile .nav-drawer-mobile__panel-title > a {
    color: inherit;
    text-decoration: none;
}

.nav-drawer-mobile .nav-drawer-mobile__panel-title .view-all {
    color: #2c4551;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.nav-drawer-mobile .nav-drawer-mobile__panel-title .view-all::after {
    content: '\f0a9';
    margin-left: 6px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.nav-drawer-mobile .nav-drawer-mobile__panel-title .view-all a {
    color: inherit;
    text-decoration: none;
}

/* ---- Indicator: swap Avada's chevron-down for a chevron-right ----
   Avada renders the mobile submenu indicator via `.fusion-open-submenu::before`
   (content "\e61f", awb-icons). Override it to the same Font Awesome chevron-right
   the desktop drawer uses (nav-drawer.css uses "\f054"). */
.nav-drawer-mobile .fusion-open-submenu::before {
    content: '\f054' !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

/* Our drawer-child items already carry an a::after chevron from nav-drawer.css.
   Suppress it inside the mobile menu so it doesn't double up with the
   .fusion-open-submenu button indicator. */
.nav-drawer-mobile .nav-drawer__menu-item--has-children > a::after {
    content: none !important;
}

/* Remove Avada's depth-marker dashes (".fusion-mobile-menu-text-align-* li li a::before"
   → "-", "--", …) and our own left-align ::before markers from nav-drawer.css.
   Flattening already drops most of these (the children are no longer deeply
   nested), but this guarantees a clean menu in every text-align mode. */
.nav-drawer-mobile li.fusion-mobile-nav-item a::before {
    content: none !important;
}

/* Fallback: if a parent has children but Avada did not add a toggle button
   (e.g. mobile submenu slideout disabled), give its link a chevron-right. */
.nav-drawer-mobile li.menu-item-has-children:not(:has(> .fusion-open-submenu)) > a::after,
.nav-drawer-mobile li.nav-drawer__menu-item--has-children:not(:has(> .fusion-open-submenu)) > a::after {
    content: '\f054';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: auto;
    padding-left: 10px;
}

.fusion-mobile-menu-design-modern .fusion-mobile-menu-text-align-left .fusion-open-submenu {
  padding-right: 0!important;
}

.button-icon-divider-left { display: none!important; }