@php
    $footerContent = json_decode(
        \App\Models\LandingPage::where('locale', app()->getLocale())
            ->where('status', true)
            ->where('theme', site_theme())
            ->where('code', 'footer')
            ->first()?->data,
        true,
    );
    $navigation_lists = \App\Models\Navigation::whereJsonContains('type', 'widget_one')
        ->orWhereJsonContains('type', 'widget_two')
        ->get()
        ->chunk(5);
@endphp


@if ($footerContent !== null)
    <footer class="td-footer-2">
        <div class="container">
            <div class="td-footer-2-intro">
                <div class="td-footer-2-intro-logo">
                    <img src="{{ asset(setting('site_logo')) }}" alt="">
                </div>
                <div class="td-footer-2-intro-des">
                    <p>{{ $footerContent['footer_text'] }}</p>
                </div>
                <div class="td-footer-2-intro-social">
                    @foreach ($socials as $social)
                        <a href="{{ url($social->url) }}">
                            <i class="fa-brands {{ $social->class_name }}"></i>
                        </a>
                    @endforeach
                </div>
            </div>
            <div class="vertical-line"></div>
            <div class="td-footer-2-links">
                @foreach ($navigation_lists as $navigations)
                    <ul>
                        @foreach ($navigations as $navigation)
                            <li>
                                <a href="{{ $navigation->url }}">{{ __($navigation->name) }}</a>
                            </li>
                        @endforeach
                    </ul>
                @endforeach
            </div>
            <div class="td-footer-2-copyright">
                <p>{{ $footerContent['copyright_text'] }}</p>
            </div>
        </div>
        <div class="td-footer-2-element">
            <img src="{{ asset('frontend/default/img/footer/footer-element.svg') }}" alt="">
        </div>
    </footer>
@endif
