<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Header & Footer</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Responsive scaling -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <style>
    body {
      margin: 0;
      font-family: 'Segoe UI', sans-serif;
      background-color: #000;
      color: #fff;
    }

    /* Header */
    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 20px;
      background-color: rgba(17, 17, 17, 0.9);
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    .logo img {
      height: 35px;
    }

    .belagidds-btn {
      background: #444;
      color: #fff;
      border: none;
      padding: 8px 14px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 0.9rem;
    }

    /* Right section */
    .header-right {
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .cart-wrapper {
      position: relative;
    }

    .cart-icon {
      font-size: 1.4rem;
      cursor: pointer;
      color: #fff;
    }

    .cart-badge {
      position: absolute;
      top: -6px;
      right: -8px;
      background: crimson;
      color: #fff;
      font-size: 0.7rem;
      padding: 2px 6px;
      border-radius: 50%;
    }

    /* Account dropdown */
    .account-dropdown {
      position: relative;
    }

    .account-button {
      background: #444;
      color: #fff;
      border: none;
      padding: 8px 12px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 0.9rem;
    }

    .dropdown-menu {
      display: none;
      position: absolute;
      right: 0;
      top: 100%;
      background-color: #222;
      border: 1px solid #333;
      border-radius: 5px;
      min-width: 150px;
      z-index: 10;
    }

    .dropdown-menu a {
      display: block;
      color: #fff;
      text-decoration: none;
      padding: 10px 15px;
      transition: background 0.3s;
      font-size: 0.9rem;
    }

    .dropdown-menu a:hover {
      background-color: #333;
    }

    .account-dropdown:hover .dropdown-menu {
      display: block;
    }

    /* Mobile adjustments */
    @media (max-width: 768px) {
      header {
        flex-wrap: wrap;
      }

      .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
      }

      .header-right {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
        gap: 10px;
      }

      .belagidds-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
      }

      .account-button {
        font-size: 0.8rem;
        padding: 6px 10px;
      }
    }

    /* Footer */
    footer {
      background-color: rgba(17, 17, 17, 0.9);
      padding: 20px 15px;
      text-align: center;
    }

    .social-icons {
      margin-bottom: 12px;
      display: flex;
      justify-content: center;
      gap: 15px;
      flex-wrap: wrap;
    }

    .social-icons a {
      color: #fff;
      font-size: 1.3rem;
      transition: color 0.3s;
    }

    .social-icons a:hover {
      color: #888;
    }

    .copyright {
      font-size: 0.8rem;
      color: #aaa;
    }
  </style>
</head>
<body>

<!-- Header -->
<header>
  <div class="header-left">
    <a href="/Bella/index.php" class="logo"><img src="/Bella/images/taji-yetu.png" alt="Logo"></a>
    <button class="belagidds-btn">Belagidds</button>
  </div>

  <div class="header-right">
    <a href="/Bella/cart.php" class="cart-wrapper">
      <i class="fas fa-shopping-cart cart-icon"></i>
      <?php
        $cart_count = 0;
        if (isset($_SESSION['cart'])) {
          foreach ($_SESSION['cart'] as $item) {
            $cart_count += $item['quantity'];
          }
        }
      ?>
      <span class="cart-badge"><?= $cart_count ?></span>
    </a>

    <div class="account-dropdown">
      <button class="account-button">
        <?php if (isset($_SESSION['user_id'])): ?>
          <?= htmlspecialchars($_SESSION['name']) ?>
        <?php else: ?>
          Account
        <?php endif; ?>
        <i class="fas fa-caret-down"></i>
      </button>

      <div class="dropdown-menu">
        <?php if (isset($_SESSION['user_id'])): ?>
          <a href="/Bella/profile.php">Profile</a>
          <a href="/Bella/orders.php">Orders</a>
          <a href="/Bella/logout.php">Logout</a>
        <?php else: ?>
          <a href="/Bella/login.php">Login</a>
        <?php endif; ?>
      </div>
    </div>
  </div>
</header>

<!-- Footer -->
<footer>
  <div class="social-icons">
    <a href="https://www.facebook.com/share/19B3wm2Xdn/"><i class="fab fa-facebook-f"></i></a>
    <a href="https://x.com/BellaGidds?t=XuTmK5KeSViKkiYy-dhCHw&s=09"><i class="fab fa-twitter"></i></a>
    <a href="https://www.instagram.com/belagids?igsh=MThsZ21xNXB2cXBrYg=="><i class="fab fa-instagram"></i></a>
    <a href="https://www.tiktok.com/@belagids?_t=ZM-8y36Xmrl6Jy&_r=1"><i class="fab fa-tiktok"></i></a>
  </div>
  <div class="copyright">
    &copy; 2025 TAJI YETU. All rights reserved.
  </div>
</footer>

</body>
</html>
