/**
 * Unified Hamburger Menu — funktioniert auf Desktop, Tablet, Mobile und WebView.
 *
 * Vorher: app-menu war nur in der nativen WebView-App sichtbar.
 * Jetzt: Hamburger-Drawer auf ALLEN Plattformen — einheitliche Nav-UX.
 *
 * @license Kommerzielle Nutzung nur mit gueltiger Lizenz von 4Unit Systems Integration GmbH
 */

/* ============================================================
 * Hamburger-Button im Header (Desktop + Mobile sichtbar)
 * ============================================================ */
.unified-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    color: currentColor;
    transition: background-color 0.15s ease;
}

.unified-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.unified-menu-btn:focus {
    outline: 2px solid var(--theme-primary, #E87722);
    outline-offset: 2px;
}

.unified-menu-btn svg {
    width: 24px;
    height: 24px;
}

/* ============================================================
 * Slide-In-Drawer
 * ============================================================ */
.app-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    animation: unified-menu-fade-in 0.2s ease;
}

.app-menu-overlay.open {
    display: block;
}

@keyframes unified-menu-fade-in {
    from { background: rgba(0, 0, 0, 0); }
    to   { background: rgba(0, 0, 0, 0.5); }
}

.app-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    animation: unified-menu-slide-in 0.25s ease;
}

@keyframes unified-menu-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.app-menu-header {
    position: relative;
    background: var(--theme-primary, #E87722);
    color: #fff;
    padding: 24px 20px;
    padding-top: calc(24px + env(safe-area-inset-top));
}

.app-menu-header h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 600;
}

.app-menu-header small {
    opacity: 0.85;
    font-size: 0.85rem;
}

.app-menu-close {
    position: absolute;
    top: 14px;
    right: 14px;
    top: calc(14px + env(safe-area-inset-top));
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-menu-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.app-menu-items {
    padding: 8px 0;
}

.app-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.12s ease;
}

.app-menu-item:hover,
.app-menu-item:active {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.app-menu-item.active {
    background: rgba(232, 119, 34, 0.08);
    color: var(--theme-primary, #E87722);
    font-weight: 500;
}

.app-menu-item svg {
    width: 20px;
    height: 20px;
    color: #888;
    flex-shrink: 0;
}

.app-menu-item .fi {
    width: 1.4em;
    flex-shrink: 0;
}

.app-menu-divider {
    height: 8px;
    background: #f5f5f5;
}

/* Body-Scroll-Lock waehrend Menu offen ist */
body.menu-open {
    overflow: hidden;
}
