{% from 'utils.html.twig' import ico, imgUpload %}
{% set bannerTextColor = '' %}
{% if (productPage.pageColorText is not null) or (productPage.pageColorText != 'null') %}
{% set bannerTextColor = "color:#{productPage.pageColorText}" %}
{% endif %}
<section class="product-banner">
{# BANNER #}
<div class="banner-img">
{{ imgUpload(productPage.cover, enum('AbstractEnum::PATH_PRODUCT_COVER'), 'product-cover', product.title) }}
</div>
{# COVER #}
{% include 'website/product/product-detail-cover.html.twig' with { mode:'mobile', img_option: 'product-photo-detail-mobile' }%}
<div class="container">
<section class="lateral-products product-banner-color product-banner-title">
<h1 class="title">{{ product.title }}</h1>
<div class="info">
{#
<div class="tags-destaque">
<span>{{ getLanguage('best_sellers', 'home') }}</span>
</div>
??? !!!*
#}
{% if productPage.description %}
<div class="desc">{{ productPage.description|raw }}</div>
{% endif %}
{% if (scoreProduct.scoreTotal > 9) %}
<div class="avaliacao">
{% include 'website/includes/stars.html.twig' with { score: scoreProduct.score }%}
<span class="total">{{ getLanguage('based_on', 'product') }} {{ scoreProduct.scoreTotal }} {{ plural(scoreProduct.scoreTotal, getLanguage('evaluation', 'product'), getLanguage('evaluations', 'product')) }}</span>
</div>
{% endif %}
<div class="tags-categorias">
{% for item in product.category %}
<span class="tag">{{ item.category }}</span>
{% endfor %}
</div>
</div>
<div class="actions">
{# WISHLIST #}
{% if not userHasProduct(product) and user %}
<button class="bookmark js--btn-wishlist {{ isInWhishlist(product.id)? 'status--active' }}"
data-product="{{ product.id }}"
data-offer="{{ productOffer.id }}"
data-title="{{ product.title }}"
data-price="{{ productOffer.getPriceRealCopy() }}"
data-tooltip-text="{{ isInWhishlist(product.id)? getLanguage('remove_from_wish_list', 'user_resume') : getLanguage('add_to_wish_list', 'user_resume') }}"
data-tooltip-class="tooltip-wish">
<span class="ico">
<i class="heart">{{ ico('heart') }}</i>
<i class="loader">{{ ico('loader-wish') }}</i>
</span>
<span class="label-off txt">{{ getLanguage('favorite', 'product') }}</span>
<span class="label-on txt">{{ getLanguage('fav', 'product') }}</span>
</button>
{% endif %}
{# SHARE #}
{% set paths = {
(enum('ProductEnum::COURSE')): 'productDetailCourse',
(enum('ProductEnum::COMBO')): 'productDetailCombo',
(enum('ProductEnum::SUBSCRIPTION')): 'productDetailPlan'
} %}
{% set shareLink = url(paths[product.type], {
type: product.getProductTypeText(),
slug: product.productLink })
%}
{% set productPhoto = null %}
{% if productPage.photo %}
{% set pathImage = getFilePathComplete({
fileName: productPage.photo,
pathConst: enum('AbstractEnum::PATH_PRODUCT_PHOTO'),
option: '',
addUpload: enum('AbstractEnum::YES')
}) %}
{% set productPhoto = pathImage.pathCdn %}
{% endif %}
<button class="share js--share-modal"
data-share-url="{{ shareLink }}"
data-share-title="{{ product.productLink }}"
data-share-photo="{{ productPhoto }}">
<i class="ico">{{ ico('share') }}</i>
<span class="txt">{{ getLanguage('share', 'product') }}</span>
</button>
</div>
</section>
{# FEATURES #}
{% include 'website/product/product-detail-features.html.twig' %}
{# PRICING #}
{% include 'website/product/product-detail-pricing.html.twig' %}
{% if saleLimitRemaining > 0 %}
{% if productOffer.getSaleIsOpen() %}
{# FREE TRIAL #}
{% if productOffer.allowTrial and not userHasProduct(productOffer.product, true) %}
<p class="trial">{{ getLanguage('free_access_by', 'product') }} <b>{{ productOffer.trialPeriod }} {{ getLanguage('days', 'product') }}</b></p>
{% endif %}
{# DISCOUNT AND COUNTDOWN #}
{% include 'website/product/product-detail-discountdown.html.twig' %}
{# SALE LIMIT #}
{% if saleLimitRemaining == 1 %}
<p class="sale-limit"><b>{{ getLanguage('remains', 'product') }}
{{ saleLimitRemaining }} {{ getLanguage('vacancy', 'product') }}</b></p>
{% else %}
<p class="sale-limit"><b>{{ getLanguage('remain', 'product') }}
{{ saleLimitRemaining }} {{ getLanguage('vacancies', 'product') }}</b></p>
{% endif %}
{% endif %}
{% endif %}
{# INÍCIO OU FECHAMENTO DA VENDA #}
{% include 'website/product/product-detail-installment-one.html.twig' %}
{# BUTTON BOX #}
<div class="actions-banner">
<div class="btn-box-product-detail" data-status="{{ isInCart ? '' : 'add' }}">
{% include 'website/product/product-detail-actions-btn-box.html.twig' %}
</div>
</div>
{# COUPOM #}
{% if infoOffer.allowBuyNow and not infoOffer.userHasProduct and productPage.showModuleCoupon %}
<div class="coupom-banner section-coupom" data-status="{{ isInCart ? '' : 'on' }}">
{% include 'website/product/product-detail-coupom.html.twig' %}
</div>
{% endif %}
</div>
</section>