@component('panel.layouts.component', ['title' => 'ثبت محصول جدید'])

    @slot('style')
        <style>
            .card-header {
                text-align: center !important;
            }

            .form-control {

                background-color: hsl(315, 22%, 86%);
            }
            .required{
                color:red;
            }
             .py-5 {
                 padding-top: 0 !important;
            }
        </style>
    @endslot
    @slot('subject')
        <h1><i class="fa fa-users"></i> ثبت محصول جدید </h1>
        <p>ثبت محصول جدید در فروشگاه.</p>
    @endslot
    @slot('breadcrumb')
        <li class="breadcrumb-item">محصولات</li>
    @endslot

    @slot('content')
        <div class="auth-background h-auto py-5">
            <div class="container py-5">
                <div class="row align-items-center ">
                    <div class="col-lg-11 col-md-11 mx-auto">
                        <div class="card">
                            <div class="card-header"><strong>{{ __('ثبت محصول جدید') }}</strong></div>

                            <div class="card-body mx-lg-5 px-lg-3">
                                <form method="POST" action="{{ route('products.store') }}">
                                    @csrf

                                    <div class="form-group">
                                        <label for="title">{{ __('نام محصول ') }}</label><i class="required">&nbsp; *</i>
                                        <input id="title" type="text"
                                               class="form-control @error('title') is-invalid @enderror" name="title"
                                               value="{{ old('title') }}" required autocomplete="title" autofocus>

                                        @error('title')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror

                                    </div>

                                    <div class="form-group">
                                        <label for="title">slug</label>
                                        <input type="text" name="slug"
                                               class="form-control @error('slug') is-invalid  @enderror"
                                               value="{{old('slug')}}" required autocomplete="slug">
                                        @error('slug')
                                        <div class="alert alert-danger">{{$message}}</div>
                                        @enderror
                                    </div>
                                    <div class="form-group">
                                        <label for="sku">{{ __(' sku  ') }}</label>
                                        <input id="sku" type="text"
                                               class="form-control @error('sku') is-invalid @enderror" name="sku"
                                                autocomplete="sku" value="{{ old('sku') }}">

                                        @error('sku')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>
                                    <div class="form-group">
                                        <label for="price">  {{ __('قیمت  ') }}</label> <i class="required">&nbsp; *</i>
                                        <input id="price" type="text"
                                               class="form-control @error('price') is-invalid @enderror" name="price"
                                               value="{{ old('price') }}" required autocomplete="price" autofocus>

                                        @error('price')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>

                                    <div class="form-group">
                                        <label for="sale_price">{{ __('  قیمت فروش ویژه') }}</label>
                                        <input id="sale_price" type="text"
                                               class="form-control @error('sale_price') is-invalid @enderror"
                                               name="sale_price"
                                               value="{{ old('sale_price') }}" autocomplete="sale_price">

                                        @error('sale_price')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>

                                    <div class="form-group">
                                        <label for="type">{{ __(' نوع محصول') }}</label></label><i class="required">&nbsp; *</i>
                                        <select id="type" type="text"
                                                class="form-control @error('type') is-invalid @enderror" name="type"
                                                required autocomplete="type">
                                            <option value="0">ساده</option>
                                            <option value="1">متغیر</option>
                                            <option value="2">باندل</option>
                                        </select>

                                        @error('type')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>

                                    <div class="form-group">
                                        <label for="status">{{ __(' وضعیت محصول') }}</label><i class="required">&nbsp; *</i>
                                        <select id="status" type="text"
                                                class="form-control @error('status') is-invalid @enderror" name="status"
                                                value="{{ old('status') }}" required autocomplete="status">
                                            <option value="1">موجود</option>
                                            <option value="0">ناموجود</option>
                                        </select>


                                        @error('status')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>

                                    <div class="form-group">
                                        <label for="discription">{{ __(' توضیحات  محصول') }}</label></label><i class="required">&nbsp; *</i>
                                        <textarea id="discription" type="text"
                                                  class="form-control @error('discription') is-invalid @enderror"
                                                  name="discription"

                                                  autocomplete="discription">{{ old('discription') }}</textarea>

                                        @error('discription')
                                        <span class="invalid-feedback" role="alert">
                                            <strong>{{ $message }}</strong>
                                        </span>
                                        @enderror
                                    </div>
                                    <div class="form-group mb-0">
                                        <div class="">
                                            <button type="submit" class="btn btn-primary">
                                                {{ __('ثبت محصول') }}
                                            </button>

                                            <a href={{ route('products.index') }} type="button" class="btn btn-warning">
                                                انصراف</a>

                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="card-footer">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    @endslot

    @slot('script')

    @endslot

@endcomponent

