@php
    $academySection = $course->academy_section;
    if ($academySection) {
        $academySection->load('boxes');
    }
@endphp
@if(!empty($academySection) && $academySection->status == 1 && $academySection->boxes && $academySection->boxes->count() > 0)
<section class="cp-section cp-academy cp-animate">
    <div class="container">
        @if(!empty($academySection->title))
            @include('web.default.includes.premium.section_header', [
                'title' => $academySection->title,
                'align' => 'center',
                'class' => 'mb-40',
            ])
        @endif
        <div class="cp-academy__grid">
            @foreach($academySection->boxes as $index => $box)
                <article class="cp-academy__card">
                    <div class="cp-academy__icon">
                        @if($box->icon_type == 'image' && !empty($box->icon))
                            <img src="{{ asset($box->icon) }}" alt="{{ $box->title }}" loading="lazy">
                        @elseif(!empty($box->icon))
                            <i class="{{ $box->icon }}" aria-hidden="true"></i>
                        @else
                            <i data-feather="star" width="32" height="32" aria-hidden="true"></i>
                        @endif
                    </div>
                    @if(!empty($box->title))
                        <h3 class="cp-academy__title">{{ $box->title }}</h3>
                    @endif
                    @if(!empty($box->description))
                        <p class="cp-academy__desc">{{ $box->description }}</p>
                    @endif
                </article>
            @endforeach
        </div>
    </div>
</section>
@endif
