/* Mobile off-canvas navigation (overlay only, no page push) */

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Closed menu must not intercept taps on the header hamburger */
.mobile-nav-overlay:not(.is-open),
.mobile-nav-drawer:not(.is-open) {
    pointer-events: none;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1055;
    width: min(320px, 85vw);
    max-width: 100%;
    background: var(--bg-card, #ffffff);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-nav-drawer.is-open {
    transform: translateX(0);
}

.mobile-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-primary, #1a1a1a);
    border-bottom: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

.mobile-nav-drawer-header .mobile-nav-brand {
    color: var(--theme-accent, #32d74b) !important;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

.mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.2));
    border-radius: 8px;
    background: transparent;
    color: var(--text-inverse, #ffffff);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-close:hover,
.mobile-nav-close:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--theme-accent, #32d74b);
    outline: none;
}

.mobile-nav-drawer-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    flex-shrink: 0;
    border-bottom: 1px solid #e9ecef;
}

.mobile-nav-drawer-actions .btn {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}

.mobile-nav-drawer-actions .modern-btn-outline {
    color: var(--theme-accent, #32d74b) !important;
    background: transparent !important;
    border: 2px solid var(--theme-accent, #32d74b) !important;
}

.mobile-nav-drawer-actions .modern-btn-primary {
    color: var(--theme-primary-dark, #000000) !important;
    background: var(--theme-accent, #32d74b) !important;
    border: 2px solid var(--theme-accent, #32d74b) !important;
}

.mobile-nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer-links {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-nav-drawer-links > li {
    border-bottom: 1px solid #e9ecef;
    list-style: none !important;
}

.mobile-nav-drawer .mobile-nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
    padding: 0.875rem 1.25rem;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary, #333333) !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav-drawer-link:hover,
.mobile-nav-drawer-link:focus,
.mobile-nav-drawer-link.active {
    background: rgba(50, 215, 75, 0.08);
    color: var(--theme-primary-dark, #000000);
    outline: none;
}

.mobile-nav-drawer-link i {
    width: 1.25rem;
    text-align: center;
    color: var(--text-secondary, #666666);
}

.mobile-nav-drawer-link .cart-count,
.mobile-nav-drawer-link .notification-count {
    margin-left: auto;
    background: var(--theme-accent, #32d74b);
    color: var(--theme-primary-dark, #000000);
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.mobile-nav-drawer-logout-form {
    margin: 0;
    padding: 0;
}

.mobile-nav-drawer-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 48px;
    padding: 0.875rem 1.25rem;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text-primary, #333333);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mobile-nav-drawer-logout-btn:hover,
.mobile-nav-drawer-logout-btn:focus {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
    outline: none;
}

body.mobile-menu-open {
    overflow: hidden;
}

/* Mobile top bar */
@media (max-width: 991.98px) {
    .accounts-navbar {
        z-index: 1070 !important;
    }

    .accounts-navbar .mobile-nav-toggle {
        position: relative;
        z-index: 1080;
    }

    .accounts-navbar .accounts-navbar-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 56px;
    }

    .accounts-navbar .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 1;
        margin-right: 0;
    }

    .accounts-navbar .mobile-nav-bar-brand {
        display: block;
        order: 2;
        margin-left: auto;
        margin-right: 0;
        padding: 0;
    }

    .accounts-navbar .accounts-navbar-desktop {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .accounts-navbar .mobile-nav-toggle,
    .accounts-navbar .mobile-nav-bar-brand {
        display: none !important;
    }

    .accounts-navbar .accounts-navbar-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
    }

    .accounts-navbar .accounts-navbar-desktop {
        display: flex !important;
        flex-basis: 100%;
        flex-grow: 1;
    }

    .mobile-nav-overlay,
    .mobile-nav-drawer {
        display: none !important;
    }
}
