@extends('layout.front.master') @section('title', config('site.seo.title', config('site.name'))) @section('description', config('site.seo.description', '')) @section('keywords', config('site.seo.keywords', '')) @section('content') {{-- ─────────── HERO SHOP (estilo Optimum Nutrition / 1stPhorm) ─────────── Inspiración: · optimumnutrition.com — hero con overlay oscuro fuerte (op-6), headline uppercase grande, 2 CTAs (SHOP NOW + Learn), trust signals row debajo · 1stphorm.com — foto atleta, navy + accent cyan, urgencia comercial Diferencias vs demo-medical (clon original): · Overlay 0.55 (op-6) vs 0.3 (op-3) — protagonismo del texto · 2 CTAs grandes 'COMPRAR AHORA' + 'WhatsApp' (acción comercial directa) · Headline uppercase + tamaño clamp (responsive) · Trust signals row debajo (envío, ANMAT, asesoramiento) --}} @php $hasCarousel = isset($carouselImages) && $carouselImages->count() > 0; $defaultSlides = collect([ (object) [ 'image_path' => site_asset_url('hero_background', 'cd-project/img/demos/supplements-shop/slides/slide-supplements-shop-1.jpg'), 'title' => config('site.welcome.hero1_headline', 'SUPLEMENTOS QUE FUNCIONAN'), 'subtitle' => config('site.welcome.hero1_subheadline', 'Marcas certificadas · Envíos a todo el país'), 'caption' => config('site.welcome.hero1_caption', 'Asesoramiento real con criterio nutricional. Sin productos truchos, sin recomendaciones vacías.'), ], (object) [ 'image_path' => site_asset_url('hero_background_2', 'cd-project/img/demos/supplements-shop/slides/slide-supplements-shop-2.jpg'), 'title' => config('site.welcome.hero2_headline', 'POTENCIÁ TU RENDIMIENTO'), 'subtitle' => config('site.welcome.hero2_subheadline', 'Whey, creatina, pre-entrenos con evidencia'), 'caption' => config('site.welcome.hero2_caption', 'Combos con descuento para tu objetivo. Stack perfecto para hipertrofia, definición o salud general.'), ], ]); $slides = $hasCarousel ? $carouselImages : $defaultSlides; $ctaPrimaryLabel = config('site.welcome.cta_primary_label', 'COMPRAR AHORA'); $ctaPrimaryUrl = config('site.welcome.cta_primary_url', '/products-catalogue'); $ctaSecondaryLabel = config('site.welcome.cta_secondary_label', 'Asesoramiento por WhatsApp'); $waPhone = preg_replace('/[^0-9+]/', '', config('site.contact.phone', '')); $ctaSecondaryUrl = config('site.welcome.cta_secondary_url', $waPhone ? 'https://wa.me/' . ltrim($waPhone, '+') : '/contact'); @endphp {{-- ─────────── FEATURED PRODUCTS (estilo ON "Bestsellers Trusted by Athletes") ─────────── Reemplaza los 4 boxes médicos por grid de 4 productos destacados. Lógica: toma los productos `is_active=1` ordenados por id DESC. Fallback: si no hay módulo products o no hay productos, oculta la sección. --}} @php $featuredProducts = collect(); if (is_module_active('products')) { try { $featuredProducts = \App\Modules\Products\Models\Product::where('is_active', true) ->with('images') ->orderBy('id', 'desc') ->limit(4) ->get(); } catch (\Throwable $e) { $featuredProducts = collect(); } } // Shop by Goal — configurable via settings.welcome.goal_{N}_{key}. // Fallback al path local cd-project/img/demos/supplements-shop/gallery/. $shopByGoals = [ [ 'title' => config('site.welcome.goal_1_title', 'AUMENTAR MASA'), 'subtitle' => config('site.welcome.goal_1_subtitle', 'Hipertrofia y fuerza'), 'image' => config('site.welcome.goal_1_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-1.jpg'), 'url' => config('site.welcome.goal_1_url', '/products-catalogue/category/proteinas'), ], [ 'title' => config('site.welcome.goal_2_title', 'DEFINICIÓN'), 'subtitle' => config('site.welcome.goal_2_subtitle', 'Pérdida de grasa'), 'image' => config('site.welcome.goal_2_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-2.jpg'), 'url' => config('site.welcome.goal_2_url', '/products-catalogue/category/proteinas'), ], [ 'title' => config('site.welcome.goal_3_title', 'SALUD DIARIA'), 'subtitle' => config('site.welcome.goal_3_subtitle', 'Vitaminas y bienestar'), 'image' => config('site.welcome.goal_3_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-3.jpg'), 'url' => config('site.welcome.goal_3_url', '/products-catalogue/category/vitaminas-minerales'), ], [ 'title' => config('site.welcome.goal_4_title', 'RENDIMIENTO'), 'subtitle' => config('site.welcome.goal_4_subtitle', 'Pre-entrenos y energía'), 'image' => config('site.welcome.goal_4_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-4.jpg'), 'url' => config('site.welcome.goal_4_url', '/products-catalogue/category/pre-entrenos-energizantes'), ], ]; @endphp @if($featuredProducts->count() > 0)

{{ config('site.welcome.featured_heading', 'Productos destacados') }}

{{ config('site.welcome.featured_subtitle', 'Los más elegidos por nuestros clientes') }}

@php /** Optimiza URL a NxN cuadrado (Unsplash query params o Cloudinary on-the-fly transformation). */ $squareImg = function(?string $url, int $size = 600) { if (!$url) return null; if (str_contains($url, 'images.unsplash.com')) { return strtok($url, '?') . "?w={$size}&h={$size}&fit=crop&auto=format&q=80"; } if (str_contains($url, 'res.cloudinary.com')) { return preg_replace('|/upload/(?!w_)|', "/upload/w_{$size},h_{$size},c_fill,g_auto,q_auto,f_auto/", $url, 1); } return $url; }; @endphp @foreach($featuredProducts as $p) @php $img = $squareImg($p->images->first()->image_path ?? null, 600); $detailUrl = route('front.products.show', $p->slug); @endphp @endforeach
@endif {{-- ─────────── SHOP BY GOAL (estilo ON "What Are You Training For?" / 1stPhorm "SHOP BY GOALS") ─────────── --}}

{{ config('site.welcome.goals_heading', '¿Cuál es tu objetivo?') }}

{{ config('site.welcome.goals_subtitle', 'Comprá por categoría según lo que querés lograr') }}

@foreach($shopByGoals as $i => $goal) @endforeach
{{-- ─────────── ATHLETE SPOTLIGHT (estilo ON "Train Like the Best — Dan Sheehan") ─────────── --}} @php $athleteEnabled = config('site.welcome.athlete_enabled', true); $athleteName = config('site.welcome.athlete_name', 'Manuel R.'); $athleteTitle = config('site.welcome.athlete_title', 'Atleta amateur · Powerlifter'); $athleteQuote = config('site.welcome.athlete_quote', '"Llevo 2 años comprando acá. La diferencia es la asesoría: no me venden lo más caro, me venden lo que necesito. Hoy estoy entrenando mejor con un combo de proteína + creatina + multi por menos de lo que pagaba antes."'); $athleteImage = config('site.welcome.athlete_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-2.jpg'); $athleteProductName = config('site.welcome.athlete_product_name', 'Combo Hipertrofia Básico'); $athleteProductUrl = config('site.welcome.athlete_product_url', '/products-catalogue/combo-hipertrofia-basico'); @endphp @if($athleteEnabled)
{{-- Imagen grande izquierda --}}
{{-- Quote derecha --}}
Historias reales

{{ config('site.welcome.athlete_heading', 'CLIENTES QUE NOS RECOMIENDAN') }}

{{ $athleteQuote }}
{{ $athleteName }}
{{ $athleteTitle }}
@if($athleteProductUrl) Ver {{ $athleteProductName }} @endif
@endif {{-- ─────────── BRANDS GALLERY (estilo 1stPhorm brand bar / ON marca-partners) ─────────── --}} @php // brands_list puede venir como array (config nativo) o string JSON (settings DB). // Si es string, decode. Si es null/vacío, defaults. $brands = config('site.welcome.brands_list', null); if (is_string($brands) && $brands !== '') { $decoded = json_decode($brands, true); if (is_array($decoded)) { $brands = $decoded; } else { // CSV separado por coma o punto y coma: "CETOL; ALBA; COLORIN" $sep = str_contains($brands, ';') ? ';' : ','; $brands = array_values(array_filter(array_map( fn($n) => trim($n) !== '' ? ['name' => trim($n), 'logo' => null] : null, explode($sep, $brands) ))); } } if (!is_array($brands) || empty($brands)) { // Defaults: 6 marcas típicas del rubro suplementos. El admin puede // sobrescribir vía /admin/site-data?tab=welcome. $brands = [ ['name' => 'Star Nutrition', 'logo' => null], ['name' => 'ENA Sport', 'logo' => null], ['name' => 'Gentech', 'logo' => null], ['name' => 'Universal', 'logo' => null], ['name' => 'BSc', 'logo' => null], ['name' => 'Pure Nutrition', 'logo' => null], ]; } @endphp

{{ config('site.welcome.brands_heading', 'Nuestras marcas') }}

{{ config('site.welcome.brands_subtitle', 'Solo trabajamos con distribuidores oficiales y marcas certificadas ANMAT') }}

@foreach($brands as $brand)
@if(!empty($brand['logo'])) {{ $brand['name'] }} @else {{-- Placeholder: nombre de la marca como texto si no hay logo --}} {{ $brand['name'] }} @endif
@endforeach
{{-- ─────────── ABOUT PREVIEW (shop-refinado) ─────────── --}}
{{ config('site.welcome.about_eyebrow', 'Sobre nosotros') }}

{{ config('site.welcome.about_heading_shop', config('site.welcome.about_heading', 'Pasión por el deporte y la nutrición')) }}

{{ config('site.welcome.about_subtitle', config('site.tagline', 'Suplementos seleccionados con criterio. Asesoramiento real.')) }}

{{ config('site.welcome.about_text', 'Somos un equipo apasionado por el deporte y el bienestar. Seleccionamos cada producto con criterio nutricional, científico y de costo-beneficio. No vendemos lo más caro — vendemos lo que funciona.') }}

{{-- 3 pilares con icons (estilo About 1stPhorm) --}}
Marcas certificadas ANMAT + distribuidores oficiales
Asesoramiento real Te decimos qué tomar según tu objetivo
Envíos a todo el país 24-72hs hábiles según zona
Conocer la tienda
@php $aboutImg = config('site.welcome.about_image', 'cd-project/img/demos/supplements-shop/gallery/gallery-1.jpg'); @endphp {{ __('Sobre nosotros') }}
{{-- ─────────── NEWSLETTER CAPTURE (estilo ON/1stPhorm) ─────────── --}} @php $newsletterEnabled = config('site.welcome.newsletter_enabled', true); @endphp @if($newsletterEnabled)

{{ config('site.welcome.newsletter_heading', 'Sumate a la comunidad') }}

{{ config('site.welcome.newsletter_subtitle', 'Recibí guías, novedades de productos y descuentos exclusivos para suscriptores.') }}

@endif {{-- ───────────────────────── SERVICES / DEPARTAMENTOS ───────────────────────── --}} @if(is_module_active('services') && isset($services) && $services->count() > 0)

{{ config('site.welcome.services_heading', __('Especialidades')) }}

{{ config('site.welcome.services_subtitle', __('Nuestras áreas de atención')) }}

@foreach($services->take(6) as $index => $service) @php $serviceIcon = $service->icon ?? null; $serviceImg = $service->header ?? null; @endphp
@if($serviceImg && !filter_var($serviceImg, FILTER_VALIDATE_URL) === false) {{ $service->title }} @elseif($serviceIcon) @else @endif

{{ $service->title }}

{{ \Illuminate\Support\Str::limit(strip_tags($service->description ?? $service->content ?? ''), 120) }}

@endforeach
@endif {{-- ───────────────────────── BLOG PREVIEW (RESOURCES STYLE) ───────────────────────── --}} @php // El controller inyecta $featuredPosts o $recentPosts según el demo. Soporto ambos. $welcomePosts = $featuredPosts ?? ($recentPosts ?? ($posts ?? collect())); @endphp @if(is_module_active('blog') && $welcomePosts->count() > 0)

{{ config('site.welcome.blog_heading', __('Guía de salud y bienestar')) }}

{{ config('site.welcome.blog_subtitle', __('Información útil para tu bienestar')) }}

@foreach($welcomePosts->take(3) as $index => $post) @php $postImg = $post->header ?: asset('cd-project/img/demos/medical/blog/blog-' . (($index % 3) + 1) . '.jpg'); @endphp @endforeach
@endif {{-- ───────────────────────── PRODUCTS — destacados con slider ───────────────────────── --}} @if(is_module_active('products')) @php // Cargamos los 8 productos más recientes activos. Owl Carousel los // muestra en slides según breakpoint (4 cols desktop / 2 tablet / 1 mobile). $featuredProducts = \App\Modules\Products\Models\Product::where('is_active', true) ->with('images', 'category') ->orderBy('id', 'desc') ->limit(8) ->get(); @endphp @if($featuredProducts->count() > 0)
{{-- Header de sección --}}

Productos destacados

Suplementos formulados con criterio clínico + material educativo y programas digitales.

{{-- Slider Owl Carousel: 4 col desktop / 3 lg / 2 md / 1 sm --}}
@endif @endif {{-- ───────────────────────── TESTIMONIALS ───────────────────────── --}} @if(is_module_active('testimonials') && isset($testimonials) && $testimonials->count() > 0)
@endif @endsection