<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Website Bán Hàng</title>
  <link rel="stylesheet" href="/css/styles.css">
</head>
<body>
  <h1>Danh sách sản phẩm</h1>
  <div class="product-list">
    <% products.forEach(product => { %>
      <div class="product">
        <h3><%= product.name %></h3>
        <p>Giá: <%= product.price %> VNĐ</p>
        <form action="/add-to-cart" method="POST">
          <input type="hidden" name="productId" value="<%= product.id %>">
          <button type="submit">Thêm vào giỏ hàng</button>
        </form>
      </div>
    <% }) %>
  </div>
  <a href="/cart">Xem giỏ hàng</a>
  <script src="/js/main.js"></script>
</body>
</html>