<?php if ($moduleProductViewedAll['exibeModule']) { ?>
    <?php if($moduleProductViewedAll['positionModulo']){ ?>
        <section class="products_slider">
          <?php if($heading_title) { ?>
            <div class="product-title">
              <?php if ($product_list_title_style == Type_ProductListTitleStyle::Left){ ?>
              <div class="flex flex-row nowrap-xs between-xs middle-xs">
                <h2 class="heading-2 flex-1"><?php echo $heading_title; ?></h2>
                <a href="<?php echo $link; ?>" class="text-medium">Ver todos</a>
              </div>
              <?php } else { ?>
              <div class="flex flex-row nowrap-xs center-xs middle-xs">
                <div style="width: fit-content; <?php echo ($product_list_title_style == Type_ProductListTitleStyle::CenterWithLines) ? ' max-width: calc(100% - 164px) ' : '' ?>" class="rel">
                  <a class="heading-2 flex-1 <?php echo ($product_list_title_style == Type_ProductListTitleStyle::CenterWithLines) ? ' product-title-with-lines ' : '' ?>" href="<?php echo $link; ?>">
                    <h2 class="heading-2 flex-1"><?php echo $heading_title; ?></h2>
                  </a>
                </div>
              </div>
              <?php } ?>
            </div>
          <?php } else { ?>
            <hr class="top-padding-x-large top-margin-large">
          <?php } ?>
          <?php if ($grid) { ?>
          <div class="grid">
            <div class="grid-on-slider">
              <?php echo $moduleProductViewedAll['html'];  ?>
            </div>
          </div>
          <?php } else { ?>
          <div class="carousel-container slide-product_viewed_all js-load-slide" onload="productModules.push({element: this, name: 'slide-product_viewed_all'})">
            <div class="carousel-wrapper grid">
              <div class="carousel-list">
                <?php $boxQuantity = $moduleProductViewedAll['productsCount'] < 24 ? $moduleProductViewedAll['productsCount'] : 24 ?>
                <?php for ($i = 1; $i <= $boxQuantity; $i++) { ?>
                  <div class="item-column <?php echo $productbox_size == 4 ? 'item-column--large' : '' ?>" data-quantity="<?php echo $moduleProductViewedAll['productsCount'] ?>">
                    <div class="itembox rel paper"></div>
                  </div>
                <?php } ?>
              </div>
            </div>
          </div>
          <?php } ?>
        </section>
    <?php }else { ?> <!-- Para os modulos nas laterais (column_left, column_right) -->
      <div>
        <div class="bottom-border-gray vertical-padding-medium">
          <h2 class="heading-3">
            <a href="<?php echo $link ?>" >
              <?php echo $heading_title; ?>
            </a>
          </h2>
        </div>
        <div class="vertical-padding-medium">
          <?php echo $moduleProductViewedAll['html']; //productaside.twig ?>
        </div>
      </div>
    <?php } ?>
<?php } ?>
