/* ── Menu Modal — sale dal basso ── */

.appify-menu-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s .35s;
}

.appify-menu-modal.is-open {
    pointer-events: all;
    visibility: visible;
    transition: visibility 0s 0s;
}

.appify-menu-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background .30s cubic-bezier(.4,0,.2,1);
}

.appify-menu-modal.is-open .appify-menu-backdrop {
    background: rgba(0,0,0,.55);
}

.appify-menu-sheet {
    position: absolute;
    bottom: calc(var(--ap-bar-h) + var(--ap-safe)); left: 0; right: 0;
    height: calc(100% - var(--ap-bar-h) - var(--ap-safe));
    background: var(--ap-bg);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.appify-menu-modal.is-open .appify-menu-sheet {
    transform: translateY(0);
}

.admin-bar .appify-menu-sheet {
    top: 32px;
    height: calc(100% - var(--ap-bar-h) - var(--ap-safe) - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .appify-menu-sheet {
        top: 46px;
        height: calc(100% - var(--ap-bar-h) - var(--ap-safe) - 46px);
    }
}

/* Handle */
.appify-menu-handle-wrap { display: none; }
.appify-menu-handle { display: none; }

/* Livelli */
.appify-menu-level {
    position: absolute;
    top: 0;
    bottom: 0; left: 0; right: 0;
    display: flex;
    flex-direction: column;
    background: var(--ap-bg);
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#appify-menu-level-0 {
    position: absolute;
    inset: 0;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.appify-menu-level.is-active {
    transform: translateX(0);
}

#appify-menu-levels {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    pointer-events: none;
}

#appify-menu-levels .appify-menu-level-child {
    pointer-events: all;
    top: 0;
}

/* Header utente */
.appify-menu-header {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--ap-accent);
    display: flex;
    align-items: center;
    gap: 12px;
}

.appify-menu-close {
    order: -1;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform .08s ease-out;
    flex-shrink: 0;
}

.appify-menu-close:active { transform: scale(.88); }
.appify-menu-close svg { stroke: #ffffff; }

.appify-menu-user,
.appify-menu-login-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .12s;
}

.appify-menu-user:active,
.appify-menu-login-cta:active { opacity: .75; }

.appify-menu-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.40);
}

.appify-menu-avatar img { width: 100%; height: 100%; object-fit: cover; }

.appify-menu-avatar span {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.appify-menu-userinfo {
    flex: 1;
    min-width: 0;
}

.appify-menu-username {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appify-menu-useremail {
    font-size: 12px;
    color: rgba(255,255,255,.80);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appify-menu-login-cta {
    font-size: 15px;
    font-weight: 700;
}

.appify-menu-login-icon {
    width: 22px; height: 22px;
    stroke: #fff;
    flex-shrink: 0;
}

.appify-menu-user-arrow {
    width: 13px; height: 13px;
    stroke: rgba(255,255,255,.7);
    flex-shrink: 0;
}

/* Nav */
.appify-menu-nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.appify-menu-section {
    background: var(--ap-card);
    border-top: 1px solid var(--ap-separator);
    border-bottom: 1px solid var(--ap-separator);
    margin-bottom: 16px;
}

.appify-menu-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-muted);
    padding: 12px 16px 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.appify-menu-item {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    text-decoration: none;
    color: #111111;
    font-size: 16px;
    font-weight: 400;
    border-bottom: 1px solid var(--ap-separator);
    -webkit-tap-highlight-color: transparent;
    background: var(--ap-card);
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .10s;
}

.appify-menu-item:last-child { border-bottom: none; }
.appify-menu-item:hover { color: #111111; background: var(--ap-card); }
.appify-menu-item:active { background: var(--ap-separator); }

.appify-menu-item.is-active {
    color: var(--ap-accent);
    font-weight: 500;
}

.appify-menu-item-label { flex: 1; }

.appify-menu-item-arrow {
    width: 14px; height: 14px;
    stroke: #aaaaaa;
    flex-shrink: 0;
}

.appify-menu-item.is-active .appify-menu-item-arrow {
    stroke: var(--ap-accent);
}

/* Sub header */
.appify-menu-sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ap-accent);
    flex-shrink: 0;
}

.appify-menu-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform .08s ease-out;
}

.appify-menu-back-btn:active { transform: scale(.88); }
.appify-menu-back-btn svg { stroke: #ffffff; }

.appify-menu-sub-title {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

/* Footer */
.appify-menu-footer {
    flex-shrink: 0;
    padding: 12px 16px calc(var(--ap-safe) + 12px);
    border-top: 1px solid var(--ap-separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ap-card);
}

.appify-menu-footer-link {
    font-size: 13px;
    color: var(--ap-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.appify-menu-footer-link:active { opacity: .6; }
.appify-menu-logout { color: #c62828; }
.appify-menu-logout svg { width: 13px; height: 13px; stroke: currentColor; }

/* Dark mode */
body.appify-dark .appify-menu-sheet { background: #000000; }
body.appify-dark .appify-menu-handle-wrap { background: #1c1c1e; }
body.appify-dark .appify-menu-handle { background: #3a3a3c; }
body.appify-dark .appify-menu-level { background: #000000; }
body.appify-dark #appify-menu-level-0 { background: #000000; }
body.appify-dark .appify-menu-section { background: #1c1c1e; }
body.appify-dark .appify-menu-item { background: #1c1c1e; color: #f0f0f0; }
body.appify-dark .appify-menu-item:hover { background: #1c1c1e; color: #f0f0f0; }
body.appify-dark .appify-menu-item:active { background: #2c2c2e; }
body.appify-dark .appify-menu-footer { background: #1c1c1e; }

/* ── Shortcode [appify_menu] ── */

.appify-menu-page {
    font-family: inherit;
}

.appify-menu-page-wrap {
    position: relative;
    overflow: hidden;
}

.appify-menu-page-level {
    display: none;
    animation: appify-slide-in .26s cubic-bezier(.4,0,.2,1);
}

.appify-menu-page-level.is-active {
    display: block;
}

@keyframes appify-slide-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

.appify-menu-page-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-muted);
    padding: 12px 0 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.appify-menu-page-section {
    background: var(--ap-card);
    border-top: 1px solid var(--ap-separator);
    border-bottom: 1px solid var(--ap-separator);
    margin-bottom: 16px;
}

.appify-menu-page-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    text-decoration: none;
    color: #111111;
    font-size: 16px;
    font-weight: 400;
    border-bottom: 1px solid var(--ap-separator);
    -webkit-tap-highlight-color: transparent;
    background: var(--ap-card);
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background .10s;
}

.appify-menu-page-item:last-child { border-bottom: none; }
.appify-menu-item:hover,
.appify-menu-page-item:hover { color: #111111 !important; background: var(--ap-card) !important; text-decoration: none !important; }
.appify-menu-page-item:active { background: var(--ap-separator); }
.appify-menu-page-item.is-active,
.appify-menu-page-item.is-active:hover { color: var(--ap-accent) !important; font-weight: 500; }

body.appify-dark .appify-menu-page-item:hover { color: #f0f0f0 !important; background: #1c1c1e !important; }
body.appify-dark .appify-menu-page-item.is-active:hover { color: var(--ap-accent) !important; }

.appify-menu-page-item-label { flex: 1; }

.appify-menu-page-item-arrow {
    width: 14px; height: 14px;
    stroke: #aaaaaa !important;
    flex-shrink: 0;
}

.appify-menu-page-item.is-active .appify-menu-page-item-arrow {
    stroke: var(--ap-accent) !important;
}

.appify-menu-page-sub-header {
    margin-bottom: 8px;
}

.appify-menu-page-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--ap-accent) !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.appify-menu-page-back-btn:active { opacity: .6; }
.appify-menu-page-back-btn svg { stroke: var(--ap-accent); }

/* Dark */
body.appify-dark .appify-menu-page-section { background: #1c1c1e; }
body.appify-dark .appify-menu-page-item { background: #1c1c1e; color: #f0f0f0; }
body.appify-dark .appify-menu-page-item:hover { background: #1c1c1e; color: #f0f0f0; }
body.appify-dark .appify-menu-page-item:active { background: #2c2c2e; }

/* ── Shortcode [appify_user] ── */

.appify-user-widget {
    font-family: inherit;
}

.appify-user-widget-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--ap-accent);
    text-decoration: none;
    border-radius: var(--ap-radius);
    transition: opacity .12s;
    -webkit-tap-highlight-color: transparent;
}

.appify-user-widget-inner:hover,
.appify-user-widget-inner:active {
    opacity: .88;
    text-decoration: none;
}

.appify-user-widget-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.40);
}

.appify-user-widget-avatar img { width: 100%; height: 100%; object-fit: cover; }

.appify-user-widget-avatar span {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.appify-user-widget-avatar--guest svg {
    width: 26px; height: 26px;
    stroke: #ffffff;
}

.appify-user-widget-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.appify-user-widget-name {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appify-user-widget-email {
    font-size: 12px;
    color: rgba(255,255,255,.80);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appify-user-widget-arrow {
    width: 16px; height: 16px;
    stroke: rgba(255,255,255,.70);
    flex-shrink: 0;
}