<section class="mt-30 mb-30 billing-regions">

    @php

        $billingUser = $user ?? auth()->user() ?? null;

    @endphp

    <h2 class="section-title">{{ trans('update.billing_information') ?? 'بيانات الفاتورة' }}</h2>

    <p class="font-14 text-gray mt-10">{{ trans('update.billing_information_hint') ?? 'أدخل بياناتك لإتمام عملية الدفع' }}</p>



    <div class="rounded-sm shadow mt-20 py-25 px-20">

        <div class="row">

            <div class="col-12 col-lg-6">

                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('auth.name') }} <span class="text-danger">*</span></label>

                    <input type="text" name="full_name" value="{{ old('full_name', $billingUser->full_name ?? '') }}"

                           class="form-control @error('full_name') is-invalid @enderror" required>

                    @error('full_name')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('public.email') }} <span class="text-danger">*</span></label>

                    <input type="email" name="email" value="{{ old('email', $billingUser->email ?? '') }}"

                           class="form-control @error('email') is-invalid @enderror" required>

                    @error('email')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('public.mobile') }} <span class="text-danger">*</span></label>

                    <input type="tel" name="mobile" value="{{ old('mobile', $billingUser->mobile ?? '') }}"

                           class="form-control @error('mobile') is-invalid @enderror"

                           placeholder="01XXXXXXXXX" required>

                    <small class="text-gray font-12">مثال: 01012345678</small>

                    @error('mobile')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.country') }} <span class="text-danger">*</span></label>

                    <input type="text" name="billing_country" value="{{ old('billing_country', billingFieldValue($billingUser, 'billing_country')) }}"

                           class="form-control @error('billing_country') is-invalid @enderror"

                           placeholder="{{ trans('update.country') }}" required>

                    @error('billing_country')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.province') }}</label>

                    <input type="text" name="billing_province" value="{{ old('billing_province', billingFieldValue($billingUser, 'billing_province')) }}"

                           class="form-control @error('billing_province') is-invalid @enderror"

                           placeholder="{{ trans('update.province') }}">

                    @error('billing_province')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>

            </div>



            <div class="col-12 col-lg-6">

                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.city') }} <span class="text-danger">*</span></label>

                    <input type="text" name="billing_city" value="{{ old('billing_city', billingFieldValue($billingUser, 'billing_city')) }}"

                           class="form-control @error('billing_city') is-invalid @enderror"

                           placeholder="{{ trans('update.city') }}" required>

                    @error('billing_city')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.district') ?? 'الحي' }}</label>

                    <input type="text" name="billing_district" value="{{ old('billing_district', billingFieldValue($billingUser, 'billing_district')) }}"

                           class="form-control @error('billing_district') is-invalid @enderror"

                           placeholder="{{ trans('update.district') ?? 'الحي' }}">

                    @error('billing_district')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.postal_code') ?? 'الرمز البريدي' }}</label>

                    <input type="text" name="postal_code" value="{{ old('postal_code', $billingUser->postal_code ?? '') }}"

                           class="form-control @error('postal_code') is-invalid @enderror">

                    @error('postal_code')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.address') }} <span class="text-danger">*</span></label>

                    <textarea name="address" rows="3" class="form-control @error('address') is-invalid @enderror" required>{{ old('address', $billingUser->address ?? '') }}</textarea>

                    @error('address')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>



                <div class="form-group">

                    <label class="input-label font-weight-500">{{ trans('update.address_2') ?? 'عنوان إضافي (اختياري)' }}</label>

                    <textarea name="address_2" rows="2" class="form-control @error('address_2') is-invalid @enderror">{{ old('address_2', $billingUser->address_2 ?? '') }}</textarea>

                    @error('address_2')

                    <div class="invalid-feedback">{{ $message }}</div>

                    @enderror

                </div>

            </div>

        </div>

    </div>

</section>

