{block name='productdetails-details-list'}
    {$lazyLoadImages=$lazyLoadImages|default:true}
    {$listNavigationEnabled=$listNavigationEnabled|default:true}
    {$headingAlignmentHorizontal=$headingAlignmentHorizontal|default:'default'}
    {et_getGlobalSettings assign="etGlobalSettings"}
    {* Different Tab Settings *}
    {block name='productdetails-list-settings'}
        {$showProductWeight = false}
        {$showShippingWeight = false}
        {$dimension = $Artikel->getDimension()}
        {$funcAttr = $Artikel->FunktionsAttribute[$smarty.const.FKT_ATTRIBUT_ATTRIBUTEANHAENGEN]|default:0}

        {if isset($Artikel->cArtikelgewicht) && $Artikel->fArtikelgewicht > 0
        && $Einstellungen.artikeldetails.artikeldetails_artikelgewicht_anzeigen === 'Y'}
            {$showProductWeight = true}
        {/if}

        {if isset($Artikel->cGewicht) && $Artikel->fGewicht > 0
        && $Einstellungen.artikeldetails.artikeldetails_gewicht_anzeigen === 'Y'}
            {$showShippingWeight = true}
        {/if}

        {$useAttributes = ($Einstellungen.artikeldetails.merkmale_anzeigen === 'Y'
            && !empty($Artikel->oMerkmale_arr) || $showProductWeight || $showShippingWeight
            || $Einstellungen.artikeldetails.artikeldetails_abmessungen_anzeigen === 'Y'
            && (!empty($dimension['length']) || !empty($dimension['width']) || !empty($dimension['height']))
            || isset($Artikel->cMasseinheitName) && isset($Artikel->fMassMenge) && $Artikel->fMassMenge > 0
            && $Artikel->cTeilbar !== 'Y' && ($Artikel->fAbnahmeintervall == 0 || $Artikel->fAbnahmeintervall == 1)
            || ($Einstellungen.artikeldetails.artikeldetails_attribute_anhaengen === 'Y' || $funcAttr == 1)
            && !empty($Artikel->Attribute))
        }

        {$useDescriptionWithMediaGroup = ((($Einstellungen.artikeldetails.mediendatei_anzeigen === 'YA'
            && $Artikel->cMedienDateiAnzeige !== 'tab') || $Artikel->cMedienDateiAnzeige === 'beschreibung')
            && !empty($Artikel->getMediaTypes()))
        }
        {$useDescription = ((strlen($Artikel->cBeschreibung) > 0) || $useDescriptionWithMediaGroup)}
        {$useDownloads = (isset($Artikel->oDownload_arr) && count($Artikel->oDownload_arr) > 0)}
        {$useVotes = $Einstellungen.bewertung.bewertung_anzeigen === 'Y'}
        {$useQuestionOnItem = $Einstellungen.artikeldetails.artikeldetails_fragezumprodukt_anzeigen === 'Y'}
        {$useAvailabilityNotification = ($verfuegbarkeitsBenachrichtigung === 1)}
        {$usePriceFlow = ($Einstellungen.preisverlauf.preisverlauf_anzeigen === 'Y' && $bPreisverlauf)}
        {$useMediaGroup = ((($Einstellungen.artikeldetails.mediendatei_anzeigen === 'YM'
            && $Artikel->cMedienDateiAnzeige !== 'beschreibung') || $Artikel->cMedienDateiAnzeige === 'tab')
            && !empty($Artikel->getMediaTypes()))
        }
        {$useVideo = isset($Artikel->FunktionsAttribute['youtube_id'])}
        {* Check if product has GPSR data in the first place *}
        {$useGpsr = (!empty($etGlobalSettings.gpsrSource) && $etGlobalSettings.gpsrSource !== 'none' && $etGlobalSettings.gpsrDetailMode === 'tab')}
        {if $useGpsr}
            {capture name="etGpsrContent" nocache}{include file="widgets/snippets/gpsr_content.tpl" etGlobalSettings=$etGlobalSettings product=$Artikel context='detail'}{/capture}
            {if empty($smarty.capture.etGpsrContent)}
                {$useGpsr = false}
            {else}
                {$gpsrContent = $smarty.capture.etGpsrContent}
            {/if}
        {/if}
        {$hasVotesHash = isset($smarty.get.ratings_nPage)
            || isset($smarty.get.bewertung_anzeigen)
            || isset($smarty.get.ratings_nItemsPerPage)
            || isset($smarty.get.ratings_nSortByDir)
            || isset($smarty.get.btgsterne)
        }

        {section name=iterator start=1 loop=11}
            {$tab = tab}
            {$tabname = $tab|cat:$smarty.section.iterator.index|cat:" name"}
            {$tabinhalt = $tab|cat:$smarty.section.iterator.index|cat:" inhalt"}
            {if isset($Artikel->AttributeAssoc[$tabname]) && $Artikel->AttributeAssoc[$tabname]
            && $Artikel->AttributeAssoc[$tabinhalt]}
                {$separatedTabs[{$tabname|replace:' ':'-'}] = [
                'id'      => {$tabname|replace:' ':'-'},
                'name'    => {$Artikel->AttributeAssoc[$tabname]},
                'content' => {$Artikel->AttributeAssoc[$tabinhalt]}
                ]}
            {/if}
        {/section}
    {/block}

    {* Actual LIST CONTENT *}
    {block name='productdetails-list-content-wrapper'}
        {if $useAttributes || $useDescription || $useDownloads || $useDescriptionWithMediaGroup || $useVotes || $useQuestionOnItem || $usePriceFlow
        || $useAvailabilityNotification || $useMediaGroup || !empty($separatedTabs)}

            {opcMountPoint id='opc_before_tabs' inContainer=true}

            {block name='productdetails-list-list'}
                <div class="row et-productdetails-info-list et-heading-alignment-horizontal-{$headingAlignmentHorizontal}">
                    {if $listNavigationEnabled}
                        {* Navigation Triggers *}
                        {block name='productdetails-list-nav'}
                            <div class="d-none d-md-block col-12 col-md-3">
                                <div id="productdetails-info-list" class="et-productdetails-info-list-nav list-group et-sticky et-sticky-affix et-vertical-nav" data-affix-to="#productdetails-info-list-content">
                                    {block name='et-productdetails-list-nav-items-before'}{/block}
                                    {foreach $displayOrder as $displayOrderItem}
                                        {* LIST TRIGGER: Description *}
                                        {if $useDescription && $displayOrderItem === 'description'}
                                            {block name='productdetails-list-item-description-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-description" title="{{lang key='description' section='productDetails'}|escape:'html'}">
                                                    {lang key='description' section='productDetails'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Attributes *}
                                        {if $useAttributes && $displayOrderItem === 'attributes'}
                                            {block name='productdetails-tabs-tab-attributes-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-attributes" title="{{lang section='comparelist' key='characteristics'}|escape:'html'}">
                                                    {lang section='comparelist' key='characteristics'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Downloads *}
                                        {if $useDownloads && $displayOrderItem === 'downloads'}
                                            {block name='productdetails-tabs-tab-downloads-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-downloads" title="{{lang section='productDownloads' key='downloadSection'}|escape:'html'}">
                                                    {lang section='productDownloads' key='downloadSection'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGERS: Tabs rendered from Product Attributes *}
                                        {if !empty($separatedTabs) && $displayOrderItem === 'customTabs'}
                                            {block name='productdetails-tabs-tab-separated-tabs-trigger'}
                                                {foreach $separatedTabs as $separatedTab}
                                                    <a class="link-discreet list-group-item list-group-item-action" href="#tab-{$separatedTab.name|@seofy}" title="{$separatedTab.name|escape:'html'}">
                                                        {$separatedTab.name}
                                                        <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                    </a>
                                                {/foreach}
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGERS: Votes / Ratings *}
                                        {if $useVotes && $displayOrderItem === 'votes'}
                                            {block name='productdetails-tabs-tab-votes-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-votes" title="{{lang key='Votes'}|escape:'html'}">
                                                    {lang key='Votes'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Question On Item *}
                                        {if $useQuestionOnItem && $displayOrderItem === 'questionOnItem'}
                                            {block name='productdetails-tabs-tab-question-on-item-tigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-questionOnItem" title="{{lang key='productQuestion' section='productDetails'}|escape:'html'}">
                                                    {lang key='productQuestion' section='productDetails'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}


                                        {* TAB TRIGGER: Availability Notification *}
                                        {if $useAvailabilityNotification && $displayOrderItem === 'availabilityNotification'}
                                            {block name='productdetails-tabs-tab-availability-notification-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-availabilityNotification" title="{{lang key='notifyMeWhenProductAvailableAgain'}|escape:'html'}">
                                                    {lang key='notifyMeWhenProductAvailableAgain'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Price Flow *}
                                        {if $usePriceFlow && $displayOrderItem === 'priceFlow'}
                                            {block name='productdetails-tabs-tab-price-flow-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-priceFlow" title="{{lang key='priceFlow' section='productDetails'}|escape:'html'}">
                                                    {lang key='priceFlow' section='productDetails'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Media *}
                                        {if $useMediaGroup && $displayOrderItem === 'mediaGroup'}
                                            {block name='productdetails-tabs-tab-mediagroup-trigger'}
                                                {foreach $Artikel->getMediaTypes() as $mediaType}
                                                    {$cMedienTypId = $mediaType->name|@seofy}
                                                    {$cMedienTypName = $mediaType->name}
                                                    <a class="link-discreet list-group-item list-group-item-action" href="#tab-{$cMedienTypId}" title="{$cMedienTypName|escape:'html'}">
                                                        {$cMedienTypName}
                                                        <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                    </a>
                                                {/foreach}
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: Video *}
                                        {if $useVideo && $displayOrderItem === 'video'}
                                            {block name='productdetails-tabs-tab-video-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-video" title="{{lang key='tabVideo' section='media'}|escape:'html'}">
                                                    {lang key='tabVideo' section='media'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}

                                        {* LIST TRIGGER: GPSR *}
                                        {if $useGpsr && $displayOrderItem === 'gpsr'}
                                            {block name='productdetails-tabs-tab-gpsr-trigger'}
                                                <a class="link-discreet list-group-item list-group-item-action" href="#tab-gpsr" title="{{et_language key='et360_gpsr_tab_title'}|escape:'html'}">
                                                    {et_language key='et360_gpsr_tab_title'}
                                                    <i class="icon {et_getIcon key='navigationNext'}"></i>
                                                </a>
                                            {/block}
                                        {/if}
                                    {/foreach}
                                    {block name='et-productdetails-list-nav-items-after'}{/block}
                                </div>
                            </div>
                        {/block}
                    {/if}

                    {* Content *}
                    {block name='productdetails-list-content'}
                        <div class="col-12{if $listNavigationEnabled} col-md-9{/if}">
                            <div class="et-productdetails-info-list-content" id="productdetails-info-list-content">
                                {block name='et-productdetails-list-item-content-before'}{/block}
                                {foreach $displayOrder as $displayOrderItem}
                                    {* LIST CONTENT: Description *}
                                    {if $useDescription && $displayOrderItem === 'description'}
                                        {block name='productdetails-list-item-description'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-description">
                                                {opcMountPoint id='opc_before_desc'}
                                                {block name='productdetails-list-item-headline-description'}<div class="et-productdetails-info-list-item-headline h4">{lang key='description' section='productDetails'}</div>{/block}
                                                <div class="desc">
                                                    <p>{$Artikel->cBeschreibung}</p>
                                                    {if $useDescriptionWithMediaGroup}
                                                        {foreach $Artikel->getMediaTypes() as $mediaType}
                                                            <div class="h3">{$mediaType->name}</div>
                                                            <div class="media">
                                                                {include file='productdetails/mediafile.tpl' lazyLoadImages=$lazyLoadImages}
                                                            </div>
                                                        {/foreach}
                                                    {/if}
                                                    {if (!empty($etGlobalSettings.gpsrSource) && $etGlobalSettings.gpsrSource !== 'none' && $etGlobalSettings.gpsrDetailMode === 'description')}
                                                        {include file="widgets/snippets/gpsr.tpl" etGlobalSettings=$etGlobalSettings gpsrContext='detail'}
                                                    {/if}
                                                </div>
                                                {opcMountPoint id='opc_after_desc'}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Attributes *}
                                    {if $useAttributes && $displayOrderItem === 'attributes'}
                                        {block name='productdetails-list-item-attributes'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-attributes">
                                                {block name='productdetails-list-item-headline-attributes'}<div class="et-productdetails-info-list-item-headline h4">{lang section='comparelist' key='characteristics'}</div>{/block}
                                                {include file='productdetails/attributes.tpl' tplscope='details'
                                                    showProductWeight=$showProductWeight
                                                    showShippingWeight=$showShippingWeight
                                                    dimension=$dimension
                                                    showAttributesTable=true
                                                }
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Downloads *}
                                    {if $useDownloads && $displayOrderItem === 'downloads'}
                                        {block name='productdetails-list-item-downloads'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-downloads">
                                                {block name='productdetails-list-item-headline-downloads'}<div class="et-productdetails-info-list-item-headline h4">{lang section='productDownloads' key='downloadSection'}</div>{/block}
                                                {include file='productdetails/download.tpl' lazyLoadImages=$lazyLoadImages}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Tabs rendered from Product Attributes *}
                                    {if !empty($separatedTabs) && $displayOrderItem === 'customTabs'}
                                        {block name='productdetails-list-item-separated-tabs'}
                                            {foreach $separatedTabs as $separatedTab}
                                                <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-{$separatedTab.name|@seofy}">
                                                    {block name='productdetails-list-item-headline-separated-tabs'}<div class="et-productdetails-info-list-item-headline h4">{$separatedTab.name}</div>{/block}
                                                    {$separatedTab.content}
                                                </div>
                                            {/foreach}
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Votes / Ratings *}
                                    {if $useVotes && $displayOrderItem === 'votes'}
                                        {block name='productdetails-list-item-votes'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-votes">
                                                {block name='productdetails-list-item-headline-votes'}<div class="et-productdetails-info-list-item-headline h4">{lang key='Votes'}</div>{/block}
                                                {include file='productdetails/reviews.tpl' stars=$Artikel->Bewertungen->oBewertungGesamt->fDurchschnitt}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Question on Item *}
                                    {if $useQuestionOnItem && $displayOrderItem === 'questionOnItem'}
                                        {block name='productdetails-list-item-question-on-item'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-questionOnItem">
                                                {block name='productdetails-list-item-headline-question-on-item'}<div class="et-productdetails-info-list-item-headline h4">{lang key='productQuestion' section='productDetails'}</div>{/block}
                                                {include file='productdetails/question_on_item.tpl' position="tab"}
                                            </div>
                                        {/block}
                                    {/if}

                                    {if $useAvailabilityNotification && $displayOrderItem === 'availabilityNotification'}
                                        {block name='productdetails-list-item-availability-notification'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-availabilityNotification">
                                                {block name='productdetails-list-item-headline-availability-notification'}<div class="et-productdetails-info-list-item-headline h4">{lang key='notifyMeWhenProductAvailableAgain'}</div>{/block}
                                                {include file='productdetails/availability_notification_form.tpl' position='tab' tplscope='artikeldetails'}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Price Flow *}
                                    {if $usePriceFlow && $displayOrderItem === 'priceFlow'}
                                        {block name='productdetails-list-item-price-flow'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-priceFlow">
                                                {block name='productdetails-list-item-headline-price-flow'}<div class="et-productdetails-info-list-item-headline h4">{lang key='priceFlow' section='productDetails'}</div>{/block}
                                                {include file='productdetails/price_history.tpl'}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Media *}
                                    {if $useMediaGroup && $displayOrderItem === 'mediaGroup'}
                                        {block name='productdetails-list-item-mediagroup'}
                                            {foreach $Artikel->getMediaTypes() as $mediaType}
                                                {$cMedienTypId = $mediaType->name|@seofy}
                                                <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-{$cMedienTypId}">
                                                    {block name='productdetails-list-item-headline-mediagroup'}<div class="et-productdetails-info-list-item-headline h4">{$mediaType->name}</div>{/block}
                                                    {include file='productdetails/mediafile.tpl' lazyLoadImages=$lazyLoadImages}
                                                </div>
                                            {/foreach}
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: Video *}
                                    {if $useVideo && $displayOrderItem === 'video'}
                                        {block name='productdetails-list-item-video'}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-video">
                                                {block name='productdetails-list-item-headline-youtube'}<div class="et-productdetails-info-list-item-headline h4">{lang key='tabVideo' section='media'}</div>{/block}
                                                {if isset($Artikel->FunktionsAttribute['youtube_headline'])}
                                                    <h6 class="youtube-title">{$Artikel->FunktionsAttribute['youtube_headline']}</h6>
                                                {/if}
                                                {if isset($Artikel->FunktionsAttribute['youtube_description'])}
                                                    <div class="youtube-description">
                                                        <p>{$Artikel->FunktionsAttribute['youtube_description']}</p>
                                                    </div>
                                                {/if}
                                                {if isset($Artikel->FunktionsAttribute['youtube_id'])}
                                                    {include file="widgets/base/video.tpl"
                                                        video=[
                                                            aspectRatio => '',
                                                            provider => 'youtube',
                                                            videoId => $Artikel->FunktionsAttribute['youtube_id'],
                                                            id => "product-{$Artikel->kArtikel}"
                                                        ]
                                                    }
                                                {/if}
                                            </div>
                                        {/block}
                                    {/if}

                                    {* LIST CONTENT: GPSR *}
                                    {if $useGpsr && $displayOrderItem === 'gpsr'}
                                        {block name='productdetails-list-item-gpsr'}
                                            {* LIST TRIGGER: GPSR *}
                                            <div class="et-productdetails-info-list-item-content et-vertical-nav-anchor" id="tab-gpsr">
                                                {block name='productdetails-list-item-headline-gpsr'}<div class="et-productdetails-info-list-item-headline h4">{et_language key='et360_gpsr_tab_title'}</div>{/block}
                                                {include file="widgets/snippets/gpsr.tpl" etGlobalSettings=$etGlobalSettings gpsrContext='detail' gpsrContent=$gpsrContent}
                                            </div>
                                        {/block}
                                    {/if}
                                {/foreach}
                                {block name='et-productdetails-list-item-content-after'}{/block}
                            </div>
                        </div>
                    {/block}
                </div>
            {/block}
        {/if}
    {/block}
{/block}
