{% sw_extends '@Storefront/storefront/page/product-detail/tabs.html.twig' %}

{% block zen_page_product_detail_tabs_navigation_custom_tab_global %}
    {% if page.product.translated.customFields.custom_nutrition_energy_kcal|length > 0 %}
        {% set customTab = {
            'translated': {
                title: "zentheme.atmos.content.customTabTitle"|trans({"%placeholder%": config('zenitPlatformAtmos.config.customTabTitle')}),
                text: "zentheme.atmos.content.customTabText"|trans({"%placeholder%": config('zenitPlatformAtmos.config.customTabText')})
            }
        } %}

        <li class="nav-item">
            <a class="nav-link product-detail-tab-navigation-link"
                id="custom-field-global-tab"
                data-toggle="tab"
                data-offcanvas-tabs="true"
                href="#custom-field-global-tab-pane"
                role="tab"
                aria-controls="custom-field-global-tab-pane"
                aria-selected="false">
                <span>{{ customTab.translated.title }}</span>
                <span class="product-detail-tab-navigation-icon">
                    {% sw_icon 'arrow-medium-right' style {'pack':'solid'} %}
                </span>
            </a>
        </li>
    {% endif %}
{% endblock %}

{% block zen_page_product_detail_tabs_content_custom_tab_global %}
    {% if page.product.translated.customFields.custom_nutrition_energy_kcal|length > 0 %}
        <div class="tab-pane fade show"
                id="custom-field-global-tab-pane"
                role="tabpanel"
                aria-labelledby="custom-field-global-tab">
            {% sw_include '@Storefront/storefront/page/product-detail/zen-custom-global-tab.html.twig' %}
        </div>
    {% endif %}
{% endblock %}
