{{-- layouts/store.blade.php — Tailwind + Alpine shell. Bootstrap 5 removed entirely; all dialogs, drawers, tabs, dropdowns use Alpine. --}} @php use Illuminate\Support\Str; $categories = $categories ?? collect(); $primary = $s->primary_color ?? '#3B82F6'; $secondary = $s->secondary_color ?? '#22D3EE'; $title = $s->seo_meta_title ?? ($s->store_name ?? __('messages.Store')); $desc = $s->seo_meta_description ?? ''; // Social links — normalize to [{platform,url}] $social = $s->social_links ?? []; if (is_string($social)) { $d = json_decode($social, true); if (json_last_error() === JSON_ERROR_NONE) $social = $d; } if (!is_array($social)) { $social = []; } $isAssoc = !empty($social) && array_keys($social) !== range(0, count($social) - 1); if ($isAssoc) { $social = collect($social)->map(fn($u,$p)=>['platform'=>$p,'url'=>$u])->values()->all(); } $assetPath = function ($p) { if (!$p) return ''; return Str::startsWith($p, ['/','http://','https://']) ? $p : asset($p); }; $client = Auth::guard('store')->user(); $accountUrl = url('/online_store/account'); $ordersUrl = url('/online_store/account/orders'); $logoutUrl = url('/online_store/logout'); $loginUrl = url('/online_store/login'); $registerUrl = url('/online_store/register'); $displayName = $client ? ($client->username ?: ($client->email ?? __('messages.Account'))) : ''; $initial = $client ? Str::upper(Str::substr($displayName, 0, 1)) : ''; $avatar = $client ? ($client->avatar_path ?? $client->avatar_url ?? null) : null; $avatarSrc = $avatar ? (Str::startsWith($avatar, ['http://','https://','/']) ? $avatar : asset($avatar)) : null; $cssStore = asset('css/storefront.css') . '?v=' . @filemtime(public_path('css/storefront.css')); $jsStore = asset('js/storefront.min.js') . '?v=' . @filemtime(public_path('js/storefront.min.js')); $rtlLocales = ['ar','he','fa','ur']; $isRtl = in_array(app()->getLocale(), $rtlLocales); $hexToRgbTriplet = function ($hex) { $hex = ltrim((string) $hex, '#'); if (strlen($hex) === 3) $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; if (strlen($hex) !== 6 || !ctype_xdigit($hex)) return '59 130 246'; return hexdec(substr($hex,0,2)) . ' ' . hexdec(substr($hex,2,2)) . ' ' . hexdec(substr($hex,4,2)); }; $accent500Rgb = $hexToRgbTriplet($primary); $modalRegEnabled = $s->registration_enabled ?? true; $modalInviteRequired = $s->require_invite_code ?? false; $hidePrices = !$client && ($s->hide_prices_for_guests ?? false); @endphp {{ $title }} {{-- Theme bootstrap — runs before paint to avoid FOUC --}} @if(!empty($s->favicon_path)) @endif {{-- PWA --}} {{-- Fonts — Inter (body) + JetBrains Mono (specs/prices) --}} {{-- Storefront bundle --}} {{-- Page loader --}}
{{-- Topbar --}}
{{ $s->topbar_text_left ?? __('messages.TopbarLeft') }}
{{-- Header --}}
{{-- Mobile menu trigger --}} {{-- Logo --}} @if(!empty($s->logo_path)) {{ $s->store_name ?? 'Store' }} @else {{ $s->store_name ?? __('messages.Store') }} @endif {{-- Desktop nav --}} {{-- Search (desktop) --}} {{-- Actions cluster --}}
{{-- Mobile search --}} {{-- Theme toggle --}} {{-- Language --}} {{-- Account --}} @if($client) @else @endif {{-- Cart --}}
{{-- Horizontal category bar (home & shop only) --}} @if(!empty($showCategoryBar) && $categories->count()) @endif
{{-- Mobile Category Sidebar (Alpine drawer) --}}
{{-- Mobile search overlay (Alpine dialog) --}}
{{-- Page content --}}
@yield('content')
{{-- Mobile bottom tab bar --}} {{-- Footer --}} {{-- Mini Cart (Alpine drawer + miniCart renderer) --}}
{{-- Auth dialog (Alpine) --}}
{{-- Stock toast --}} {{-- Storefront bundle (Alpine + theme + cart + UI components) --}} {!! $s->custom_js ?? '' !!}