<?php
$settings = store_settings();
$storeName = array_get($settings, 'store_name', 'Furnify');
$pageTitle = isset($pageTitle) ? $pageTitle : $storeName;
$currentPage = isset($currentPage) ? $currentPage : '';
$bodyClass = isset($bodyClass) ? $bodyClass : '';
$customerNavAccount = function_exists('customer_current') ? customer_current() : null;
?>
<!doctype html>
<html lang="tl">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#102821">
    <meta name="description" content="Furnify premium sofa store with AR preview, custom sofa quotes, Re-Up makeover requests, live selling support, mobile cart, and installable PWA experience.">
    <title><?= e($pageTitle) ?></title>
    <link rel="manifest" href="manifest.json">
    <link rel="icon" href="assets/icons/icon-192.png" sizes="192x192">
    <link rel="apple-touch-icon" href="assets/icons/icon-192.png">
    <link rel="preconnect" href="https://cdn.jsdelivr.net">
    <link rel="preconnect" href="https://unpkg.com">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <link href="assets/css/styles.css" rel="stylesheet">
</head>
<body class="<?= e($bodyClass) ?>">
<div class="top-ribbon">
    <div class="container d-flex flex-wrap justify-content-center justify-content-md-between gap-2">
        <span><i class="bi bi-stars" aria-hidden="true"></i> Furnify premium sofas, custom sofa, Re-Up, and AR preview</span>
        <span><i class="bi bi-broadcast" aria-hidden="true"></i> Custom sofa requests, Re-Up estimates, and live selling support</span>
    </div>
</div>
<nav class="navbar navbar-expand-lg sticky-top store-nav">
    <div class="container">
        <a class="navbar-brand d-flex align-items-center gap-2" href="index.php" aria-label="<?= e($storeName) ?> home">
            <span class="brand-mark" aria-hidden="true"></span>
            <span>Furnify</span>
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="mainNav">
            <ul class="navbar-nav ms-auto align-items-lg-center gap-lg-2">
                <li class="nav-item"><a class="nav-link <?= active_nav('home', $currentPage) ?>" href="index.php">Home</a></li>
                <li class="nav-item"><a class="nav-link" href="index.php#catalog">Catalog</a></li>
                <li class="nav-item"><a class="nav-link <?= active_nav('custom', $currentPage) ?>" href="custom-sofa.php">Custom Sofa</a></li>
                <li class="nav-item"><a class="nav-link <?= active_nav('reup', $currentPage) ?>" href="reup.php">Re-Up</a></li>
                <li class="nav-item"><a class="nav-link" href="index.php#live-selling">Live Selling</a></li>
                <li class="nav-item"><a class="nav-link" href="index.php#experience">AR</a></li>
                <li class="nav-item"><a class="nav-link <?= active_nav('cart', $currentPage) ?>" href="cart.php">Cart</a></li>
                <?php if ($customerNavAccount): ?>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle <?= active_nav('account', $currentPage) ?>" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                            <i class="bi bi-person-circle" aria-hidden="true"></i> Account
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="customer-dashboard.php">Dashboard</a></li>
                            <li><a class="dropdown-item" href="customer-orders.php">My Orders</a></li>
                            <li><a class="dropdown-item" href="customer-custom.php">Custom Quotes</a></li>
                            <li><a class="dropdown-item" href="customer-reup.php">Re-Up Requests</a></li>
                            <li><a class="dropdown-item" href="customer-profile.php">Profile</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="logout.php">Logout</a></li>
                        </ul>
                    </li>
                <?php else: ?>
                    <li class="nav-item"><a class="nav-link <?= active_nav('account', $currentPage) ?>" href="login.php">Login</a></li>
                    <li class="nav-item"><a class="btn btn-sm btn-outline-primary" href="register.php">Create Account</a></li>
                <?php endif; ?>
                <li class="nav-item">
                    <a class="btn btn-sm btn-primary nav-cart-button" href="cart.php" aria-label="Open cart">
                        <i class="bi bi-bag" aria-hidden="true"></i>
                        <span id="cart-count">0</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<main>
