{% sw_extends '@Storefront/storefront/element/cms-element-product-description-reviews.html.twig' %}

{% block element_product_description_reviews_tabs_navigation_review %}
	{{ parent() }}
	{% set TabTitle = page.product.customFields['custom_bc_product_title_text'] %}

	{% if TabTitle %}
		<li class="nav-item">
			<a class="nav-link product-detail-tab-navigation-link" id="tab1-tab" data-bs-toggle="tab" data-offcanvas-tabs="true" href="#tab1-tab-pane" role="tab" aria-controls="tab1-tab-pane" aria-selected="true">
				<span>{{ page.product.translated.customFields.custom_bc_product_title_text }}</span>
				<span class="product-detail-tab-navigation-icon">
					{% sw_icon 'arrow-medium-right' style {'pack':'solid'} %}
				</span>
			</a>
		</li>
	{% endif %}

	{% block page_product_detail_tabs_navigation_pdf %}
		{% set pdfName = page.extensions['pdfPath'].get('pdfFileName') %}
		{% if page.extensions['attachmentsData'] !== null %}
			<li class="nav-item">
				<a class="nav-link product-detail-tab-navigation-link" id="tab1-tab" data-bs-toggle="tab" data-offcanvas-tabs="true" href="#tab1-tab-pane-pdf" role="tab" aria-controls="tab1-tab-pane-pdf" aria-selected="true">
					<span>{{ 'pdf-title.title.pdfTitle'|trans }}</span>
					<span class="product-detail-tab-navigation-icon">
						{% sw_icon 'arrow-medium-right' style {'pack':'solid'} %}
					</span>
				</a>
			</li>
		{% endif %}
	{% endblock %}
{% endblock %}

{% block element_product_description_reviews_tabs_content_review %}
	{{ parent() }}

	{% set TabContent = page.product.customFields['custom_bc_product_title_desc'] %}
	{% if TabContent %}
		<div class="tab-pane fade show" id="tab1-tab-pane" role="tabpanel" aria-labelledby="tab1-tab">
			{% block utilities_offcanvas %}
				{% block utilities_offcanvas_close %}
					<button class="btn btn-light btn-block offcanvas-close js-offcanvas-close sticky-top">
						{% block utilities_offcanvas_close_icon %}
							{% sw_icon 'x' style { 'size': 'sm' } %}
						{% endblock %}
						{% block utilities_offcanvas_close_text %}
							{{ "general.offcanvasCloseMenu"|trans }}
						{% endblock %}
					</button>
				{% endblock %}
				{% block utilities_offcanvas_content %}
					<div class="offcanvas-content-container">
						{% block page_product_detail_description_container %}
							<div class="product-detail-description tab-pane-container">
								{% block page_product_detail_description_title_tab %}{% endblock %}
								{% block page_product_detail_description_content %}
									{% block page_product_detail_description_content_text %}
										{{ page.product.customFields.custom_bc_product_title_desc|raw }}
									{% endblock %}
								{% endblock %}
							</div>
						{% endblock %}
					</div>
				{% endblock %}
			{% endblock %}
		</div>
	{% endif %}

	{% block page_product_detail_tabs_content_pdf %}
		{% if page.extensions.attachmentsData is defined and page.extensions.attachmentsData is not null %}
			{% set attachments = page.extensions.attachmentsData.all() %}
			{% set imagePdf = asset('bundles/brandcrockaquatheme/storefront/assets/images/pdf-image.png') %}

			<div class="tab-pane fade show" id="tab1-tab-pane-pdf" role="tabpanel" aria-labelledby="tab1-tab">
				{% block utilities_offcanvas2 %}
					{% block utilities_offcanvas_close2 %}
						<button class="btn btn-light btn-block offcanvas-close js-offcanvas-close sticky-top">
							{% block utilities_offcanvas_close_icon2 %}
								{% sw_icon 'x' style { 'size': 'sm' } %}
							{% endblock %}
							{% block utilities_offcanvas_close_text2 %}
								{{ "general.offcanvasCloseMenu"|trans }}
							{% endblock %}
						</button>
					{% endblock %}
					{% block utilities_offcanvas_content2 %}
						<div class="offcanvas-content-container">
							<div class="product-detail-description tab-pane-container">
								<div class="images_attachments">
									<ul>
										{% for key, file in attachments %}
											{% if file.name %}
												<li>
													<a href="{{ file.url }}" rel="noopener" target="_blank" title="{{ file.name }}">
														{% if file.extension == 'pdf' %}
															<img src="{{ imagePdf }}" width="30" height="35" alt="pdf">
														{% endif %}
														&nbsp;&nbsp;{{ file.name }}
													</a>
													&nbsp;&nbsp;
													<a href="{{ file.url }}" rel="noopener" target="_blank" class="download_link" title="{{ file.name }}" download>
														{{ 'pdf-title.title.DownloadBtn'|trans }}
													</a>
												</li>
											{% endif %}
										{% endfor %}
									</ul>
								</div>
							</div>
						</div>
					{% endblock %}
				{% endblock %}
			</div>
		{% endif %}
	{% endblock %}
{% endblock %}
