@extends('shop.app')

@section('content')
<div class="container">
    <div class="card">
        <div class="container-fliud">
            <div class="wrapper row">
                <div class="preview col-md-6">

                    <div class="preview-pic tab-content">
                        @foreach($product->productImages as $key=>$image)
                        @if($key == 0)
                        <div class="tab-pane active" id="pic-{{$key}}"><img src="{{$image->path}}" /></div>
                        @else
                        <div class="tab-pane" id="pic-{{$key}}"><img src="{{$image->path}}" /></div>
                        @endif
                        @endforeach
                    </div>
                    <ul class="preview-thumbnail nav nav-tabs">
                        @foreach($product->productImages as $key=>$image)
                        @if($key == 0)
                        <li class="active"><a data-target="#pic-{{$key}}" data-toggle="tab"><img
                                    src="{{$image->path}}" /></a>
                        </li>
                        @else
                        <li><a data-target="#pic-{{$key}}" data-toggle="tab"><img src="{{$image->path}}" /></a>
                        </li>
                        @endif
                        @endforeach
                    </ul>

                </div>
                <div class="details col-md-6">
                    <h3 class="product-title">{{$product->attributeValue('name')}}</h3>

                    <p class="product-description">{{$product->attributeValue('description')}}</p>
                    <h4 class="price">Cijena: <span>{{$product->finalPrice()}}</span></h4>
                    @isset($sizes)
                    <h5 class="sizes">Veličina:
                        @foreach($sizes as $size)
                            <span class="size" data-toggle="tooltip" title="small">{{$size}}</span>
                        @endforeach
                    </h5>
                    @endisset
                    @isset($colors)
                    <h5 class="colors">Boje:
                        @foreach($colors as $color)
                            <span class="color" style="background-color:{{$color}}"></span>
                        @endforeach
                    </h5>
                    @endisset
                    @foreach($product->productAttributes as $attribute)
                        <h5 class="colors">{{$attribute->attribute->name}}:
                            <span> {{$attribute->value}}</span>
                        </h5>
                    @endforeach

                    <div class="action">
                        <a href="{{route('add-to-cart',['id'=>$product->id])}}" class="add-to-cart btn btn-default"
                            type="button">Dodaj u korpu</a>
                        <a href="{{route('add-to-wishlist',['id'=>$product->id])}}" class="like btn btn-default"
                            type="button"><span class="fa fa-heart"></span></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
<link rel="stylesheet" href="/themes/default/css/product_view.css">

