<!DOCTYPE html>
<html lang="es">
<!-- Include Head -->
<%- include('partials/head', {title: 'Inicio'}) %>
<body>
	<!-- Header -->
	<%- include('partials/headerNavbar') %>
	<!-- /Header -->
	
	<!-- Banner -->
	<div class="banner"></div>
	<!-- /Banner -->

	<!-- ultima visita -->
	<div class="container products-wrapper">
		<div class="row">
			<div class="col-12">
				<h2 class="products-title">Basado en tu Ãºltima visita</h2>
			</div>
			<!-- Show the "visited" products -->
			<% productos.visitados.forEach(function(productVisit){ %>
				<div class="col-12 col-sm-6 col-lg-3">
					<section class="product-box">
						<a href="/products/detail/<%= productVisit.id %>">
							<figure class="product-box_image">
								<img src="/images/products/<%= productVisit.image %>" alt="imagen de producto">
							</figure>
							<article class="product-box_data">
								<h2>FINAL PRICE $<%= productVisit.price %></h2>
								<span>DISCOUNT % OFF <%= productVisit.discount %></span>
								<p><%= productVisit.name %></p>
								<i class="fas fa-truck"></i>
							</article>
						</a>
					</section>
				</div>	
			<% }) %>
		</div>
	</div>
	<!-- /ultima visita -->

	<!-- Ofertas -->
	<div class="container products-wrapper">
		<div class="row">
			<div class="col-12">
				<h2 class="products-title">Ofertas</h2>
			</div>
			<!-- Show the "in-sale" products -->
			<% productos.oferta.forEach(function(productOferta){ %>
				<div class="col-12 col-sm-6 col-lg-3">
					<section class="product-box">
						<a href="/products/detail/<%= productOferta.id %>">
							<figure class="product-box_image">
								<img src="/images/products/<%= productOferta.image %>" alt="imagen de producto">
							</figure>
							<article class="product-box_data">
								<h2>FINAL PRICE $<%= productOferta.price %></h2>
								<span>DISCOUNT % OFF <%= productOferta.discount %></span>
								<p><%= productOferta.name %></p>
								<i class="fas fa-truck"></i>
							</article>
						</a>
					</section>
				</div>
			<% }) %>	
		</div>
	</div>
	<!-- /Ofertas -->

	<!-- footer -->
	<%- include('partials/footer') %>
	<!-- /footer -->
</body>	
</html>