/**
 * cartDrawerStore — tiny zustand slice for the global cart drawer open/close state.
 *
 * Three nav surfaces (TopBar, DesktopTopBar, BottomNav) share one logical drawer.
 * Zustand allows them to coordinate without prop-drilling across islands.
 */

import { create } from 'zustand';

interface CartDrawerState {
  open: boolean;
  setOpen: (open: boolean) => void;
  toggle: () => void;
}

export const useCartDrawerStore = create<CartDrawerState>((set) => ({
  open: false,
  setOpen: (open) => set({ open }),
  toggle: () => set((s) => ({ open: !s.open })),
}));
