<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title><?= htmlspecialchars($title ?? 'PetCare') ?></title>
  <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=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
  <link rel="stylesheet" href="styles.css" />
  <script defer src="script.js"></script>
</head>
<body>
<header class="site-header">
  <div class="container nav-bar">
    <div class="brand">
      <img class="brand-logo" src="assets/images/Logo.png" alt="PetCare Logo" />
      <span>PETCARE</span>
    </div>
    <nav class="nav-links">
      <a href="index.php?page=home">Inicio</a>
      <a href="index.php?page=productos">Productos</a>
      <a href="index.php?page=galeria">Galería</a>
      <a href="index.php?page=contacto">Contacto</a>
    </nav>
    <div class="header-actions">
      <?php $currentUser = $_SESSION['user'] ?? null; ?>
      <?php if ($currentUser): ?>
        <a href="index.php?page=pedidos" class="cart-btn">Carrito de compras</a>
        <div class="auth-buttons">
          <span class="user-chip">Hola, <?= htmlspecialchars($currentUser['nombre']) ?></span>
          <a href="index.php?page=auth&action=logout" class="btn btn-outline">Cerrar sesión</a>
        </div>
      <?php else: ?>
        <div class="auth-buttons">
          <a href="index.php?page=registro" class="btn btn-secondary">Registrarse</a>
          <a href="index.php?page=login" class="btn btn-outline">Iniciar sesión</a>
        </div>
      <?php endif; ?>
    </div>
  </div>
</header>
<main>
