<{capture name="title"}><{$product->getName()}><{/capture}>

<{assign var="images" value=$product->getImages()}>

<div class="container">
	<div class="row justify-content-center productEntity productEntityDetailPage"
		data-product_name="<{$product->getName()|escape}>"
		data-product_pid="<{$product->getOwnId()|escape}>"
		data-product_id="<{$product->getProductId()|escape}>"

		<{assign var="tempcat" value=$product->getMainCategory()}>
		<{if $tempcat}>
			data-product_category="<{$tempcat->getName()|escape}>"
		<{else}>
			data-product_category="Ingen hovedkategori"
		<{/if}>
		>
		<div class="col-10 col-md-6">
			<div class="slider-padding">
				<div id="product-slider" class="royalSlider rsDefault">
					<{section name="j" loop=$images}>
						<img class="rsImg" src="<{$images[j]->getSrc(500, 500, 'fit')}>" alt="<{$images[j]->getDescription()|escape}>" title="<{$images[j]->getDescription()|escape}>" <{$images[j]->getHtmlSize(500, 500, 'fit')}> data-rsTmb="<{$images[j]->getSrc(100, 100, 'box')}>"/>
					<{/section}>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>

		<div class="col-11 col-md-6">
			<div class="product-page">
				<section class="title">
					<h1><{$product->getName()|escape}></h1>
					<span class="product-price<{if $product->getSalePrice()}>-discount<{/if}>">

						<{if $product->getSalePrice()}>

							<{$product->getPrice()|number_format:2:",":"."}> <{$webshop->getCurrency()}>
							<i><{$product->getRealPrice()|number_format:2:",":"."}> <{$webshop->getCurrency()}></i>

						<{else}>

							<{$product->getRealPrice()|number_format:2:",":"."}> <{$webshop->getCurrency()}>

						<{/if}>

					</span>
					<{if $settings.settings.viabill_code}>
						<{if $settings.settings.viabill_type == 'graphic'}>
							<div class="ViaBill_pricetag_product" price="<{$product->getRealPrice()}>"></div>
						<{else}>
							<div class="ViaBill_pricetag_list" price="<{$product->getRealPrice()}>"></div>
						<{/if}>
					<{/if}>

					<{include file="ratings.html" rating=$product->getAvgRating()}>

				</section>

				<{if $product->getParsedDescription()}>
					<section class="product-description">
						<p class="margin-reset"><{$product->getParsedDescription()}></p>

						<div class="clearfix"></div>
					</section>
				<{/if}>

				<{include file="add_to_basket.html" product=$product}>

				<{if $get.mail}>
					<div class="notification success closeable my-4">
						<p><span>Tak!</span> Vi har modtaget din henvendelse og vender tilbage hurtigst muligt.</p>
						<a class="close" href="#"></a>
					</div>
				<{/if}>

				<{if $settings.settings.contact_on_products}>

					<div class="row justify-content-center">

						<div class="my-4">
							<a href="#small-dialog" class="popup-with-zoom-anim button margin-left-0">Har du spørgsmål?</a>
						</div>

						<div id="small-dialog" class="zoom-anim-dialog mfp-hide">
							<h3 class="headline">Spørgsmål</h3><span class="line margin-bottom-25"></span><div class="clearfix"></div>

							<form id="add-comment" class="add-comment" method="post">
								<input type="hidden" name="subject" value="Spørgsmål ang. <{$product->getName()|escape}>"/>
								<input type="hidden" name="product_url" value="<{$product->getRemoteUrl()|escape}>"/>

								<fieldset>
									<p>Skriv dit spørgsmål her, og vi vender tilbage hurtigst muligt pr. mail:</p>

									<div>
										<label>Dit navn:</label>
										<input type="text" name="name" value="<{$session_order.name|escape}>" size="50"/>
									</div>

									<div>
										<label>Din e-mail-adresse: <span>*</span></label>
										<input type="text" name="from" value="<{$session_order.email|escape}>" size="50" required/>
									</div>

									<div>
										<label>Telefonnummer, hvis du hellere vil ringes op:</label>
										<input type="text" name="phone" value="<{$session_order.phone|escape}>" size="50"/>
									</div>

									<div>
										<label>Dit spørgsmål: <span>*</span></label>
										<textarea cols="40" rows="3" name="question" required></textarea>
									</div>

								</fieldset>

								<input type="submit" value="Send" class="button color" id="send_button"/>
								<div class="clearfix"></div>

							</form>
						</div>

					</div>

				<{/if}>

			</div>
		</div>
	</div>
</div>

<div class="container">
	<div class="row justify-content-center">
		<div class="col-10 col-md-12">
			<{assign var="reviews" value=$product->getProductReviews()}>

			<{assign var="show_info" value=false}>
			<{assign var="profile" value=$product->getProfile()}>
			<{assign var="attr" value=$profile->getAttributeList()}>

			<{section name="j" loop=$attr}>
				<{if !$attr[j]->getIsVariant()}>
					<{assign var="show_info" value=true}>
				<{/if}>
			<{/section}>

			<{$manufacturer = $product->getManufacturer()}>
			<{$safety_profile = $product->getSafetyProfile()}>

			<ul class="tabs-nav">
				<{if $show_info}>
					<li><a href="#tab2">Produktinformation</a></li>
				<{/if}>
				<{if $settings.settings.show_reviews}>
					<li><a href="#tab3">Anmeldelser <span class="tab-reviews">(<{$reviews|@count}>)</span></a></li>
				<{/if}>
				<{if $manufacturer || $safety_profile}>
					<li><a href="#tab4">Produktsikkerhed</a></li>
				<{/if}>
			</ul>

			<div class="tabs-container">

				<{if $show_info}>
					<div class="tab-content" id="tab2">

						<table class="basic-table">

							<{section name="j" loop=$attr}>

								<{if !$attr[j]->getIsVariant()}>
									<tr>
										<th class="col-6 col-md-4 col-lg-2"><{$attr[j]->getName()|escape}></th>
										<td class="col"><{$product->getAttributeValue($attr[j]->getAttributeId())}></td>
									</tr>
								<{/if}>
							<{/section}>

						</table>

					</div>
				<{/if}>

				<{if $settings.settings.show_reviews}>
					<div class="tab-content" id="tab3">
						<!-- Reviews -->
						<section class="comments">
							<{if $reviews}>
								<ul>
									<{section name="p" loop=$reviews}>
										<li>
											<div class="avatar"><img src="https://www.gravatar.com/avatar/<{$reviews[p]->getEmail()|md5}>?d=mm&amp;s=70" alt="" /></div>
											<div class="comment-content"><div class="arrow-comment"></div>
												<div class="comment-by"><strong><{$reviews[p]->getName()}></strong><span class="date"><{$reviews[p]->getCreated()|date_format:"%d.%m.%Y"}></span>

													<{include file="ratings.html" rating=$reviews[p]->getRating()}>

												</div>
												<p><{$reviews[p]->getDescription()|escape}></p>
											</div>
										</li>
									<{/section}>
								</ul>
							<{else}>
								<p>Der er ikke skrevet nogen anmeldelser endnu.</p>
							<{/if}>
						</section>
					</div>
				<{/if}>

				<{if $manufacturer || $safety_profile}>
					<div class="tab-content" id="tab4">
						<{if $manufacturer}>
							<div><strong><{t}>Fabrikant<{/t}></strong></div>

							<{$manufacturer->getName()|escape}><br>
							<{$manufacturer->getAddress()|escape|nl2br}><br>

							<{if $email = $manufacturer->getEmail()}>
								<a href="mailto:<{$email|escape}>"><{$email|escape}></a><br>
							<{/if}>

							<{if $website = $manufacturer->getWebsite()}>
								<a href="<{$website|escape}>" target="_blank"><{$website|escape}></a><br>
							<{/if}>

							<{if $manufacturer->getIsOutsideEu()}>
								<br><div><strong><{t}>Kontakt inden for EU<{/t}></strong></div>

								<{$manufacturer->getEuName()|escape}><br>
								<{$manufacturer->getEuAddress()|escape}><br>

								<{if $eu_email = $manufacturer->getEuEmail()}>
									<a href="mailto:<{$eu_email|escape}>"><{$eu_email|escape}></a><br>
								<{/if}>

								<{if $eu_website = $manufacturer->getEuWebsite()}>
									<a href="<{$eu_website|escape}>" target="_blank"><{$eu_website|escape}></a><br>
								<{/if}>
							<{/if}>
						<{/if}>

						<{if $safety_profile}>
							<{foreach $safety_profile->getImages() as $image}>
								<div style="margin-top: 1rem;">
									<img src="<{$image->getSrc(500, 500, 'fit')}>" alt="<{$image->getDescription()|escape}>" <{$image->getHtmlSize(500, 500, 'fit')}>>
								</div>
							<{/foreach}>
						<{/if}>
					</div>
				<{/if}>

			</div>
		</div>
	</div>
</div>

<div class="row justify-content-center">
	<div class="col-10 col-md-12">
		<{include file="carousel.html" title="Lignende varer" products=$product->getSimilarProducts()}>
		<{include file="carousel.html" title="Relaterede produkter" products=$product->getRelatedProducts()}>
	</div>
</div>

<div class="mt-4"></div>
<{if $settings.settings.viabill_code}>
	<{$settings.settings.viabill_code}>
<{/if}>

<{include file="klaviyo_add_to_cart.html" product=$product type="product"}>