/**
 * Advanced Menu — structural styles.
 *
 * Only the mechanics that controls can't express live here (sliding track,
 * accordion expansion, resets, icon rotation). Everything visual is driven by
 * Elementor control selectors and the CSS custom properties below.
 */

.ee-adv-menu {
    /* Defaults; overridden by widget controls. */
    --ee-anim-duration: 350ms;
    --ee-anim-ease: ease;
    --ee-icon-rotate: 90deg;
    --ee-accordion-indent: 16px;

    width: 100%;
    box-sizing: border-box;
}

.ee-adv-menu *,
.ee-adv-menu *::before,
.ee-adv-menu *::after {
    box-sizing: border-box;
}

/* List + item resets */
.ee-adv-menu .ee-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ee-adv-menu .ee-menu-item {
    border-bottom-style: solid;
    border-bottom-width: 0;
    border-bottom-color: transparent;
}

.ee-adv-menu .ee-menu-item:last-child {
    border-bottom-width: 0 !important;
}

/* Row: holds the link/toggle and (optionally) the chevron button */
.ee-adv-menu .ee-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

/* Links and toggle buttons share one look via .ee-menu-link */
.ee-adv-menu .ee-menu-link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.ee-adv-menu .ee-menu-text {
    flex: 1 1 auto;
}

/* The whole-row toggle keeps the chevron pinned to the end */
.ee-adv-menu .ee-menu-toggle {
    justify-content: space-between;
}

/* Dedicated chevron button. Zero the UA button padding/font so a parent row is
   never taller than a plain row; the "Spacing" control sets left/right padding. */
.ee-adv-menu .ee-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: inherit;
    line-height: 0;
}

/* Chevron icon wrapper — rotates when its parent is open */
.ee-adv-menu .ee-submenu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--ee-anim-duration) var(--ee-anim-ease);
    line-height: 0;
    flex: 0 0 auto;
}

/* Icons default to 1em so a chevron never makes a parent row taller than a
   plain row. The size controls (font-size / svg width+height) override this. */
.ee-adv-menu .ee-submenu-icon svg,
.ee-adv-menu .ee-back-icon svg {
    width: 1em;
    height: 1em;
    display: block;
}

.ee-adv-menu .ee-submenu-icon i,
.ee-adv-menu .ee-back-icon i {
    font-size: inherit;
    line-height: 1;
    display: block;
}

.ee-adv-menu .ee-menu-item.is-open > .ee-menu-row .ee-submenu-icon,
.ee-adv-menu [aria-expanded="true"] .ee-submenu-icon {
    transform: rotate(var(--ee-icon-rotate));
}

/* ============================ PAGED ============================ */

.ee-mode-paged .ee-menu-viewport {
    position: relative;
    overflow: hidden;
    transition: height var(--ee-anim-duration) var(--ee-anim-ease);
}

.ee-mode-paged .ee-menu-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    width: 100%;
    transform: translateX(calc(var(--ee-depth, 0) * -100%));
    transition: transform var(--ee-anim-duration) var(--ee-anim-ease);
    will-change: transform;
}

.ee-mode-paged .ee-menu-level {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* Only the active panel within a level is shown */
.ee-mode-paged .ee-menu-panel {
    display: none;
}

.ee-mode-paged .ee-menu-panel.is-active {
    display: block;
}

/* Panel header (back + parent title) */
.ee-mode-paged .ee-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ee-mode-paged .ee-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.ee-mode-paged .ee-back-icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.ee-mode-paged .ee-panel-title {
    /* Size to content so the header Position control (justify-content) can place
       the back button + title as a group (start / center / end / space-between). */
    flex: 0 1 auto;
}

/* ========================== ACCORDION ========================= */

/* grid-template-rows 0fr -> 1fr animates to the natural (auto) height,
   and nests correctly. Older browsers simply collapse without animating. */
.ee-mode-accordion .ee-submenu-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--ee-anim-duration) var(--ee-anim-ease);
}

.ee-mode-accordion .ee-menu-item.is-open > .ee-submenu-wrap {
    grid-template-rows: 1fr;
}

.ee-mode-accordion .ee-submenu-wrap > .ee-menu-list {
    overflow: hidden;
    min-height: 0;
}

/* Progressive indent per nested level. Applied to the list (not the row) so it
   never fights the item-padding control, and compounds automatically as wraps nest. */
.ee-mode-accordion .ee-submenu-wrap > .ee-menu-list {
    padding-left: var(--ee-accordion-indent);
}

/* ========================= EDITOR ============================= */

.ee-adv-menu-notice {
    padding: 20px;
    border: 1px dashed #c5c5c5;
    color: #6d7882;
    text-align: center;
    font-size: 13px;
}
