<?php
// This header checks actual session for PHP pages
$isLoggedIn = isset($_SESSION['user_id']);
$userName = $isLoggedIn ? ($_SESSION['name'] ?? 'User') : 'User';
?>
<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Faren Interior Design</title>
    <meta name="author" content="Faren Interior">
    <meta name="description" content="Faren - Architecture & Interior Design">
    <meta name="keywords" content="Faren - Architecture & Interior Design">
    <meta name="robots" content="INDEX,FOLLOW">
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
    <link rel="apple-touch-icon" sizes="57x57" href="assets/img/favicons/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="assets/img/favicons/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="assets/img/favicons/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="assets/img/favicons/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="assets/img/favicons/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="assets/img/favicons/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="assets/img/favicons/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="assets/img/favicons/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicons/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192" href="assets/img/favicons/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicons/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="assets/img/favicons/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicons/favicon-16x16.png">
    <link rel="manifest" href="assets/img/favicons/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="assets/img/favicons/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
    <link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/fontawesome.min.css">
    <link rel="stylesheet" href="assets/css/magnific-popup.min.css">
    <link rel="stylesheet" href="assets/css/swiper-bundle.min.css">
    <link rel="stylesheet" href="assets/css/style.css">
    <?php include __DIR__ . '/includes/responsive-head-helper.php'; ?>

    <style>
        /* ============================================================
           FAREN STICKY HEADER — COMPLETE STYLES
           ============================================================ */
        :root {
            --hdr-bg: #0c0a09;
            --hdr-bg-scrolled: rgba(12, 10, 9, 0.97);
            --hdr-accent: #c9953c;
            --hdr-accent-hover: #e0ad50;
            --hdr-text: #f5f0ea;
            --hdr-text-muted: #a89e94;
            --hdr-border: rgba(255, 255, 255, 0.08);
            --hdr-height: 72px;
            --hdr-height-mobile: 60px;
            --hdr-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            --hdr-font: 'DM Sans', sans-serif;
        }

        /* ── Reset body offset for sticky header ── */
        body {
            padding-top: var(--hdr-height) !important;
        }

        /* ── Main Header Bar ── */
        .faren-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: var(--hdr-height);
            background: var(--hdr-bg);
            border-bottom: 1px solid var(--hdr-border);
            z-index: 9999;
            transition: background var(--hdr-transition),
                        box-shadow var(--hdr-transition),
                        height var(--hdr-transition);
            font-family: var(--hdr-font);
        }

        .faren-header.scrolled {
            background: var(--hdr-bg-scrolled);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
        }

        .faren-header__inner {
            max-width: 1400px;
            margin: 0 auto;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
            gap: 24px;
        }

        /* ── LEFT SECTION: Logo + Nav ── */
        .faren-header__left {
            display: flex;
            align-items: center;
            gap: 40px;
            flex-shrink: 0;
        }

        /* Logo */
        .faren-header__logo {
            display: flex;
            align-items: center;
            text-decoration: none;
            flex-shrink: 0;
        }

        .faren-header__logo img {
            height: 44px;
            width: auto;
            transition: transform var(--hdr-transition), filter var(--hdr-transition);
            filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
        }

        .faren-header__logo:hover img {
            transform: scale(1.04);
        }

        /* ── Desktop Navigation ── */
        .faren-nav {
            display: flex;
            align-items: center;
            list-style: none;
            margin: 0;
            padding: 0;
            gap: 4px;
        }

        .faren-nav__item {
            position: relative;
        }

        .faren-nav__link {
            display: flex;
            align-items: center;
            gap: 5px;
            color: var(--hdr-text);
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 0.02em;
            text-decoration: none;
            padding: 10px 16px;
            border-radius: 8px;
            transition: color var(--hdr-transition), background var(--hdr-transition);
            white-space: nowrap;
            text-transform: capitalize;
        }

        .faren-nav__link:hover,
        .faren-nav__link.active {
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.08);
        }

        .faren-nav__arrow {
            font-size: 10px;
            transition: transform 0.3s ease;
            opacity: 0.6;
        }

        .faren-nav__item:hover .faren-nav__arrow {
            transform: rotate(180deg);
            opacity: 1;
        }

        /* Sub-menu (Dropdown) */
        .faren-nav__dropdown {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            min-width: 200px;
            background: #1a1714;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 8px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: all 0.3s ease;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
            list-style: none;
            z-index: 100;
        }

        .faren-nav__item:hover > .faren-nav__dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .faren-nav__dropdown li a {
            display: block;
            padding: 10px 14px;
            color: var(--hdr-text-muted);
            font-size: 13px;
            font-weight: 500;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.25s ease;
            text-transform: capitalize;
        }

        .faren-nav__dropdown li a:hover {
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.1);
            padding-left: 18px;
        }

        /* ── RIGHT SECTION: Auth Buttons ── */
        .faren-header__right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        /* Auth icon buttons */
        .faren-auth-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 9px 18px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            text-decoration: none;
            transition: all var(--hdr-transition);
            cursor: pointer;
            border: 1.5px solid transparent;
            font-family: var(--hdr-font);
            letter-spacing: 0.02em;
        }

        .faren-auth-btn i {
            font-size: 14px;
        }

        /* Login button — outline style */
        .faren-auth-btn--login {
            background: transparent;
            color: var(--hdr-text);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .faren-auth-btn--login:hover {
            border-color: var(--hdr-accent);
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.08);
        }

        /* Register button — filled accent */
        .faren-auth-btn--register {
            background: linear-gradient(135deg, var(--hdr-accent), #a77a2e);
            color: #fff;
            border: none;
            box-shadow: 0 4px 14px rgba(201, 149, 60, 0.3);
        }

        .faren-auth-btn--register:hover {
            background: linear-gradient(135deg, var(--hdr-accent-hover), var(--hdr-accent));
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(201, 149, 60, 0.4);
            color: #fff;
        }

        /* ── User Profile (logged-in state) ── */
        .faren-user-profile {
            display: none;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            position: relative;
            padding: 6px 12px;
            border-radius: 12px;
            transition: background 0.3s ease;
        }

        .faren-user-profile:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .faren-user-profile.is-visible {
            display: flex;
        }

        .faren-avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--hdr-accent), #a77a2e);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 15px;
            overflow: hidden;
            flex-shrink: 0;
            box-shadow: 0 3px 10px rgba(201, 149, 60, 0.3);
            transition: transform 0.3s ease;
        }

        .faren-user-profile:hover .faren-avatar {
            transform: scale(1.06);
        }

        .faren-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
        }

        .faren-avatar.has-image img {
            display: block;
        }

        .faren-avatar.has-image span {
            display: none;
        }

        .faren-user-info {
            line-height: 1.3;
        }

        .faren-user-info__label {
            font-size: 11px;
            color: var(--hdr-text-muted);
            font-weight: 500;
        }

        .faren-user-info__name {
            font-size: 14px;
            color: var(--hdr-text);
            font-weight: 600;
        }

        .faren-user-arrow {
            font-size: 10px;
            color: var(--hdr-text-muted);
            transition: transform 0.3s ease;
            margin-left: 4px;
        }

        .faren-user-profile.dropdown-open .faren-user-arrow {
            transform: rotate(180deg);
        }

        /* User dropdown */
        .faren-user-dropdown {
            position: absolute;
            top: calc(100% + 10px);
            right: 0;
            min-width: 190px;
            background: #1a1714;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 6px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(8px);
            transition: all 0.3s ease;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
            z-index: 200;
        }

        .faren-user-profile.dropdown-open .faren-user-dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .faren-user-dropdown__item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 11px 14px;
            border: none;
            background: transparent;
            color: var(--hdr-text-muted);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.25s ease;
            font-family: var(--hdr-font);
            text-align: left;
        }

        .faren-user-dropdown__item:hover {
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.1);
        }

        .faren-user-dropdown__item i {
            font-size: 14px;
            width: 18px;
            text-align: center;
        }

        .faren-user-dropdown__divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.08);
            margin: 4px 8px;
        }

        /* ── HAMBURGER / Mobile Toggle ── */
        .faren-hamburger {
            display: none;
            align-items: center;
            justify-content: center;
            width: 42px;
            height: 42px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
            position: relative;
            z-index: 10001;
        }

        .faren-hamburger:hover {
            background: rgba(201, 149, 60, 0.15);
            border-color: var(--hdr-accent);
        }

        .faren-hamburger__bars {
            width: 20px;
            height: 14px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
        }

        .faren-hamburger__bar {
            display: block;
            width: 100%;
            height: 2px;
            background: var(--hdr-text);
            border-radius: 2px;
            transition: all 0.3s ease;
            transform-origin: center;
        }

        .faren-hamburger__bar:nth-child(2) {
            width: 70%;
        }

        .faren-hamburger.is-active .faren-hamburger__bar:nth-child(1) {
            transform: rotate(45deg) translate(4px, 4px);
        }

        .faren-hamburger.is-active .faren-hamburger__bar:nth-child(2) {
            opacity: 0;
            transform: translateX(-10px);
        }

        .faren-hamburger.is-active .faren-hamburger__bar:nth-child(3) {
            transform: rotate(-45deg) translate(4px, -4px);
        }

        /* ── MOBILE SLIDE-IN MENU ── */
        .faren-mobile-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9998;
            opacity: 0;
            visibility: hidden;
            transition: all 0.35s ease;
            backdrop-filter: blur(4px);
        }

        .faren-mobile-overlay.is-active {
            opacity: 1;
            visibility: visible;
        }

        .faren-mobile-menu {
            position: fixed;
            top: 0;
            left: -320px;
            width: 300px;
            max-width: 85vw;
            height: 100vh;
            height: 100dvh;
            background: linear-gradient(180deg, #141110, #1a1714);
            z-index: 9999;
            overflow-y: auto;
            transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
            border-right: 1px solid rgba(255, 255, 255, 0.06);
        }

        .faren-mobile-menu.is-active {
            left: 0;
        }

        .faren-mobile-menu__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .faren-mobile-menu__logo img {
            height: 36px;
            width: auto;
        }

        .faren-mobile-menu__close {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: var(--hdr-text);
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .faren-mobile-menu__close:hover {
            background: rgba(201, 149, 60, 0.2);
            border-color: var(--hdr-accent);
        }

        /* Mobile nav list */
        .faren-mobile-nav {
            list-style: none;
            margin: 0;
            padding: 12px 0;
        }

        .faren-mobile-nav__item {
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        }

        .faren-mobile-nav__link {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px;
            color: var(--hdr-text);
            font-size: 15px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.25s ease;
            text-transform: capitalize;
        }

        .faren-mobile-nav__link:hover {
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.06);
            padding-left: 26px;
        }

        .faren-mobile-nav__toggle {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.06);
            border: none;
            border-radius: 6px;
            color: var(--hdr-text-muted);
            font-size: 11px;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .faren-mobile-nav__toggle:hover {
            background: rgba(201, 149, 60, 0.15);
            color: var(--hdr-accent);
        }

        .faren-mobile-nav__toggle.is-open {
            transform: rotate(180deg);
            background: rgba(201, 149, 60, 0.15);
            color: var(--hdr-accent);
        }

        /* Mobile sub-menu */
        .faren-mobile-sub {
            list-style: none;
            margin: 0;
            padding: 0 0 8px 0;
            display: none;
            background: rgba(0, 0, 0, 0.15);
        }

        .faren-mobile-sub.is-open {
            display: block;
        }

        .faren-mobile-sub li a {
            display: block;
            padding: 10px 20px 10px 40px;
            color: var(--hdr-text-muted);
            font-size: 14px;
            font-weight: 500;
            text-decoration: none;
            transition: all 0.25s ease;
            text-transform: capitalize;
        }

        .faren-mobile-sub li a:hover {
            color: var(--hdr-accent-hover);
            padding-left: 46px;
        }

        /* Mobile auth section */
        .faren-mobile-auth {
            padding: 16px 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .faren-mobile-auth .faren-auth-btn {
            justify-content: center;
            width: 100%;
            padding: 12px 16px;
            font-size: 14px;
        }

        /* Mobile user profile section */
        .faren-mobile-user {
            padding: 16px 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            display: none;
        }

        .faren-mobile-user.is-visible {
            display: block;
        }

        .faren-mobile-user__info {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 14px;
        }

        .faren-mobile-user__avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--hdr-accent), #a77a2e);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 16px;
            overflow: hidden;
            flex-shrink: 0;
        }

        .faren-mobile-user__avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: none;
        }

        .faren-mobile-user__name {
            color: var(--hdr-text);
            font-size: 15px;
            font-weight: 600;
        }

        .faren-mobile-user__label {
            font-size: 12px;
            color: var(--hdr-text-muted);
        }

        .faren-mobile-user__actions {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .faren-mobile-user__action {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            background: transparent;
            border: none;
            color: var(--hdr-text-muted);
            font-size: 14px;
            font-weight: 500;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.25s ease;
            font-family: var(--hdr-font);
            text-align: left;
            width: 100%;
        }

        .faren-mobile-user__action:hover {
            color: var(--hdr-accent-hover);
            background: rgba(201, 149, 60, 0.1);
        }

        .faren-mobile-user__action i {
            font-size: 14px;
            width: 18px;
            text-align: center;
        }

        /* ── Hide desktop nav on mobile, show hamburger ── */
        .faren-desktop-nav {
            display: block;
        }

        @media (max-width: 991px) {
            body {
                padding-top: var(--hdr-height-mobile) !important;
            }

            .faren-header {
                height: var(--hdr-height-mobile);
            }

            .faren-header__inner {
                padding: 0 14px;
            }

            .faren-desktop-nav {
                display: none !important;
            }

            .faren-header__right .faren-auth-btn,
            .faren-header__right .faren-user-profile {
                display: none !important;
            }

            .faren-hamburger {
                display: flex;
            }

            /* Reorder: hamburger left, logo center */
            .faren-header__inner {
                display: grid;
                grid-template-columns: auto 1fr auto;
                align-items: center;
            }

            .faren-header__left {
                order: 1;
                justify-self: start;
            }

            .faren-header__logo-center {
                order: 2;
                justify-self: center;
                display: flex !important;
            }

            .faren-header__right {
                order: 3;
                justify-self: end;
            }

            .faren-header__left .faren-header__logo {
                display: none;
            }

            .faren-header__logo-center img {
                height: 36px;
                width: auto;
                filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
            }
        }

        /* Extra small mobile */
        @media (max-width: 575px) {
            .faren-header {
                height: 56px;
            }

            body {
                padding-top: 56px !important;
            }

            .faren-header__inner {
                padding: 0 12px;
            }

            .faren-hamburger {
                width: 38px;
                height: 38px;
            }

            .faren-hamburger__bars {
                width: 18px;
                height: 12px;
            }

            .faren-header__logo-center img {
                height: 32px;
            }
        }

        /* Desktop: hide center logo */
        @media (min-width: 992px) {
            .faren-header__logo-center {
                display: none !important;
            }
        }

        /* Large desktops */
        @media (min-width: 1200px) {
            .faren-header__inner {
                padding: 0 40px;
            }

            .faren-nav__link {
                padding: 10px 18px;
                font-size: 14.5px;
            }
        }

        /* Ultra wide */
        @media (min-width: 1600px) {
            .faren-header__inner {
                max-width: 1520px;
            }
        }

        /* ── Page loader ── */
        .loader-wrap {
            z-index: 99999;
        }
    </style>
</head>

<body id="show-grid">

    <!-- Page Loader -->
    <!-- <div class="loader-wrap"><svg viewbox="0 0 1000 1000" preserveaspectratio="none">
            <path id="svg" d="M0,1005S175,995,500,995s500,5,500,5V0H0Z"></path>
        </svg>
        <div class="loader-wrap-heading">
            <div class="load-text"><span>  LOADING  </span>
            </div>
        </div>
    </div> -->

    <!-- ========== STICKY HEADER ========== -->
    <header class="faren-header" id="faren-header">
        <div class="faren-header__inner">

            <!-- LEFT: Hamburger (mobile) + Logo + Nav -->
            <div class="faren-header__left">
                <!-- Mobile hamburger -->
                <button class="faren-hamburger" id="faren-hamburger" aria-label="Open menu">
                    <span class="faren-hamburger__bars">
                        <span class="faren-hamburger__bar"></span>
                        <span class="faren-hamburger__bar"></span>
                        <span class="faren-hamburger__bar"></span>
                    </span>
                </button>

                <!-- Desktop logo -->
                <a href="index.php" class="faren-header__logo">
                    <img src="assets/img/logo-white.svg" alt="Faren Interior Design">
                </a>

                <!-- Desktop Navigation -->
                <nav class="faren-desktop-nav" aria-label="Main navigation">
                    <ul class="faren-nav">
                        <li class="faren-nav__item">
                            <a href="index.php" class="faren-nav__link">Home</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="about.php" class="faren-nav__link">
                                About
                                <i class="fas fa-chevron-down faren-nav__arrow"></i>
                            </a>
                            <ul class="faren-nav__dropdown">
                                <li><a href="team.php">Team</a></li>
                                <li><a href="blog.php">Blog</a></li>
                                <li><a href="faq.php">FAQ</a></li>
                            </ul>
                        </li>
                        <li class="faren-nav__item">
                            <a href="service.php" class="faren-nav__link">Services</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="project.php" class="faren-nav__link">Projects</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="gallery.php" class="faren-nav__link">Gallery</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="shop.php" class="faren-nav__link">Shop</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="cart.php" class="faren-nav__link">
                                Cart
                                <i class="fas fa-chevron-down faren-nav__arrow"></i>
                            </a>
                            <ul class="faren-nav__dropdown">
                                <li><a href="orders.php">Orders</a></li>
                                <li><a href="checkout.php">Checkout</a></li>
                                <li><a href="my-wishlist.php">Wishlist</a></li>
                            </ul>
                        </li>
                        <li class="faren-nav__item">
                            <a href="contact.php" class="faren-nav__link">Contact</a>
                        </li>
                        <li class="faren-nav__item">
                            <a href="consultation.php" class="faren-nav__link">Consultation</a>
                        </li>
                    </ul>
                </nav>
            </div>

            <!-- CENTER: Mobile logo (visible only on mobile) -->
            <a href="index.php" class="faren-header__logo-center">
                <img src="assets/img/logo-white.svg" alt="Faren Interior Design">
            </a>

            <!-- RIGHT: Auth Buttons / User Profile -->
            <div class="faren-header__right">
                <!-- Auth buttons (not logged in) -->
                <div class="faren-auth-section" id="faren-auth-section">
                    <a href="auth-system/login.php" class="faren-auth-btn faren-auth-btn--login" id="header-login-btn">
                        <i class="far fa-user"></i>
                        <span>Login</span>
                    </a>
                    <a href="auth-system/register.php" class="faren-auth-btn faren-auth-btn--register" id="header-register-btn">
                        <i class="far fa-user-plus"></i>
                        <span>Register</span>
                    </a>
                </div>

                <!-- User profile (logged in) -->
                <div class="faren-user-profile" id="faren-user-profile">
                    <div class="faren-avatar" id="faren-avatar">
                        <img id="faren-avatar-img" src="" alt="User avatar">
                        <span id="faren-avatar-initial">U</span>
                    </div>
                    <div class="faren-user-info">
                        <div class="faren-user-info__label">Welcome</div>
                        <div class="faren-user-info__name" id="faren-user-name">User</div>
                    </div>
                    <i class="fas fa-chevron-down faren-user-arrow"></i>

                    <!-- User Dropdown -->
                    <div class="faren-user-dropdown" id="faren-user-dropdown">
                        <button type="button" class="faren-user-dropdown__item" id="faren-dashboard-btn">
                            <i class="far fa-chart-bar"></i> Dashboard
                        </button>
                        <div class="faren-user-dropdown__divider"></div>
                        <button type="button" class="faren-user-dropdown__item" id="faren-logout-btn">
                            <i class="far fa-sign-out-alt"></i> Logout
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- Mobile Overlay -->
    <div class="faren-mobile-overlay" id="faren-mobile-overlay"></div>

    <!-- Mobile Slide-in Menu -->
    <nav class="faren-mobile-menu" id="faren-mobile-menu" aria-label="Mobile navigation">
        <div class="faren-mobile-menu__header">
            <a href="index.php" class="faren-mobile-menu__logo">
                <img src="../assets/img/logo-white.svg" alt="Faren Interior Design">
            </a>
            <button class="faren-mobile-menu__close" id="faren-mobile-close" aria-label="Close menu">
                <i class="fas fa-times"></i>
            </button>
        </div>

        <ul class="faren-mobile-nav" id="faren-mobile-nav">
            <li class="faren-mobile-nav__item">
                <a href="index.php" class="faren-mobile-nav__link">Home</a>
            </li>
            <li class="faren-mobile-nav__item">
                <div style="display:flex; align-items:center;">
                    <a href="about.php" class="faren-mobile-nav__link" style="flex:1;">About</a>
                    <button class="faren-mobile-nav__toggle" data-target="mobile-sub-about" aria-label="Toggle About submenu">
                        <i class="fas fa-chevron-down"></i>
                    </button>
                </div>
                <ul class="faren-mobile-sub" id="mobile-sub-about">
                    <li><a href="team.php">Team</a></li>
                    <li><a href="blog.php">Blog</a></li>
                    <li><a href="faq.html">FAQ</a></li>
                </ul>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="service.php" class="faren-mobile-nav__link">Services</a>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="project.php" class="faren-mobile-nav__link">Projects</a>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="gallery.php" class="faren-mobile-nav__link">Gallery</a>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="shop.php" class="faren-mobile-nav__link">Shop</a>
            </li>
            <li class="faren-mobile-nav__item">
                <div style="display:flex; align-items:center;">
                    <a href="cart.php" class="faren-mobile-nav__link" style="flex:1;">Cart</a>
                    <button class="faren-mobile-nav__toggle" data-target="mobile-sub-cart" aria-label="Toggle Cart submenu">
                        <i class="fas fa-chevron-down"></i>
                    </button>
                </div>
                <ul class="faren-mobile-sub" id="mobile-sub-cart">
                    <li><a href="orders.php">Orders</a></li>
                    <li><a href="checkout.php">Checkout</a></li>
                    <li><a href="my-wishlist.php">Wishlist</a></li>
                </ul>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="contact.php" class="faren-mobile-nav__link">Contact</a>
            </li>
            <li class="faren-mobile-nav__item">
                <a href="consultation.php" class="faren-mobile-nav__link">Consultation</a>
            </li>
        </ul>

        <!-- Mobile Auth (not logged in) -->
        <div class="faren-mobile-auth" id="faren-mobile-auth">
            <a href="auth-system/login.php" class="faren-auth-btn faren-auth-btn--login">
                <i class="far fa-user"></i>
                <span>Login</span>
            </a>
            <a href="auth-system/register.php" class="faren-auth-btn faren-auth-btn--register">
                <i class="far fa-user-plus"></i>
                <span>Register</span>
            </a>
        </div>

        <!-- Mobile User (logged in) -->
        <div class="faren-mobile-user" id="faren-mobile-user">
            <div class="faren-mobile-user__info">
                <div class="faren-mobile-user__avatar" id="faren-mobile-avatar">
                    <img id="faren-mobile-avatar-img" src="" alt="User avatar" style="display:none; width:100%; height:100%; object-fit:cover;">
                    <span id="faren-mobile-avatar-initial">U</span>
                </div>
                <div>
                    <div class="faren-mobile-user__name" id="faren-mobile-user-name">User</div>
                    <div class="faren-mobile-user__label">Welcome back</div>
                </div>
            </div>
            <div class="faren-mobile-user__actions">
                <button type="button" class="faren-mobile-user__action" id="faren-mobile-dashboard-btn">
                    <i class="far fa-chart-bar"></i> Dashboard
                </button>
                <button type="button" class="faren-mobile-user__action" id="faren-mobile-logout-btn">
                    <i class="far fa-sign-out-alt"></i> Logout
                </button>
            </div>
        </div>
    </nav>

    <!-- ========== HEADER JAVASCRIPT ========== -->
    <script>
    (function() {
        'use strict';

        // ── Sticky scroll effect ──
        const header = document.getElementById('faren-header');
        let lastScroll = 0;

        function onScroll() {
            const y = window.scrollY || window.pageYOffset;
            if (y > 20) {
                header.classList.add('scrolled');
            } else {
                header.classList.remove('scrolled');
            }
            lastScroll = y;
        }

        window.addEventListener('scroll', onScroll, { passive: true });
        onScroll(); // init

        // ── Mobile menu toggle ──
        const hamburger = document.getElementById('faren-hamburger');
        const mobileMenu = document.getElementById('faren-mobile-menu');
        const mobileOverlay = document.getElementById('faren-mobile-overlay');
        const mobileClose = document.getElementById('faren-mobile-close');

        function openMenu() {
            mobileMenu.classList.add('is-active');
            mobileOverlay.classList.add('is-active');
            hamburger.classList.add('is-active');
            document.body.style.overflow = 'hidden';
        }

        function closeMenu() {
            mobileMenu.classList.remove('is-active');
            mobileOverlay.classList.remove('is-active');
            hamburger.classList.remove('is-active');
            document.body.style.overflow = '';
        }

        if (hamburger) hamburger.addEventListener('click', function() {
            if (mobileMenu.classList.contains('is-active')) {
                closeMenu();
            } else {
                openMenu();
            }
        });

        if (mobileClose) mobileClose.addEventListener('click', closeMenu);
        if (mobileOverlay) mobileOverlay.addEventListener('click', closeMenu);

        // ── Mobile sub-menu toggles ──
        document.querySelectorAll('.faren-mobile-nav__toggle').forEach(function(btn) {
            btn.addEventListener('click', function(e) {
                e.preventDefault();
                e.stopPropagation();
                var targetId = this.getAttribute('data-target');
                var submenu = document.getElementById(targetId);
                if (submenu) {
                    submenu.classList.toggle('is-open');
                    this.classList.toggle('is-open');
                }
            });
        });

        // ── User dropdown (desktop) ──
        var userProfile = document.getElementById('faren-user-profile');
        var userDropdown = document.getElementById('faren-user-dropdown');
        var dropTimer;

        if (userProfile) {
            userProfile.addEventListener('mouseenter', function() {
                clearTimeout(dropTimer);
                userProfile.classList.add('dropdown-open');
            });
            userProfile.addEventListener('mouseleave', function() {
                dropTimer = setTimeout(function() {
                    userProfile.classList.remove('dropdown-open');
                }, 200);
            });
            userProfile.addEventListener('click', function(e) {
                e.stopPropagation();
                userProfile.classList.toggle('dropdown-open');
            });
        }

        document.addEventListener('click', function() {
            if (userProfile) userProfile.classList.remove('dropdown-open');
        });

        // ── Auth UI state management ──
        function updateAuthState() {
            var isLoggedIn = localStorage.getItem('userLoggedIn') === 'true';
            var userName = localStorage.getItem('userName') || 'User';

            // Desktop
            var authSection = document.getElementById('faren-auth-section');
            var profileSection = document.getElementById('faren-user-profile');

            // Mobile
            var mobileAuth = document.getElementById('faren-mobile-auth');
            var mobileUser = document.getElementById('faren-mobile-user');

            if (isLoggedIn) {
                if (authSection) authSection.style.display = 'none';
                if (profileSection) {
                    profileSection.classList.add('is-visible');
                    var nameEl = document.getElementById('faren-user-name');
                    var avatarInitial = document.getElementById('faren-avatar-initial');
                    if (nameEl) nameEl.textContent = userName;
                    if (avatarInitial) avatarInitial.textContent = userName.charAt(0).toUpperCase();
                }

                if (mobileAuth) mobileAuth.style.display = 'none';
                if (mobileUser) {
                    mobileUser.classList.add('is-visible');
                    var mNameEl = document.getElementById('faren-mobile-user-name');
                    var mAvatarInitial = document.getElementById('faren-mobile-avatar-initial');
                    if (mNameEl) mNameEl.textContent = userName;
                    if (mAvatarInitial) mAvatarInitial.textContent = userName.charAt(0).toUpperCase();
                }

                // Load avatar from server
                loadAvatar();
            } else {
                if (authSection) authSection.style.display = '';
                if (profileSection) profileSection.classList.remove('is-visible');
                if (mobileAuth) mobileAuth.style.display = '';
                if (mobileUser) mobileUser.classList.remove('is-visible');
            }
        }

        function loadAvatar() {
            fetch('auth-system/get-user-profile.php')
                .then(function(res) { return res.json(); })
                .then(function(data) {
                    if (data.success && data.user) {
                        var user = data.user;

                        if (user.name) {
                            localStorage.setItem('userName', user.name);
                            var nameEl = document.getElementById('faren-user-name');
                            var mNameEl = document.getElementById('faren-mobile-user-name');
                            if (nameEl) nameEl.textContent = user.name;
                            if (mNameEl) mNameEl.textContent = user.name;
                        }

                        if (user.avatar) {
                            localStorage.setItem('userAvatarUrl', user.avatar);
                            applyAvatar(user.avatar);
                        }
                    }
                })
                .catch(function() { /* silent */ });
        }

        function applyAvatar(url) {
            // Desktop
            var avatarEl = document.getElementById('faren-avatar');
            var avatarImg = document.getElementById('faren-avatar-img');
            var avatarInit = document.getElementById('faren-avatar-initial');
            if (avatarImg && url) {
                avatarImg.src = url;
                avatarImg.style.display = 'block';
                if (avatarInit) avatarInit.style.display = 'none';
                if (avatarEl) avatarEl.classList.add('has-image');
            }

            // Mobile
            var mAvatarImg = document.getElementById('faren-mobile-avatar-img');
            var mAvatarInit = document.getElementById('faren-mobile-avatar-initial');
            if (mAvatarImg && url) {
                mAvatarImg.src = url;
                mAvatarImg.style.display = 'block';
                if (mAvatarInit) mAvatarInit.style.display = 'none';
            }
        }

        // Check for cached avatar
        var cachedAvatar = localStorage.getItem('userAvatarUrl');
        if (cachedAvatar && localStorage.getItem('userLoggedIn') === 'true') {
            applyAvatar(cachedAvatar);
        }

        // ── Navigation handlers ──
        var dashboardBtn = document.getElementById('faren-dashboard-btn');
        var logoutBtn = document.getElementById('faren-logout-btn');
        var mobileDashBtn = document.getElementById('faren-mobile-dashboard-btn');
        var mobileLogoutBtn = document.getElementById('faren-mobile-logout-btn');

        function goToDashboard() {
            var role = localStorage.getItem('userRole');
            var target = role === 'admin' ? 'admin-dashboard.php' : 'customer-dashboard.php';
            window.location.href = target;
        }

        function doLogout() {
            localStorage.setItem('userLoggedIn', 'false');
            localStorage.removeItem('userName');
            localStorage.removeItem('userAvatarUrl');
            localStorage.removeItem('userRole');
            window.location.href = 'auth-system/logout.php';
        }

        if (dashboardBtn) dashboardBtn.addEventListener('click', goToDashboard);
        if (logoutBtn) logoutBtn.addEventListener('click', doLogout);
        if (mobileDashBtn) mobileDashBtn.addEventListener('click', goToDashboard);
        if (mobileLogoutBtn) mobileLogoutBtn.addEventListener('click', doLogout);

        // ── Init & storage listener ──
        updateAuthState();
        window.addEventListener('storage', updateAuthState);

        // Close mobile menu on window resize to desktop
        window.addEventListener('resize', function() {
            if (window.innerWidth > 991) {
                closeMenu();
            }
        });

    })();
    </script>

    <!-- Core JS Libraries -->
    <script src="assets/js/vendor/jquery-3.7.1.min.js"></script>
    <script src="assets/js/swiper-bundle.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/jquery.magnific-popup.min.js"></script>
    <script src="assets/js/jquery.counterup.min.js"></script>
    <script src="assets/js/circle-progress.js"></script>
    <script src="assets/js/jquery-ui.min.js"></script>
    <script src="assets/js/imagesloaded.pkgd.min.js"></script>
    <script src="assets/js/isotope.pkgd.min.js"></script>
    <script src="assets/js/nice-select.min.js"></script>
    <script src="assets/js/wow.min.js"></script>
    <script src="assets/js/threesixty.min.js"></script>
    <script src="assets/js/panolens.min.js"></script>
    <script src="assets/js/gsap.min.js"></script>
    <script src="assets/js/ScrollTrigger.min.js"></script>
    <script src="assets/js/SplitText.js"></script>
    <script src="assets/js/SplitType.js"></script>
    <script src="assets/js/lenis.min.js"></script>
    <script src="assets/js/CustomEase.min.js"></script>
    <script src="assets/js/main.js"></script>
