/* =========================================
   ENHANCED MOBILE NAVIGATION
   ========================================= */

/* Mobile Menu Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Enhanced Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--text-dark);
    border-radius: 10px;
    transition: all 0.3s ease;
    transform-origin: center;
}

#header.scrolled .hamburger span {
    background: var(--text-dark);
}

#header:not(.scrolled) .hamburger span {
    background: white;
}

.hamburger.active span {
    background: var(--text-dark) !important;
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Menu */
@media (max-width: 900px) {
    .hamburger {
        display: flex;
    }

    /* Remove nav from flex flow so Space-Between works for Logo/Hamburger */
    nav {
        position: absolute;
        width: 0;
        height: 0;
        overflow: visible;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 30px 30px;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 0;
        width: 100%;
        opacity: 0;
        transform: translateX(50px);
        transition: all 0.3s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateX(0);
    }

    /* Stagger animation for menu items */
    .nav-menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-menu.active li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-link {
        padding: 18px 20px;
        font-size: 1.15rem;
        color: var(--text-dark);
        border-radius: 12px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.3s ease;
    }

    .nav-link::before {
        content: '';
        width: 6px;
        height: 6px;
        background: var(--primary-color);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-link:hover::before,
    .nav-link.active::before {
        opacity: 1;
    }

    .nav-link:hover {
        background: var(--primary-light);
        color: var(--primary-dark);
        transform: translateX(10px);
    }

    /* Logo in mobile menu */
    .nav-menu::after {
        content: 'Abira Studio';
        position: absolute;
        top: 30px;
        left: 30px;
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--primary-color);
        font-family: 'Playfair Display', serif;
    }

    /* Adjust Main Logo on Mobile */
    .logo img {
        height: 60px;
    }
}

/* Tablet Landscape */
@media (min-width: 768px) and (max-width: 900px) {
    .nav-menu {
        max-width: 400px;
        padding: 100px 40px 40px;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 20px 25px;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Active page indicator */
.nav-link.current-page {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

@media (max-width: 900px) {
    .nav-link.current-page::before {
        opacity: 1;
    }

    /* Custom Scrollbar for Mobile Menu */
    .nav-menu::-webkit-scrollbar {
        width: 6px;
    }

    .nav-menu::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .nav-menu::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
    }
}