{{-- Split hero. On `/`: static mock banner image + translations when montessori-premium banner exists. Else: admin sliders. **phrase** → gold accent. --}}
@php
    $premiumHeroResolveMedia = static function (?string $path): string {
        $path = trim(str_replace('\\', '/', (string) ($path ?? '')));
        if ($path === '') {
            return '';
        }
        if (preg_match('#^https?://#i', $path)) {
            return $path;
        }
        if ($path[0] === '/') {
            return url($path);
        }

        return asset(ltrim($path, '/'));
    };
    $premiumHeroFormatHeading = static function (?string $raw): string {
        return preg_replace_callback(
            '/\*\*(.+?)\*\*/u',
            static function ($m) {
                return '<span class="premium-hero-accent premium-hero-accent--gradient">'.e($m[1]).'</span>';
            },
            (string) ($raw ?? '')
        );
    };

    /* على الصفحة الرئيسية بالعربية: إن كان عنوان/وصف الهيرو من لوحة التحكم لاتيني فقط (مثل اختبار DSG…)، استخدم النص الموثوق من lang */
    $premiumHeroHomeTitleFallback = static function (?string $rawTitle): string {
        $plain = trim(strip_tags((string) $rawTitle));
        if (!request()->is('/') || app()->getLocale() !== 'ar') {
            return (string) $rawTitle;
        }
        if ($plain === '') {
            return trans('home.premium_hero_mock_title');
        }
        if (preg_match('/[\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{08A0}-\x{08FF}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF}]/u', $plain)) {
            return (string) $rawTitle;
        }
        return trans('home.premium_hero_mock_title');
    };
    $premiumHeroHomeDescFallback = static function (?string $rawDesc): string {
        $plain = trim((string) $rawDesc);
        if (!request()->is('/') || app()->getLocale() !== 'ar') {
            return (string) $rawDesc;
        }
        if ($plain === '') {
            return trans('home.premium_hero_mock_sub');
        }
        if (!preg_match('/[\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{08A0}-\x{08FF}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF}]/u', strip_tags($plain))) {
            return trans('home.premium_hero_mock_sub');
        }
        return (string) $rawDesc;
    };

    $mockBannerCandidates = [
        'hero-mock-banner.png',
        'hero-mock-banner.jpg',
        'montessori-children-learning.jpg',
        // نفس أصول بانر التحويل: إن رفعتها فقط يُفعَّل هيرو «المونتيسوري» بالنصوص من الترجمة وصورة الطفل
        'premium-home-cta.webp',
        'premium-home-cta.png',
        'premium-home-cta.jpg',
    ];
    $mockBannerRel = null;
    foreach ($mockBannerCandidates as $mockFile) {
        if (file_exists(public_path('assets/default/img/montessori-premium/'.$mockFile))) {
            $mockBannerRel = 'assets/default/img/montessori-premium/'.$mockFile;
            break;
        }
    }

    $premiumCfg = (isset($premiumHomeHero) && is_array($premiumHomeHero)) ? $premiumHomeHero : [];
    $premiumHeroHasAdminCustom = false;
    $premiumHeroTrackedKeys = [
        'title', 'description', 'title_color', 'description_color', 'title_highlight_color', 'hero_badge_color',
        'hero_image', 'hero_background',
        'btn_primary_label', 'btn_primary_url', 'btn_secondary_label', 'btn_secondary_url',
        'trust_1_l1', 'trust_1_l2', 'trust_1_meta', 'trust_2_l1', 'trust_2_l2', 'trust_2_meta',
        'trust_3_l1', 'trust_3_l2', 'trust_3_meta',
    ];
    foreach ($premiumHeroTrackedKeys as $_pk) {
        if (!empty($premiumCfg[$_pk]) && trim((string) $premiumCfg[$_pk]) !== '') {
            $premiumHeroHasAdminCustom = true;
            break;
        }
    }
    if (!$premiumHeroHasAdminCustom && array_key_exists('hero_buttons', $premiumCfg) && is_array($premiumCfg['hero_buttons']) && count($premiumCfg['hero_buttons']) > 0) {
        $premiumHeroHasAdminCustom = true;
    }
    if (!$premiumHeroHasAdminCustom && array_key_exists('trust_boxes', $premiumCfg) && is_array($premiumCfg['trust_boxes']) && count($premiumCfg['trust_boxes']) > 0) {
        $premiumHeroHasAdminCustom = true;
    }
    $premiumHeroResolveUrl = static function (?string $u, string $defaultAbsUrl): string {
        $u = trim((string) $u);
        if ($u === '') {
            return $defaultAbsUrl;
        }
        if (preg_match('#^https?://#i', $u)) {
            return $u;
        }
        if ($u[0] === '/') {
            return url($u);
        }

        return url('/'.ltrim($u, '/'));
    };
    $usePremiumHeroMockLayout = request()->is('/') && ($mockBannerRel !== null || $premiumHeroHasAdminCustom);

    $premiumTitleColorStyle = !empty($premiumCfg['title_color']) ? 'color:'.e($premiumCfg['title_color']).' !important;' : '';
    $premiumDescColorStyle = !empty($premiumCfg['description_color']) ? 'color:'.e($premiumCfg['description_color']).' !important;' : '';
    $premiumTitleHighlightColor = trim((string) ($premiumCfg['title_highlight_color'] ?? ''));
    $premiumHeroBadgeColor = trim((string) ($premiumCfg['hero_badge_color'] ?? ''));
    $premiumHeroH1ExtraClass = ($premiumTitleColorStyle !== '' ? ' premium-hero-mock-title--custom-color' : '')
        . ($premiumTitleHighlightColor !== '' ? ' premium-hero-mock-title--custom-highlight' : '');
    $premiumHeroH1StyleParts = array_filter([
        $premiumTitleColorStyle !== '' ? $premiumTitleColorStyle : null,
        $premiumTitleHighlightColor !== '' ? '--ph-title-highlight: '.e($premiumTitleHighlightColor).';' : null,
    ]);
    $premiumHeroH1StyleAttr = count($premiumHeroH1StyleParts) > 0 ? implode(' ', $premiumHeroH1StyleParts) : '';
    $premiumHeroEyebrowClass = 'premium-hero-mock-eyebrow mb-12 mb-lg-14 premium-hero-enter'.($premiumHeroBadgeColor !== '' ? ' premium-hero-mock-eyebrow--admin-color' : '');
    $premiumHeroEyebrowStyle = '--hero-enter-delay: 0.04s'.($premiumHeroBadgeColor !== '' ? '; color: '.e($premiumHeroBadgeColor).' !important;' : '');

    $premiumHeroVideoHref = '';
    if (is_array($boxVideoOrImage ?? null) && !empty($boxVideoOrImage['link'])) {
        $premiumHeroVideoHref = $boxVideoOrImage['link'];
    }

    $premiumHeroSlides = [];
    if (!$usePremiumHeroMockLayout && !empty($heroSection) && (string) $heroSection !== '2') {
        foreach (['', '2', '3'] as $suf) {
            $title = $suf === '' ? ($heroSectionData['title'] ?? '') : ($heroSectionData['title'.$suf] ?? '');
            $desc = $suf === '' ? ($heroSectionData['description'] ?? '') : ($heroSectionData['description'.$suf] ?? '');
            $btn = $suf === '' ? ($heroSectionData['button'] ?? '') : ($heroSectionData['button'.$suf] ?? '');
            $url = $suf === '' ? ($heroSectionData['url'] ?? '#') : ($heroSectionData['url'.$suf] ?? '#');
            $bg = $suf === '' ? ($heroSectionData['hero_background'] ?? '') : ($heroSectionData['hero_background'.$suf] ?? '');
            if ($title === '' && $bg === '') {
                continue;
            }
            $premiumHeroSlides[] = [
                'title' => $title,
                'desc' => $desc,
                'btn' => $btn !== '' ? $btn : trans('home.premium_cta_default'),
                'url' => $url !== '' ? $url : url('/classes'),
                'bg' => $bg,
            ];
        }
    }

    $premiumTrustAccents = ['emerald', 'sky', 'amber'];
    $premiumHeroPillIcons = ['fa-users', 'fa-mortar-board', 'fa-shield'];

    $premiumHeroButtonsResolved = [];
    if (array_key_exists('hero_buttons', $premiumCfg) && is_array($premiumCfg['hero_buttons'])) {
        foreach ($premiumCfg['hero_buttons'] as $b) {
            if (!is_array($b)) {
                continue;
            }
            $label = trim((string)($b['label'] ?? ''));
            $urlRaw = trim((string)($b['url'] ?? ''));
            if ($label === '' || $urlRaw === '') {
                continue;
            }
            $href = $premiumHeroResolveUrl($urlRaw, '#');
            $isSecondary = (($b['style'] ?? '') === 'secondary');
            $newTab = !empty($b['new_tab']);
            if (!$newTab && preg_match('#^https?://#i', $urlRaw)) {
                $newTab = true;
            }
            $premiumHeroButtonsResolved[] = [
                'label' => $label,
                'href' => $href,
                'new_tab' => $newTab,
                'is_secondary' => $isSecondary,
            ];
        }
    } else {
        $defaultPrimaryLabel = request()->is('/') ? trans('home.premium_hero_mock_btn_start') : trans('home.premium_cta_start');
        $legacyPrimaryLabel = trim((string)($premiumCfg['btn_primary_label'] ?? '')) !== '' ? $premiumCfg['btn_primary_label'] : $defaultPrimaryLabel;
        $premiumHeroButtonsResolved[] = [
            'label' => $legacyPrimaryLabel,
            'href' => $premiumHeroResolveUrl($premiumCfg['btn_primary_url'] ?? '', url('/register')),
            'new_tab' => false,
            'is_secondary' => false,
        ];
        $secLabel = trim((string)($premiumCfg['btn_secondary_label'] ?? '')) !== '' ? $premiumCfg['btn_secondary_label'] : trans('home.premium_hero_mock_watch_video');
        $secUrlRaw = trim((string)($premiumCfg['btn_secondary_url'] ?? ''));
        if ($secUrlRaw !== '') {
            $secHref = $premiumHeroResolveUrl($secUrlRaw, url('/classes'));
        } elseif ($premiumHeroVideoHref !== '') {
            $secHref = $premiumHeroVideoHref;
        } else {
            $secHref = url('/classes');
        }
        $secNewTab = ($secUrlRaw !== '' && preg_match('#^https?://#i', $secUrlRaw)) || ($secUrlRaw === '' && $premiumHeroVideoHref !== '');
        $premiumHeroButtonsResolved[] = [
            'label' => $secLabel,
            'href' => $secHref,
            'new_tab' => $secNewTab,
            'is_secondary' => true,
        ];
    }

    $premiumHeroTrustResolved = [];
    if (array_key_exists('trust_boxes', $premiumCfg) && is_array($premiumCfg['trust_boxes'])) {
        foreach ($premiumCfg['trust_boxes'] as $t) {
            if (!is_array($t)) {
                continue;
            }
            $l1 = trim((string)($t['l1'] ?? ''));
            $l2 = trim((string)($t['l2'] ?? ''));
            $meta = trim((string)($t['meta'] ?? ''));
            if ($l1 === '' && $l2 === '' && $meta === '') {
                continue;
            }
            $premiumHeroTrustResolved[] = ['l1' => $l1, 'l2' => $l2, 'meta' => $meta];
        }
    }
    if (count($premiumHeroTrustResolved) === 0) {
        for ($ti = 1; $ti <= 3; $ti++) {
            $premiumHeroTrustResolved[] = [
                'l1' => trim((string)($premiumCfg['trust_'.$ti.'_l1'] ?? '')) !== '' ? $premiumCfg['trust_'.$ti.'_l1'] : trans('home.premium_hero_mock_trust_'.$ti.'_l1'),
                'l2' => trim((string)($premiumCfg['trust_'.$ti.'_l2'] ?? '')) !== '' ? $premiumCfg['trust_'.$ti.'_l2'] : trans('home.premium_hero_mock_trust_'.$ti.'_l2'),
                'meta' => trim((string)($premiumCfg['trust_'.$ti.'_meta'] ?? '')) !== '' ? $premiumCfg['trust_'.$ti.'_meta'] : trans('home.premium_hero_mock_trust_'.$ti.'_meta'),
            ];
        }
    }
@endphp

@if ($usePremiumHeroMockLayout)
    @php
        $heroPhotoSrc = '';
        if (!empty($premiumCfg['hero_image'])) {
            $heroPhotoSrc = $premiumHeroResolveMedia($premiumCfg['hero_image']);
        } elseif ($mockBannerRel !== null) {
            $heroPhotoSrc = asset($mockBannerRel);
        }
        $heroBgSrc = !empty($premiumCfg['hero_background']) ? $premiumHeroResolveMedia($premiumCfg['hero_background']) : '';
        if (!empty(trim((string)($premiumCfg['title'] ?? '')))) {
            $premiumHeroMockTitleLines = array_values(array_filter(
                array_map('trim', preg_split('/\R/u', (string) $premiumCfg['title'])),
                static fn ($l) => $l !== ''
            ));
        } else {
            $premiumHeroMockTitleLines = array_values(array_filter(
                array_map('trim', preg_split('/\R/u', (string) trans('home.premium_hero_mock_title'))),
                static fn ($l) => $l !== ''
            ));
        }
        $premiumHeroMockSubDisplay = !empty(trim((string)($premiumCfg['description'] ?? '')))
            ? nl2br(e($premiumCfg['description']))
            : nl2br(e(trans('home.premium_hero_mock_sub')));
    @endphp
    <div id="heroCinematicRoot" class="premium-hero-banner-mock premium-hero-banner-mock--saas premium-hero-banner-mock--kids-ref premium-home-hero-wrap position-relative overflow-hidden {{ $heroBgSrc !== '' ? 'premium-hero-banner-mock--has-admin-bg' : '' }}">
        @if ($heroBgSrc !== '')
            <div class="premium-hero-admin-custom-bg" style="background-image: url('{{ $heroBgSrc }}');" aria-hidden="true"></div>
        @endif
        <div class="premium-hero-banner-mock__layers" aria-hidden="true">
            <div class="premium-hero-banner-mock__wave premium-hero-banner-mock__wave--a"></div>
            <div class="premium-hero-banner-mock__wave premium-hero-banner-mock__wave--b"></div>
            <div class="premium-hero-banner-mock__wave premium-hero-banner-mock__wave--c"></div>
            <div class="premium-hero-banner-mock__montessori-pattern"></div>
            <div class="premium-hero-banner-mock__grain" aria-hidden="true"></div>
            <div class="premium-hero-banner-mock__craft">
                <span class="premium-hero-craft premium-hero-craft--star premium-hero-craft--star-1"></span>
                <span class="premium-hero-craft premium-hero-craft--star premium-hero-craft--star-2"></span>
                <span class="premium-hero-craft premium-hero-craft--star premium-hero-craft--star-3"></span>
                <span class="premium-hero-craft premium-hero-craft--block"></span>
                <span class="premium-hero-craft premium-hero-craft--leaf"></span>
            </div>
        </div>

        <div class="container hero-split-shell premium-hero-banner-mock__shell position-relative">
            <div class="row align-items-center w-100 py-40 py-lg-50 premium-hero-banner-mock__grid" dir="ltr">
                <div class="col-lg-6 mb-4 mb-lg-0 premium-hero-mock-visual-col premium-hero-mock-visual-col--saas">
                    <div class="premium-hero-mock-photo-stage premium-hero-mock-photo-stage--organic premium-hero-photo-float premium-hero-enter premium-hero-enter--photo position-relative mx-auto mx-lg-0" style="--hero-enter-delay: 0.12s">
                        <div class="premium-hero-mock-ambient" aria-hidden="true">
                            <span class="premium-hero-mock-ambient__blob premium-hero-mock-ambient__blob--warm"></span>
                            <span class="premium-hero-mock-ambient__blob premium-hero-mock-ambient__blob--cool"></span>
                        </div>
                        <div class="premium-hero-mock-floating-deco premium-hero-mock-floating-deco--organic" aria-hidden="true">
                            <span class="premium-hero-mock-deco premium-hero-mock-deco--ring"></span>
                            <span class="premium-hero-mock-deco premium-hero-mock-deco--segment"></span>
                            <span class="premium-hero-mock-deco premium-hero-mock-deco--cube"></span>
                        </div>
                            <div class="premium-hero-mock-photo-organic">
                                <div class="premium-hero-mock-photo-swoosh" aria-hidden="true"></div>
                                <div class="premium-hero-mock-photo-wrap mx-auto mx-lg-0">
                                    @if ($heroPhotoSrc !== '')
                                        {!! premium_picture_tag([
                                            'src' => $heroPhotoSrc,
                                            'alt' => trans('home.premium_hero_mock_photo_alt'),
                                            'class' => 'premium-hero-mock-photo img-fluid',
                                            'width' => 920,
                                            'height' => 680,
                                            'loading' => 'eager',
                                            'fetchpriority' => 'high',
                                            'responsive' => true,
                                            'sizes' => '(max-width: 991px) 100vw, 50vw',
                                        ]) !!}
                                    @endif
                                </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6 text-center premium-hero-mock-copy premium-hero-mock-copy--saas" dir="rtl">
                    <div class="premium-hero-panel premium-hero-panel--mock-variant premium-hero-panel--saas premium-hero-panel--saas-choreograph">
                        <p class="{{ $premiumHeroEyebrowClass }}" style="{{ $premiumHeroEyebrowStyle }}"><i class="fa fa-certificate premium-hero-mock-eyebrow__ico" aria-hidden="true"></i>{{ trans('home.premium_montessori_badge_label') }}</p>
                        <h1 class="premium-hero-mock-title premium-hero-mock-title--stack font-weight-bold mb-14 mb-lg-18{{ $premiumHeroH1ExtraClass }}" @if($premiumHeroH1StyleAttr !== '') style="{{ $premiumHeroH1StyleAttr }}" @endif>
                            @foreach ($premiumHeroMockTitleLines as $i => $heroLine)
                                <span class="premium-hero-mock-title__line premium-hero-mock-title__line--{{ $i + 1 }} premium-hero-enter" style="{{ '--hero-enter-delay: ' . (0.1 + ($i * 0.07)) . 's' . ($premiumTitleColorStyle !== '' ? '; ' . $premiumTitleColorStyle : '') }}">{!! $premiumHeroFormatHeading($heroLine) !!}</span>
                            @endforeach
                        </h1>
                        <p class="premium-hero-mock-sub mb-22 mb-lg-28 premium-hero-enter" style="--hero-enter-delay: 0.32s;">
                            @if ($premiumDescColorStyle !== '')
                                <span class="premium-hero-mock-sub__inner d-inline-block w-100" style="{{ $premiumDescColorStyle }}">{!! $premiumHeroMockSubDisplay !!}</span>
                            @else
                                {!! $premiumHeroMockSubDisplay !!}
                            @endif
                        </p>
                        <div class="premium-hero-actions premium-hero-actions--mock-variant premium-hero-actions--glass d-flex flex-wrap align-items-center gap-hero-cta mt-8 premium-hero-enter" style="--hero-enter-delay: 0.4s">
                            @foreach ($premiumHeroButtonsResolved as $btn)
                                @if (empty($btn['is_secondary']))
                                    <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-primary btn-premium-hero-primary--glass" @if(!empty($btn['new_tab'])) rel="noopener noreferrer" target="_blank" @endif>{{ $btn['label'] }}</a>
                                @else
                                    @if (!empty($btn['new_tab']))
                                        <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-secondary--mock btn-premium-hero-secondary--glass" rel="noopener noreferrer" target="_blank">
                                            <span class="premium-hero-play-disk" aria-hidden="true"><i class="fa fa-play"></i></span>
                                            <span>{{ $btn['label'] }}</span>
                                        </a>
                                    @else
                                        <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-secondary--mock btn-premium-hero-secondary--glass">
                                            <span class="premium-hero-play-disk" aria-hidden="true"><i class="fa fa-play"></i></span>
                                            <span>{{ $btn['label'] }}</span>
                                        </a>
                                    @endif
                                @endif
                            @endforeach
                        </div>

                        @if (count($premiumHeroTrustResolved) > 0)
                        <div class="premium-hero-trust-row premium-hero-trust-row--banner-mock premium-hero-trust-row--mock-blocks premium-hero-trust-row--stack-card premium-hero-trust-strip premium-hero-trust-io premium-hero-enter" style="--hero-enter-delay: 0.52s" dir="rtl">
                            @foreach ($premiumHeroTrustResolved as $tidx => $tr)
                                @php
                                    $acc = $premiumTrustAccents[$tidx % 3];
                                    $iconVariant = ($tidx % 3) + 1;
                                @endphp
                                <div class="premium-hero-trust-item-mock premium-hero-trust-item-mock--blocks premium-hero-trust-item--accent-{{ $acc }}">
                                    <span class="premium-hero-trust-icon-wrap" aria-hidden="true">
                                        @include('web.default.includes.home._premium_hero_mock_trust_icon', ['variant' => $iconVariant])
                                    </span>
                                    <span class="premium-hero-trust-lines">
                                        <span class="premium-hero-trust-lines__l1">{{ $tr['l1'] }}</span>
                                        <span class="premium-hero-trust-lines__l2">{{ $tr['l2'] }}</span>
                                        <span class="premium-hero-trust-lines__meta">{{ $tr['meta'] }}</span>
                                    </span>
                                </div>
                            @endforeach
                        </div>
                        @endif
                    </div>
                </div>
            </div>
        </div>
        <div class="hero-premium-wave--split-edge">
            <svg class="hero-premium-wave__svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 120" preserveAspectRatio="none" aria-hidden="true">
                <path fill="var(--premium-ivory-soft, #faf8f5)" d="M0 120V55c180-28 360-38 540-18s360 58 540 44 300-66 360-86v125H0z"/>
            </svg>
        </div>
    </div>
@else
    <div id="heroCinematicRoot" class="premium-home-hero-wrap modern-hero-slider hero-cinematic hero-cinematic--mockup-split position-relative">
        <div class="hero-mockup-deco-lines" aria-hidden="true"></div>
        <div class="hero-intro-layer hero-intro-layer--flat" aria-hidden="true"></div>

        <div class="swiper hero-slider-container hero-slider-container--premium">
            <div class="swiper-wrapper">
                @if (!empty($heroSection) && (string) $heroSection === '2')
                    <div class="swiper-slide hero-slide hero-slide--mockup-split">
                        <div class="container hero-split-shell">
                            <div class="row align-items-center justify-content-between g-4 flex-column-reverse flex-lg-row w-100 py-4 px-3 px-lg-0">
                                <div class="col-lg-6 mt-4 mt-lg-0">
                                    <div class="premium-hero-photo-wrap text-center">
                                        <div class="premium-hero-photo-glow" aria-hidden="true"></div>
                                        @if (!empty($heroSectionData['has_lottie']) && (string) $heroSectionData['has_lottie'] === '1' && !empty($heroSectionData['hero_vector']))
                                            <div class="premium-hero-main-photo d-inline-block w-100" style="min-height: 280px;">
                                                <lottie-player src="{{ $premiumHeroResolveMedia($heroSectionData['hero_vector']) }}" background="transparent" speed="1" class="img-fluid" loop autoplay style="max-height:min(580px,68vh);"></lottie-player>
                                            </div>
                                        @elseif (!empty($heroSectionData['hero_vector']))
                                            {!! premium_picture_tag([
                                                'src' => $premiumHeroResolveMedia($heroSectionData['hero_vector']),
                                                'alt' => !empty($heroSectionData['title']) ? strip_tags($heroSectionData['title']) : '',
                                                'class' => 'premium-hero-main-photo img-fluid',
                                                'width' => 900,
                                                'height' => 720,
                                                'loading' => 'eager',
                                                'fetchpriority' => 'high',
                                                'responsive' => true,
                                            ]) !!}
                                        @else
                                            {!! premium_picture_tag([
                                                'src' => $premiumHeroResolveMedia($heroSectionData['hero_background'] ?? ''),
                                                'alt' => !empty($heroSectionData['title']) ? strip_tags($heroSectionData['title']) : '',
                                                'class' => 'premium-hero-main-photo img-fluid',
                                                'width' => 900,
                                                'height' => 720,
                                                'loading' => 'eager',
                                                'fetchpriority' => 'high',
                                                'responsive' => true,
                                            ]) !!}
                                        @endif
                                    </div>
                                </div>
                                <div class="col-lg-6 text-right" dir="rtl">
                                    <div class="premium-hero-panel">
                                        <span class="premium-hero-eyebrow--navy rounded-pill font-12 font-weight-bold">{{ trans('home.hero_welcome_badge') }}</span>
                                        <h1 class="premium-hero-heading--mockup-navy font-weight-bold mt-2" @if($premiumTitleColorStyle !== '') style="{{ $premiumTitleColorStyle }}" @endif>{!! $premiumHeroFormatHeading($premiumHeroHomeTitleFallback($heroSectionData['title'] ?? '')) !!}</h1>
                                        <p class="premium-hero-lead--muted mt-3 mb-0" @if($premiumDescColorStyle !== '') style="{{ $premiumDescColorStyle }}" @endif>{!! nl2br(e($premiumHeroHomeDescFallback($heroSectionData['description'] ?? ''))) !!}</p>
                                        <div class="premium-hero-actions mt-4 flex-wrap">
                                            @foreach ($premiumHeroButtonsResolved as $btn)
                                                @if (empty($btn['is_secondary']))
                                                    <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-primary" @if(!empty($btn['new_tab'])) rel="noopener" target="_blank" @endif>{{ $btn['label'] }}</a>
                                                @else
                                                    <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-secondary--navy-solid" @if(!empty($btn['new_tab'])) rel="noopener" target="_blank" @endif>
                                                        <i class="fa fa-play" aria-hidden="true"></i>
                                                        <span>{{ $btn['label'] }}</span>
                                                    </a>
                                                @endif
                                            @endforeach
                                        </div>
                                        @if (count($premiumHeroTrustResolved) > 0)
                                        <div class="premium-hero-trust-row mt-4">
                                            @foreach ($premiumHeroTrustResolved as $tidx => $tr)
                                                @php
                                                    $pillIcon = $premiumHeroPillIcons[$tidx % 3];
                                                    $pillText = $tr['l1'] !== '' ? $tr['l1'] : trim($tr['l2'].' '.$tr['meta']);
                                                @endphp
                                                <span class="premium-hero-trust-pill"><i class="fa {{ $pillIcon }} premium-hero-trust-icon" aria-hidden="true"></i>{{ $pillText }}</span>
                                            @endforeach
                                        </div>
                                        @endif
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hero-premium-wave--split-edge">
                            <svg class="hero-premium-wave__svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 120" preserveAspectRatio="none" aria-hidden="true">
                                <path fill="var(--premium-ivory-soft, #faf8f5)" d="M0 120V55c180-28 360-38 540-18s360 58 540 44 300-66 360-86v125H0z"/>
                            </svg>
                        </div>
                    </div>
                @else
                    @forelse ($premiumHeroSlides as $slide)
                        <div class="swiper-slide hero-slide hero-slide--mockup-split">
                            <div class="container hero-split-shell">
                                <div class="row align-items-center justify-content-between g-4 flex-column-reverse flex-lg-row w-100 py-4 px-3 px-lg-0">
                                    <div class="col-lg-6 mt-4 mt-lg-0">
                                        <div class="premium-hero-photo-wrap text-center">
                                            <div class="premium-hero-photo-glow" aria-hidden="true"></div>
                                            @if (!empty($slide['bg']))
                                                {!! premium_picture_tag([
                                                    'src' => $premiumHeroResolveMedia($slide['bg']),
                                                    'alt' => strip_tags($slide['title']),
                                                    'class' => 'premium-hero-main-photo img-fluid',
                                                    'width' => 900,
                                                    'height' => 720,
                                                    'loading' => $loop->first ? 'eager' : 'lazy',
                                                    'fetchpriority' => $loop->first ? 'high' : 'low',
                                                    'responsive' => true,
                                                ]) !!}
                                            @endif
                                        </div>
                                    </div>
                                    <div class="col-lg-6 text-right" dir="rtl">
                                        <div class="premium-hero-panel">
                                            <span class="premium-hero-eyebrow--navy rounded-pill font-12 font-weight-bold">{{ trans('home.hero_welcome_badge') }}</span>
                                            <h1 class="premium-hero-heading--mockup-navy font-weight-bold mt-2" @if($premiumTitleColorStyle !== '') style="{{ $premiumTitleColorStyle }}" @endif>{!! $premiumHeroFormatHeading($premiumHeroHomeTitleFallback($slide['title'])) !!}</h1>
                                            <p class="premium-hero-lead--muted mt-3 mb-0" @if($premiumDescColorStyle !== '') style="{{ $premiumDescColorStyle }}" @endif>{!! nl2br(e($premiumHeroHomeDescFallback($slide['desc']))) !!}</p>
                                            @php
                                                $slideHeroButtons = array_values(array_map(function ($row) {
                                                    return array_merge([], $row);
                                                }, $premiumHeroButtonsResolved));
                                                if (!array_key_exists('hero_buttons', $premiumCfg) && count($slideHeroButtons) > 0) {
                                                    $pl = trim((string)($premiumCfg['btn_primary_label'] ?? ''));
                                                    $pu = trim((string)($premiumCfg['btn_primary_url'] ?? ''));
                                                    $slideHeroButtons[0]['label'] = $pl !== '' ? $pl : $slide['btn'];
                                                    $slideHeroButtons[0]['href'] = $pu !== '' ? $premiumHeroResolveUrl($pu, $slide['url']) : $slide['url'];
                                                }
                                            @endphp
                                            <div class="premium-hero-actions mt-4 flex-wrap">
                                                @foreach ($slideHeroButtons as $btn)
                                                    @if (empty($btn['is_secondary']))
                                                        <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-primary" @if(!empty($btn['new_tab'])) rel="noopener" target="_blank" @endif>{{ $btn['label'] }}</a>
                                                    @else
                                                        <a href="{{ $btn['href'] }}" class="btn btn-premium-hero-secondary--navy-solid" @if(!empty($btn['new_tab'])) rel="noopener" target="_blank" @endif>
                                                            <i class="fa fa-play" aria-hidden="true"></i>
                                                            <span>{{ $btn['label'] }}</span>
                                                        </a>
                                                    @endif
                                                @endforeach
                                            </div>
                                            @if (count($premiumHeroTrustResolved) > 0)
                                            <div class="premium-hero-trust-row mt-4">
                                                @foreach ($premiumHeroTrustResolved as $tidx => $tr)
                                                    @php
                                                        $pillIcon = $premiumHeroPillIcons[$tidx % 3];
                                                        $pillText = $tr['l1'] !== '' ? $tr['l1'] : trim($tr['l2'].' '.$tr['meta']);
                                                    @endphp
                                                    <span class="premium-hero-trust-pill"><i class="fa {{ $pillIcon }} premium-hero-trust-icon" aria-hidden="true"></i>{{ $pillText }}</span>
                                                @endforeach
                                            </div>
                                            @endif
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="hero-premium-wave--split-edge">
                                <svg class="hero-premium-wave__svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 120" preserveAspectRatio="none" aria-hidden="true">
                                    <path fill="var(--premium-ivory-soft, #faf8f5)" d="M0 120V55c180-28 360-38 540-18s360 58 540 44 300-66 360-86v125H0z"/>
                                </svg>
                            </div>
                        </div>
                    @empty
                        <div class="swiper-slide hero-slide hero-slide--mockup-split">
                            <div class="container hero-split-shell py-5 text-center">
                                <p class="text-muted">{{ trans('home.premium_hero_missing') }}</p>
                            </div>
                        </div>
                    @endforelse
                @endif
            </div>
            <div class="swiper-pagination hero-pagination"></div>
            <div class="hero-nav-prev" role="button" tabindex="0" aria-label="{{ trans('pagination.previous') }}"><i class="fa fa-angle-left"></i></div>
            <div class="hero-nav-next" role="button" tabindex="0" aria-label="{{ trans('pagination.next') }}"><i class="fa fa-angle-right"></i></div>
        </div>
    </div>
@endif
