/**
 * @file menu.css
 *
 * @description Styles for navigation menu items whose visibility depends on
 *              the user's login state or WooCommerce cart state.
 *
 *              Body classes are set server-side by WordPress and reinforced
 *              client-side by scripts/menu.js (cookie-based), so that
 *              cached pages always display the correct menu items.
 *
 *              Body classes:
 *                body.logged-in        — user is authenticated
 *                body.has-cart-items   — WooCommerce cart is non-empty (JS only)
 *
 *              Menu item CSS classes (assigned in Appearance → Menus):
 *                .menu-show-on-login   — visible only when logged in
 *                .menu-show-on-logout  — visible only when logged out
 *                .menu-item-checkout   — visible only when the cart has items
 */

/*
 * Login / logout item visibility.
 * Controlled by body.logged-in, which WordPress sets server-side and
 * scripts/nav-menu.js reinforces client-side for cached pages.
 */
body.logged-in {
    li.menu-show-on-login {
        display: block !important;
    }
    li.menu-show-on-logout {
        display: none !important;
    }
}
body:not(.logged-in) {
    li.menu-show-on-login {
        display: none !important;
    }
    li.menu-show-on-logout {
        display: block !important;
    }
}

/*
 * Checkout item visibility.
 * Hidden by default; visible only when the user is logged in AND the cart is
 * non-empty. scripts/menu.js adds body.has-cart-items when the
 * woocommerce_cart_hash cookie is present.
 */
li.menu-item-checkout {
    display: none !important;
}
body.logged-in.has-cart-items li.menu-item-checkout {
    display: block !important;
}
