/* assets/css/navbar.css */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1003;
    height: 70px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.5rem 0;
    /* Increase touch area */
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--secondary);
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Desktop alignment fixes: ensure links align to the right and don't wrap */
@media (min-width: 1024px) {
    .nav-menu {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        justify-content: flex-end;
    }

    .nav-links {
        justify-content: flex-end;
        margin: 0;
        padding: 0;
    }

    .nav-links li {
        display: inline-block;
    }

    .nav-links a,
    .nav-links .btn {
        white-space: nowrap;
        box-sizing: border-box;
    }

    .navbar {
        min-height: 70px;
    }
}

/* Mobile Styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1002;
    padding: 10px;
    /* Buffer for touch */
    width: 44px;
    /* Minimum recommended touch target */
    height: 44px;
    justify-content: center;
    align-items: center;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark);
    transition: 0.3s;
}

@media (max-width: 1023px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        /* Drawer width */
        max-width: 300px;
        height: 100vh;
        background-color: var(--white);
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        padding-top: 5rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--light);
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .nav-links .btn {
        margin: 1rem 2rem;
        width: calc(100% - 4rem);
        text-align: center;
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--overlay);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        pointer-events: none; /* don't block clicks when hidden */
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Body lock */
    body.no-scroll {
        overflow: hidden;
    }
}