/* ============================================================
   RMG Menu Manager — Functional CSS
   ------------------------------------------------------------
   This file contains ONLY rules required for JavaScript features
   to work correctly (tab show/hide, modal positioning, sticky
   tabs, button reset, search no-results visibility).
   No colors, fonts, sizes, spacing, or visual treatment. All
   styling is the responsibility of the per-menu CSS editor
   or theme-level CSS.
   ============================================================ */

/* Tab panels — only the visible one renders */
.rmg-menu-tabs__panel { display: none; }
.rmg-menu-tabs__panel--active { display: block; }

/* ============================================================
   Sticky tab nav

   The sticky nav requires that no ancestor sets overflow to
   anything other than visible — `hidden`, `auto`, and `scroll`
   all kill position:sticky on descendants.

   We can't control the theme/Elementor wrappers higher up, but
   we can guarantee our own containers don't trap sticky. The
   `overflow: visible` declarations below are defensive and
   should not be removed.

   Offset is set per-menu via --rmg-sticky-offset on the wrapper.
   Sticky behavior applies on all viewports unless the menu is
   opted into --desktop-only (which hides the nav entirely on
   mobile, making sticky moot there).
   ============================================================ */

.rmg-menu-wrapper,
.rmg-menu-tabs {
    overflow: visible;
}

.rmg-menu-tabs__nav {
    position: -webkit-sticky;  /* iOS Safari prefix */
    position: sticky;
    top: var(--rmg-sticky-offset, 0px);
    z-index: 50;
}

/* Mobile tabs disabled at <= 768px when per-menu opted in */
@media (max-width: 768px) {
    .rmg-menu-tabs--desktop-only .rmg-menu-tabs__nav { display: none; }
    .rmg-menu-tabs--desktop-only .rmg-menu-tabs__panel { display: block; }
}

/* Image trigger button reset — must look like a plain wrapper, not a button.
   Required so the modal click target doesn't visually intrude. */
.rmg-menu__item-image-trigger {
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
    display: block;
    font: inherit;
    color: inherit;
    text-align: inherit;
}

/* Modal positioning and open/close — required for the modal to function */
.rmg-menu__modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}
.rmg-menu__modal[aria-hidden="false"] {
    display: flex;
}

/* Body scroll lock when modal is open */
body.rmg-menu__modal-open {
    overflow: hidden;
}

/* Search "no results" message — hidden until search returns empty */
.rmg-menu__no-results { display: none; }
