<div class="row g-4 {{ $address_classes ?? '' }}">
    <div class="col-12">
        <label class="form-label">{{ d_trans('Country') }}</label>
        <select name="country" class="form-select form-select-md country-select" required>
            <option value="">--</option>
            @foreach (countries() as $country)
                <option value="{{ $country->code }}" @selected($address && $address->country == $country->code)>
                    {{ $country->name }}
                </option>
            @endforeach
        </select>
    </div>
    <div class="col-12 col-lg-6">
        <label class="form-label">{{ d_trans('Address line 1') }}</label>
        <input type="text" name="address_line_1" class="form-control form-control-md"
            value="{{ $address->line_1 ?? '' }}" required>
    </div>
    <div class="col-12 col-lg-6">
        <label class="form-label">{{ d_trans('Address line 2') }}</label>
        <input type="text" name="address_line_2" class="form-control form-control-md"
            value="{{ $address->line_2 ?? '' }}">
    </div>
    <div class="col-12 col-lg-4 dynamic-states">
        <label class="form-label">{{ d_trans('State') }}</label>
        <input type="text" name="state" class="form-control form-control-md" value="{{ $address->state ?? '' }}"
            required>
        <select name="state" class="form-select form-select-md d-none" disabled>
            <option value="">--</option>
            @if ($address && $address->country)
                @foreach (states($address->country) as $state)
                    <option value="{{ $state->name }}">{{ $state->name }}</option>
                @endforeach
            @endif
        </select>
    </div>
    <div class="col-12 col-lg-4 dynamic-cities">
        <label class="form-label">{{ d_trans('City') }}</label>
        <input type="text" name="city" class="form-control form-control-md" value="{{ $address->city ?? '' }}"
            required>
        <select name="city" class="form-select form-select-md d-none" disabled>
            <option value="">--</option>
            @if ($address && $address->state)
                @foreach (cities($address->state) as $city)
                    <option value="{{ $city->name }}">{{ $city->name }}</option>
                @endforeach
            @endif
        </select>
    </div>
    <div class="col-12 col-lg-4">
        <label class="form-label">{{ d_trans('Postal code') }}</label>
        <input type="text" name="zip" class="form-control form-control-md" value="{{ $address->zip ?? '' }}"
            required>
    </div>
</div>
