Example 3: Using `ml-auto` to Push an Item Right (Gotcha Solution)

This example addresses the "Gotcha" by using `ml-auto` (margin-left: auto) on an item to push it to the right, especially when you have multiple items on the left and want one specific item on the far right.

Gotcha Solution: The parent `div` is `flex items-center`. The "Logo" and `nav` elements are naturally on the left. The "Login" button `div` has `ml-auto`. This utility class applies `margin-left: auto;`, which consumes all available space to its left, effectively pushing the "Login" button to the far right. This is a common solution when `justify-between` on the main container isn't suitable because you have more than two logical groups or want finer control.

Alternative: Nested Flex with `justify-between`

Another way to achieve a similar layout is to explicitly group items and use `justify-between` on the parent of these groups.

Here, the main header `div` has `flex justify-between`. Its two direct children are: 1. A `div` containing the Logo and Nav (grouped left). 2. A `div` containing the Login button (pushed right). This is also a valid approach to solve the "Gotcha" by structuring your HTML into clear left/right groups.