/* ============================================================
   Extended Mobile Menu — Widget Styles  v1.002
   ============================================================ */

/* ── Nav wrapper ─────────────────────────────────────────── */
.emm-nav {
    width: 100%;
    position: relative;
}

/* ── Top-level item row ──────────────────────────────────── */
.emm-nav > .emm-item {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Nested item rows (same layout) */
.emm-submenu .emm-item {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

/* ── Link ────────────────────────────────────────────────── */
.emm-link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    text-decoration: none;
    padding: 12px 16px;
    transition: color 0.22s ease, background-color 0.22s ease;
    cursor: pointer;
    line-height: 1.4;
}

/* label grows → indicator pushed to right end */
.emm-label {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Indicator inside <a> — always far right */
.emm-link .emm-indicator {
    flex: 0 0 auto;
    margin-left: auto;
}

/* ── Toggle button (follow_link mode) ───────────────────── */
.emm-toggle-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 14px;
    line-height: 1;
    align-self: stretch;
    transition: background-color 0.18s ease;
}

.emm-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ── Indicator icon (shared) ─────────────────────────────── */
.emm-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color     0.22s ease;
    will-change: transform;
    line-height: 1;
    pointer-events: none;
}

.emm-indicator svg,
.emm-indicator i {
    display: block;
}

/* ── Animation states ────────────────────────────────────── */

[data-animation="rotate_cw"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="rotate_cw"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: rotate(180deg);
}

[data-animation="rotate_ccw"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="rotate_ccw"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: rotate(-180deg);
}

[data-animation="flip_x"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="flip_x"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: scaleY(-1);
}

[data-animation="flip_y"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="flip_y"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: scaleX(-1);
}

[data-animation="rotate_90"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="rotate_90"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: rotate(90deg);
}

[data-animation="rotate_90ccw"] .emm-item.is-open > .emm-link .emm-indicator,
[data-animation="rotate_90ccw"] .emm-item.is-open > .emm-toggle-btn .emm-indicator {
    transform: rotate(-90deg);
}

/* ── Submenu container ───────────────────────────────────── */
.emm-submenu {
    width: 100%;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
        max-height  var(--emm-duration, 300ms) cubic-bezier(0.4, 0, 0.2, 1),
        opacity     var(--emm-duration, 300ms) ease,
        transform   var(--emm-duration, 300ms) cubic-bezier(0.4, 0, 0.2, 1),
        visibility  0s linear var(--emm-duration, 300ms);
}

.emm-submenu.is-open {
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        max-height  var(--emm-duration, 300ms) cubic-bezier(0.4, 0, 0.2, 1),
        opacity     var(--emm-duration, 300ms) ease,
        transform   var(--emm-duration, 300ms) cubic-bezier(0.4, 0, 0.2, 1),
        visibility  0s linear 0s;
}

.emm-item.is-open > .emm-submenu {
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.emm-submenu .emm-submenu {
    margin-left: 12px;
}

/* ── Accessibility ───────────────────────────────────────── */
.emm-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.emm-toggle-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
