{{--
    Partial: секция «Цены и местонахождение» формы автомобиля
    Переменные из родителя: $v, $countries, $cities
--}}
<div class="card card-warning card-outline">
    <div class="card-header"><h3 class="card-title">Цены и местонахождение</h3></div>
    <div class="card-body">
        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label>Цена (USD)</label>
                    <input type="number" name="price_usd"
                           class="form-control @error('price_usd') is-invalid @enderror"
                           value="{{ $v('price_usd') }}" min="0">
                    @error('price_usd')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label>Цена (RUB)</label>
                    <input type="number" name="price_rub"
                           class="form-control @error('price_rub') is-invalid @enderror"
                           value="{{ $v('price_rub') }}" min="0">
                    @error('price_rub')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label>Цена Владивосток</label>
                    <input type="number" name="price_vladivostok"
                           class="form-control @error('price_vladivostok') is-invalid @enderror"
                           value="{{ $v('price_vladivostok') }}" min="0">
                    @error('price_vladivostok')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label>Цена Москва</label>
                    <input type="number" name="price_moscow"
                           class="form-control @error('price_moscow') is-invalid @enderror"
                           value="{{ $v('price_moscow') }}" min="0">
                    @error('price_moscow')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label>Страна происхождения</label>
                    <select name="country_origin" class="form-control @error('country_origin') is-invalid @enderror">
                        <option value="">— выберите —</option>
                        @foreach($countries as $c)
                            <option value="{{ $c->value }}" @selected($v('country_origin') === $c->value)>{{ $c->value }}</option>
                        @endforeach
                    </select>
                    @error('country_origin')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label>Город</label>
                    <select name="city" class="form-control @error('city') is-invalid @enderror">
                        <option value="">— выберите —</option>
                        @foreach($cities as $c)
                            <option value="{{ $c->value }}" @selected($v('city') === $c->value)>{{ $c->value }}</option>
                        @endforeach
                    </select>
                    @error('city')<div class="invalid-feedback">{{ $message }}</div>@enderror
                </div>
            </div>
            <div class="col-md-3 d-flex align-items-end pb-3">
                <div class="custom-control custom-checkbox">
                    <input type="checkbox" class="custom-control-input" id="price_negotiable"
                           name="price_negotiable" value="1"
                           @checked($v('price_negotiable', false))>
                    <label class="custom-control-label" for="price_negotiable">Торг уместен</label>
                </div>
            </div>
        </div>
    </div>
</div>
