/* ============================================ */
/* Mobile Navigation — Hamburger + Controls     */
/* ============================================ */

/* ── Hamburger Button (Left) ── */
.mobile-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1002;
}

.mobile-hamburger .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main, #1D1D1F);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin: 5px auto;
}

.mobile-hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Right Controls (Theme + Language) ── */
.mobile-nav-controls {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-lang-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--text-sub, #86868b);
    background: transparent;
    color: var(--text-main, #1D1D1F);
    font-size: 11px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    letter-spacing: 0.02em;
}

.mobile-lang-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-lang-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--bg-base, #F5F5F7);
}

[data-theme="dark"] .mobile-lang-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Mobile Drawer ── */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 1001;
    background: var(--bg-base, #F5F5F7);
    flex-direction: column;
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mobile-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--stroke-struct, rgba(0, 0, 0, 0.06));
}

.mobile-nav-drawer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main, #1D1D1F);
}

.mobile-nav-drawer-close svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-drawer-links {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 2rem;
    gap: 0;
}

.mobile-nav-drawer-links a {
    display: block;
    padding: 18px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main, #1D1D1F);
    text-decoration: none;
    border-bottom: 1px solid var(--stroke-struct, rgba(0, 0, 0, 0.06));
    letter-spacing: 0.01em;
    transition: color 0.2s;
}

.mobile-nav-drawer-links a:last-child {
    border-bottom: none;
}

.mobile-nav-drawer-links a.active {
    color: var(--accent, #667eea);
}

.mobile-nav-drawer-links a:active {
    opacity: 0.6;
}

.mobile-nav-drawer-cta {
    padding: 1.5rem 2rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.mobile-nav-drawer-cta a {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: var(--text-main, #1D1D1F);
    color: var(--bg-base, #F5F5F7);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.mobile-nav-drawer-cta a:active {
    opacity: 0.7;
}

/* ── Mobile Override: Navbar layout ── */
@media (max-width: 768px) {
    .mobile-hamburger {
        display: block;
    }

    .mobile-nav-controls {
        display: flex;
    }

    .mobile-nav-drawer {
        display: flex;
    }

    .navbar {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.75rem 1rem !important;
        gap: 0 !important;
    }

    /* Hide desktop nav links on mobile */
    .nav-links {
        display: none !important;
    }

    /* Logo: center between hamburger and controls */
    .logo-container {
        flex: 1;
        justify-content: center;
    }

    /* Keep logo compact */
    .logo-svg {
        width: 28px !important;
        height: 28px !important;
    }

    .logo-text {
        font-size: 1.1rem !important;
    }
}

@media (min-width: 769px) {
    .mobile-hamburger {
        display: none !important;
    }

    .mobile-nav-controls {
        display: none !important;
    }

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