<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php wp_title('|', true, 'right'); ?><?php bloginfo('name'); ?></title>
    <?php wp_head(); ?>
</head>
<body <?php body_class('woonoow-spa-page'); ?>>
    <?php
    // Determine initial route based on SPA mode
    $appearance_settings = get_option('woonoow_appearance_settings', []);
    $spa_mode = isset($appearance_settings['general']['spa_mode']) ? $appearance_settings['general']['spa_mode'] : 'full';
    
    // Set initial page based on mode
    if ($spa_mode === 'checkout_only') {
        // Checkout Only mode starts at cart
        $page_type = 'cart';
        $data_attrs = 'data-page="cart" data-initial-route="/cart"';
    } else {
        // Full SPA mode starts at shop
        $page_type = 'shop';
        $data_attrs = 'data-page="shop" data-initial-route="/shop"';
    }
    ?>
    
    <div id="woonoow-customer-app" <?php echo $data_attrs; ?>>
        <div class="woonoow-loading" style="display: flex; align-items: center; justify-content: center; min-height: 100vh; font-family: system-ui, -apple-system, sans-serif;">
            <p><?php esc_html_e('Loading...', 'woonoow'); ?></p>
        </div>
    </div>
    
    <?php wp_footer(); ?>
</body>
</html>
