import { defineStore } from 'pinia'

export const useUiStore = defineStore('ui', {
  state: () => ({
    mobileMenuOpen: false,
    purchaseModalOpen: false,
    authModalMode: null, // null | 'login' | 'register'
  }),
  actions: {
    toggleMobileMenu() { this.mobileMenuOpen = !this.mobileMenuOpen },
    closeMobileMenu() { this.mobileMenuOpen = false },
    openPurchaseModal() { this.purchaseModalOpen = true },
    closePurchaseModal() { this.purchaseModalOpen = false },
    openAuthModal(mode = 'login') { this.authModalMode = mode },
    closeAuthModal() { this.authModalMode = null },
  },
})
