<section class="services-area-three">
    <div class="container">
        <div class="row align-items-center">
            <div class="col-xl-5 col-lg-6 col-md-8">
                <div class="section-title-two mb-50 tg-heading-subheading animation-style2">
                    @if ($subtitle = $shortcode->subtitle)
                        <span class="sub-title tg-element-title">{!! BaseHelper::clean($subtitle) !!}</span>
                    @endif

                    @if ($title = $shortcode->title)
                        <h2 class="title tg-element-title">{!! BaseHelper::clean($title) !!}</h2>
                    @endif
                </div>
            </div>
            <div class="col-xl-7 col-lg-6 col-md-4">
                @if (($buttonLabel = $shortcode->button_label) && ($buttonUrl = $shortcode->button_url))
                    <div class="view-all-btn text-end mb-30">
                        <a
                            class="btn transparent-btn-two"
                            href="{{ $buttonUrl }}"
                        >{!! BaseHelper::clean($buttonLabel) !!}</a>
                    </div>
                @endif
            </div>
        </div>
        <div class="row justify-content-center">
            @foreach ($services as $service)
                <div class="col-xl-3 col-lg-4 col-md-6 col-sm-10">
                    <div class="services-item-three">
                        <div class="services-thumb-three">
                            <a href="{{ $service->url }}">
                                <a href="{{ $service->url }}">
                                    <img
                                        src="{{ RvMedia::getImageUrl($service->image, 'small', false, RvMedia::getDefaultImage()) }}"
                                        alt="{{ $service->name }}"
                                    />
                                </a>
                            </a>
                        </div>
                        <div class="services-content-three">
                            @if ($iconImage = $service->getMetaData('icon_image', true))
                                <div class="services-icon">
                                    <img src="{{ RvMedia::getImageUrl($iconImage) }}" alt="{{ $service->name }}" width="32" height="32"/>
                                </div>
                            @elseif ($icon = $service->getMetaData('icon', true))
                                <div class="services-icon">
                                    <i class="{{ $icon }}"></i>
                                </div>
                            @endif

                            <h4 class="title"><a href="{{ $service->url }}">{{ $service->name }}</a></h4>

                            @if ($description = $service->description)
                                <p class="truncate-3-custom" title="{{ $description }}">{!! BaseHelper::clean(nl2br($description)) !!}</p>
                            @endif

                            @if ($iconImage = $service->getMetaData('icon_image', true))
                                <div class="overlay-icon">
                                    <img src="{{ RvMedia::getImageUrl($iconImage) }}" alt="{{ $service->name }}" width="32" height="32"/>
                                </div>
                            @elseif ($icon = $service->getMetaData('icon', true))
                                <div class="overlay-icon">
                                    <i class="{{ $icon }}"></i>
                                </div>
                            @endif
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>

    @if ($bgImage = $shortcode->background_image)
        <div class="services-shape-four">
            <img
                data-aos="fade-left"
                data-aos-delay="200"
                src="{{ RvMedia::getImageUrl($bgImage) }}"
                alt="{{ $shortcode->title }}"
            >
        </div>
    @endif
</section>
