<?php $_shouldextend[1]=1; ?>

<?php $this->startSection('content'); ?>

 <?php $this->startPush("metadata"); ?>
 <?php echo $metadata; ?>

 <?php $this->stopPush(); ?>
 <div class="bg-white ">

 <section class="pt-x-sm-0 pt-5 position-relative container-fluid ">

 <div class="pt-x-sm-0 container-fluid py-4">

 <div class="row align-items-center pt-4 justify-content-end">

 <div class="col-12 col-lg-5">
 <div id="img-slide" class="carousel slide"
 data-interval="false"
 data-ride="carousel">

 <!-- Indicators -->
 <ul class="carousel-indicators">
 <?php $__currentLoopData = $product->attashments; $this->addLoop($__currentLoopData); foreach($__currentLoopData as $attasgment): $this->incrementLoopIndices(); $loop = $this->getFirstLoop(); ?>
 <li data-target="#img-slide" data-slide-to="0" class="<?php echo static::e($loop->index == 1 ? 'active'   : ''); ?>"></li>
 <?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>
 </ul>

 <!-- The slideshow -->
 <div class="carousel-inner">
 <?php $__currentLoopData = $product->attashments; $this->addLoop($__currentLoopData); foreach($__currentLoopData as $attasgment): $this->incrementLoopIndices(); $loop = $this->getFirstLoop(); ?>
 <div class="carousel-item <?php echo static::e($loop->index == 1 ? 'active' : ''); ?>">
 <div style="
 background: url('<?php echo static::e("assets/img/uploads/".$attashment->url); ?>') 100% 100%;
 background-size: cover;
 "
  class="scale-img product-img-2 <?php echo static::e($loop->index ==  1 ?  'product-banner' : ''); ?>"
 data-image = "<?php echo static::e($attasment->url); ?>"
 >

 </div>
 </div>
    <?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>
 </div>

 <!-- Left and right controls -->
 <a class="carousel-control-prev" href="#img-slide" data-slide="prev">
 <span class="carousel-control-prev-icon"></span>
 </a>
 <a class="carousel-control-next" href="#img-slide" data-slide="next">
 <span class="carousel-control-next-icon"></span>
 </a>

 </div>
 </div>
 <div class="col-12 col-lg-6">
 <div class="container-fluid
 ">
 <h4 class="text-std-1 big-font py-3 text-left" id="product-name">
 <?php echo static::e($product->name); ?>

 </h4>
 <p class=" big-font-2 pt-3 text-std-2 text-palid-2" id="product-description">
 <?php echo static::e($product->description); ?>

 </p>
 <h4 class="text-std-2 <?php echo static::e($product->obs == "" ? 'hidden' : ''); ?>  text-palid-2 sm-font pb-3  mb-4">
 OBS: <?php echo static::e($product->obs); ?>

 </h4>
 <h6 class="text-std-2 mb-4">
 Tipo: <?php echo static::e($product->type); ?>

 </h6>
 <h4 class="text-std-2 font-weight-bold mb-4" id="product-full-price" data-price="<?php echo static::e($product->price); ?>">
 <span id="product-price"><?php echo static::e(number_format($product->price,2,",", ".")); ?></span> AKZ/Unidade
 </h4>
 <div class="row">
 <div class="col-12 col-lg-4 pb-3">
 <h6 class="text-std-2 mb-3 font-weight-bold">Partilhar com</h6>
 <div class="d-flex justify-content-left">
 <a class="py-0"
    target="_blank"
    href="https://www.facebook.com/sharer/sharer.php?u=<?php echo static::e(urlencode(BASE_URL . " producto/".formatTitle($product->slug)."/")); ?>&amp;src=sdkpreparse"
 >
 <div class="social-network-holder-2 mr-2">
 <i class="fa fa-facebook icon sm-font"></i>
 </div>
 </a>
 <a class="py-0"
    target="_blank"
    href="https://wa.me/?text=<?php echo static::e(BASE_URL . "producto/".formatTitle($product->name)."/"); ?>"
 >
 <div class="social-network-holder-2">
 <i class="fa fa-whatsapp icon-2 sm-font"></i>
 </div>
 </a>
 </div>
 </div>

 <div class="col-12 col-lg-4 ml-auto">
 <div data-toggle="modal" data-target="#service-selection-modal" class="btn-order-product bg-standard on-hover rounded-0 mt-3 text-light btn w-100">
 Encomendar
 <i class="fa fa-long-arrow-right ml-2"></i>
 </div>
 </div>
 </div>

 </div>
 </div>


 </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->stopSection(); ?>

<?php if (@$_shouldextend[1]) { echo $this->runChild('guest.layouts.guestApp', ["title" => $product->name, "isOdd" =>true]); } ?>