<?php
// includes/header.php
$current_page = basename($_SERVER['PHP_SELF'], '.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= h($page_title ?? SITE_NAME . ' – ' . SITE_TAGLINE) ?></title>
<meta name="description" content="<?= h($meta_desc ?? 'Balimeen Pvt Ltd manufactures premium SS 304 stainless steel kitchen sinks. Factory-direct pricing from Aurangabad, Bihar.') ?>">
<meta name="keywords" content="stainless steel kitchen sink, SS 304 sink, double bowl sink, undermount sink, Bihar sink manufacturer, Balimeen">
<meta name="author" content="Balimeen Private Limited">
<meta property="og:title" content="<?= h($page_title ?? SITE_NAME) ?>">
<meta property="og:image" content="<?= SITE_URL ?>/assets/images/hero_sink.png">
<link rel="stylesheet" href="<?= SITE_URL ?>/assets/css/style.css">
<link rel="stylesheet" href="<?= SITE_URL ?>/assets/css/shop.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<link rel="icon" href="<?= SITE_URL ?>/assets/images/favicon.ico" type="image/x-icon">
</head>
<body>

<!-- Top Bar -->
<div class="topbar">
  <div class="container">
    <div class="topbar-left" style="display:flex;align-items:center;gap:12px;flex-wrap:wrap;">
      <span><i class="fas fa-envelope"></i> info@balimeen.com</span>
      <span><i class="fas fa-map-marker-alt"></i> Aurangabad, Bihar</span>
    </div>
    <div class="topbar-right">
      <a href="tel:+917870626467"><i class="fas fa-phone"></i> +91 78706 26467</a>
      <a href="tel:+919661427644"><i class="fas fa-phone"></i> +91 96614 27644</a>
      <span class="gstin-badge">GSTIN: <?= SITE_GSTIN ?></span>
    </div>
  </div>
</div>

<!-- Header -->
<header class="header" id="mainHeader">
  <div class="container">
    <a href="<?= SITE_URL ?>" class="logo">
      <div class="logo-icon" style="background:transparent;padding:0;">
        <img src="<?= SITE_URL ?>/assets/images/logo.jpg" alt="Balimeen" style="width:100%;height:100%;object-fit:contain;border-radius:8px;">
      </div>
      <div class="logo-text">
        <h1>Balimeen Private Limited</h1>
        <p>Stainless Steel Kitchen Sinks</p>
      </div>
    </a>
    <nav class="nav" id="mainNav">
      <a href="<?= SITE_URL ?>/" class="<?= $current_page === 'index' ? 'active' : '' ?>">Home</a>
      <a href="<?= SITE_URL ?>/pages/about.php" class="<?= $current_page === 'about' ? 'active' : '' ?>">About Us</a>
      <a href="<?= SITE_URL ?>/pages/products.php" class="<?= $current_page === 'products' ? 'active' : '' ?>">Products</a>
      <a href="<?= SITE_URL ?>/pages/contact.php" class="<?= $current_page === 'contact' ? 'active' : '' ?>">Contact</a>
      <!-- Cart -->
      <a href="<?= SITE_URL ?>/pages/cart.php" class="cart-icon-wrap <?= $current_page === 'cart' ? 'active' : '' ?>">
        Shopping 🛒
        <?php $cnt = cartCount(); if ($cnt > 0): ?>
        <span class="cart-count"><?= $cnt ?></span>
        <?php endif; ?>
      </a>
      <!-- Customer auth -->
      <?php if (isCustomer()): ?>
        <a href="<?= SITE_URL ?>/pages/account.php" class="<?= $current_page === 'account' ? 'active' : '' ?>" style="display:flex;align-items:center;gap:6px;">
          <span style="width:28px;height:28px;background:var(--blue-main);color:#fff;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:700;">
            <?= strtoupper(substr($_SESSION['customer_name']??'U',0,1)) ?>
          </span>
          My Account
        </a>
      <?php else: ?>
        <a href="<?= SITE_URL ?>/pages/login.php" class="<?= $current_page === 'login' ? 'active' : '' ?>">Login</a>
      <?php endif; ?>
      <a href="<?= SITE_URL ?>/pages/contact.php#inquiry" class="btn btn-primary btn-sm nav-cta">Get Quote</a>
    </nav>
    <button class="hamburger" id="hamburger" aria-label="Menu">
      <span></span><span></span><span></span>
    </button>
  </div>
</header>
