<?php $_shouldextend[1]=1; ?>

<?php $this->startSection('content'); ?>

	<?php $this->startPush("metadata"); ?>
 <?php echo $metadata; ?>

	<?php $this->stopPush(); ?>
	<div class="bg-white ">
 <section class="container-fluid pt-5">
 <div class="container py-5 bg-light border">

 <form action="<?php echo static::e(URL("pesquisa")); ?>" method="POST" class="row pt-4 justify-content-center align-items-center">
 <div class="col-12 col-lg-10 ">
 <div class="d-flex ">
 <h6 class="text-std-2 pt-2 pb-3 text-left mr-2 font-weight-bold">Pesquisa de Produtos/Serviços</h6>
 <h6 class="text-std-2 font-weight-normal font-italic text-palid-2 pt-2 pb-3 text-left mr-2">
 - <?php echo static::e(count($combined)); ?> resultados obtidos </h6>
 </div>
 </div>
 <div class="col-12 col-lg-8 ">
 <div class="form-group form-group-lg mb-0">
 <input type="text" name="searchBar" class="border-x-dark  rounded-0 form-control text-std-2"
    placeholder="Pesquisar por produtos" value="<?php echo static::e($searchName); ?>"
 >
 </div>
 </div>

 <div class="col-12 col-lg-2">
 <button type="submit" class="w-100 d-flex scale-item border-0 text-light on-hover justify-content-center bg-standard w-100">
 <i class="material-icons big-font-1 my-2">
 search
 </i>
 </button>
 </div>
 </form>
 </div>
 </section>
 <section class="pt-x-sm-0 position-relative container-fluid ">

 <div class="pt-x-sm-0 container py-4">

 <div class="row align-items-center justify-content-center">
 <?php if(count($combined) > 0): ?>
 <?php $__currentLoopData = $combined; $this->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $this->incrementLoopIndices(); $loop = $this->getFirstLoop(); ?>
 <?php if($item->type == 1 ): ?>
 <di class="col-12 col-lg-3 pb-4">
 <div class="hover-shadow-0 pt-3 rounded">
 <div class="d-flex justify-content-left">
 <div style="
 background: url('<?php echo static::e($item->item->attashments[0]->url); ?>') 100% 100%;
 background-size: cover;
 "
  class="scale-img product-img"
 >

 </div>
 </div>
 <div class="container-container pt-4">
 <h5 class="text-std-1"><?php echo static::e($item->item->name); ?></h5>
 <h6 class="text-palid-2 py-3 text-std-2 text-justify">
 <?php echo static::e(strlen($item->item->description) >= 100 ?
 substr($item->item->description,0, 100) : $item->item->description); ?>...
 </h6>
 <div class=" mb-3 font-italic sm-font font-weight-bold text-std-2">
 -<?php echo static::e($item->item->category_name); ?>

 </div>
 <h5 class="text-std-2 font-weight-bold">
 <?php echo static::e(number_format($item->item->price,2, ",", ".")); ?> AKZ/Unidade
 </h5>
 <a
 href="<?php echo static::e(URL("producto/".$item->item->slug)); ?>"
 class="bg-standard on-hover rounded-0 mt-3 text-light btn w-100">
 Encomendar
 <i class="fa fa-long-arrow-right ml-2"></i>
 </a>
 </div>
 </div>
 </di>
 <?php else: ?>
 <di class="col-12 col-lg-3 pb-3">
 <div class="hover-shadow-0 pt-3 rounded">
 <div class="d-flex justify-content-left">
 <div style="
 background: url('<?php echo static::e($item->item->attashments[0]->url); ?>') 100% 100%;
 background-size: cover;
 "
  class="scale-img product-img"
 >

 </div>
 </div>
 <div class="container-container pt-4">
 <h5 class="text-std-1"><?php echo static::e($item->item->name); ?></h5>
 <h6 class="text-palid-2 py-3 text-std-2 text-justify">
 <?php echo static::e(strlen($item->item->description) >= 100 ?
 substr($item->item->description,0, 100) : $item->item->description); ?>...
 </h6>
 <div class=" mb-3 font-italic sm-font font-weight-bold text-std-2">
 -Buffet
 </div>
 <h5 class="text-std-2 font-weight-bold">
 <?php echo static::e(number_format($item->item->price,2, ",", ".")); ?> AKZ/Pessoa
 </h5>
 <a
 href="<?php echo static::e(URL("buffet/".$item->item->slug)); ?>"
 class="bg-standard on-hover rounded-0 mt-3 text-light btn w-100">
 Encomendar
 <i class="fa fa-long-arrow-right ml-2"></i>
 </a>
 </div>
 </div>
 </di>
 <?php endif; ?>
 <?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>
 <?php else: ?>
 <div class="col-12 col-lg-12">
 <div class="d-flex justify-content-center py-5">
 <i class="material-icons text-orange mb-4" style="font-size: 6rem;">
 search
 </i>
 </div>
 <h6 class="big-font text-center text-std-1">
 Nenhum resultado obtido para "<?php echo static::e($searchName); ?>"
 </h6>

 <p class="text-palid-2 big-font-2 text-center text-std-2 mt-4">
 Nenhum resultado obtido para o item que pesquisou
 </p>
 </div>
 <?php endif; ?>
 </div>

 </div>
 </section>
	</div>


	<?php $this->startPush("scripts"); ?>

 <script type="text/javascript">

 /*document.getElementById("video1").addEventListener("loadedmetadata", function() {
 this.currentTime = 2.5;
 }, false);*/

 $('#btn-sign-up-project').on('click', function (e) {


 console.log("Entrou em condição");

 });

 const carouselItemTo = carouselItem => {
// $("#form-steps-holder").carousel(carouselItem);
 $(`[data-target='#img-slider'][data-slide-to=${carouselItem}]`).click();

 };

 $('.img-card').mouseenter(function () {
 $('.img-card').find('.img-card-holder').fadeOut();
 $(this).find('.img-card-holder').fadeToggle('fast');
 });

 $('.img-card-holder').on('click', function () {

 carouselItemTo($(this).data('src'));
 });
 $('.app-selection').on('click', function () {

 if ($(this).hasClass("active")) {

//  console.log("Imgame: "+$(this).find("img").attr("src") + "Tamanho: " +$(this).find("img").attr("src").indexOf("c"));
 if ($(this).find("img").attr("src").indexOf("c") > 0) {
 $(this).find("img").attr("src", $(this).find("img").attr("src").split("_")[0] + ".svg");
 console.log("Imgame2: " + $(this).find("img").attr("src"));


 }

 $(this).find("input").click();

 $(this).css('background-color', '#fff');
 $(this).removeClass('active');
 $(this).find("h6").css("color", "#000");

 } else {


 if ($(this).find("img").attr("src").indexOf("_") == -1) {
 $(this).find("img").attr("src", $(this).find("img").attr("src").split(".")[0] + "_branco.svg");

// console.log("Imgame2323: "+$(this).find("img").attr("src") + "Tamanho: " +$(this).find("img").attr("src").indexOf("c"));
 }

 $(this).find("input").click();
 $(this).css('background-color', 'rgba(2,119,189 ,1)');
 $(this).addClass('active');
 $(this).find("h6").css("color", "#fff");


 }


 });

 $('.btn-move-to-slide').on('click', function () {

 $("#form-slider").find(".carousel-item").removeClass("active");
 $($("#form-slider").find(".carousel-item").eq(0)).addClass("active");

 });

 $("a.scroll-link").click(function (event) {
 event.preventDefault();

 if ($($(this).attr('href')).hasClass('is-new'))
 $("html, body").animate({scrollTop: $($(this).attr("href")).offset().top + 70}, 600);
 else
 $("html, body").animate({scrollTop: $($(this).attr("href")).offset().top}, 600);

 });


 $('.btn-show-enterprise').on('click', function () {

 if (!$(this).hasClass('shown')) {
 $(this).parent().parent().parent().parent().find('.carousel').show('fast');
 $(this).addClass('shown');
 $(this).text("Esconder empresas");
 } else {
 $(this).parent().parent().parent().parent().find('.carousel').hide('fast');
 $(this).removeClass('shown');
 $(this).text("Ver empresas");
 }
 });

 $('.btn-see-img').on('click', function (e) {

 $('#img-displayer').attr('src', $(this).parents('.img-advertising').find('img').attr('src'));

 });


 </script>

	<?php $this->stopPush(); ?>
	<?php  $this->startComponent("components/solicitateBudget"); ?><?php  echo $this->renderComponent(); ?>
<?php $this->stopSection(); ?>

<?php if (@$_shouldextend[1]) { echo $this->runChild('guest.layouts.guestApp', ["title" => $searchName, "isOdd" =>true]); } ?>