@extends('layout.front.master') @php $faqsModuleName = config('site.modules.faqs.page_header.title', config('cd-system.modules.faqs.name', 'Preguntas Frecuentes')); $faqsDescription = isset($currentCategory) && $currentCategory->description ? $currentCategory->description : config('site.modules.faqs.page_header.subtitle', config('page-headers.module_config.faqs.subtitle', 'Encuentra respuestas a las preguntas más frecuentes sobre nuestros productos y servicios.')); $activeDemo = get_active_demo(); $isDarkTheme = !in_array($activeDemo, ['demo-law-firm-2', 'demo-urban-development'], true); $sectionBg = $isDarkTheme ? 'var(--dark)' : '#F7F7F7'; $cardBg = $isDarkTheme ? 'var(--dark)' : '#ffffff'; $cardBorderColor = $isDarkTheme ? 'var(--primary-rgba-10)' : 'rgba(0, 0, 0, 0.08)'; $cardHeaderBg = $isDarkTheme ? 'var(--secondary)' : 'var(--primary)'; $cardHeaderTextColor = $isDarkTheme ? 'var(--light)' : 'var(--primary-inverse, #ffffff)'; $textColor = $isDarkTheme ? 'rgba(255, 255, 255, 0.7)' : '#444444'; $headingColor = $isDarkTheme ? 'var(--light)' : 'var(--dark-rgba-90, #212529)'; $accentColor = 'var(--primary)'; $shadowStyle = $isDarkTheme ? '0 4px 15px rgba(0,0,0,0.2)' : '0 4px 20px rgba(0,0,0,0.05)'; $itemBg = $isDarkTheme ? 'var(--dark)' : '#ffffff'; $questionBg = $isDarkTheme ? 'var(--secondary)' : '#ffffff'; $questionTextColor = $isDarkTheme ? 'var(--light)' : 'var(--secondary, #1A325D)'; $categoryNavBg = 'transparent'; $categoryNavText = $isDarkTheme ? 'rgba(255, 255, 255, 0.7)' : '#444444'; $categoryNavBorder = $isDarkTheme ? 'rgba(240, 240, 245, 0.1)' : 'rgba(0, 0, 0, 0.08)'; $categoryNavActiveBg = 'var(--primary)'; $categoryNavActiveText = $isDarkTheme ? 'var(--secondary)' : 'var(--primary-inverse, #ffffff)'; $badgeBg = $isDarkTheme ? 'rgba(240, 240, 245, 0.1)' : 'rgba(0, 0, 0, 0.05)'; $badgeText = $isDarkTheme ? 'rgba(255, 255, 255, 0.6)' : '#666666'; $searchContainerBg = $isDarkTheme ? 'linear-gradient(135deg, rgba(0,255,255,0.1), rgba(56,49,255,0.1))' : 'linear-gradient(135deg, var(--primary-rgba-10), rgba(26, 50, 93, 0.05))'; $searchContainerBorder = $isDarkTheme ? '1px solid rgba(255,255,255,0.1)' : '1px solid var(--primary-rgba-20)'; $searchInputBg = $isDarkTheme ? 'rgba(255,255,255,0.9)' : '#ffffff'; $searchInputColor = '#333'; $searchInputBorder = $isDarkTheme ? '2px solid transparent' : '2px solid rgba(0, 0, 0, 0.08)'; $searchSuggestionsBg = $isDarkTheme ? 'var(--dark)' : '#ffffff'; $searchSuggestionsBorder = $isDarkTheme ? '1px solid var(--primary-rgba-10)' : '1px solid rgba(0, 0, 0, 0.08)'; $searchStatsColor = $isDarkTheme ? 'rgba(255,255,255,0.8)' : '#666666'; @endphp {{-- Meta tags optimizados para FAQ --}} @section('title', (isset($currentCategory) ? $currentCategory->name . ' | ' : '') . $faqsModuleName) @section('description', $faqsDescription) @section('keywords', config('site.seo.keywords') . ', preguntas frecuentes, FAQ, consultas, ayuda, soporte') {{-- Open Graph Meta Tags --}} @section('og_title', (isset($currentCategory) ? $currentCategory->name . ' | ' : '') . $faqsModuleName . ' | ' . config('site.name')) @section('og_description', $faqsDescription) @section('og_image', brand_og_image()) @section('og_type', 'website') @section('og_url', url()->current()) {{-- Twitter Card Meta Tags --}} @section('twitter_title', (isset($currentCategory) ? $currentCategory->name . ' | ' : '') . $faqsModuleName . ' | ' . config('site.name')) @section('twitter_description', $faqsDescription) @section('twitter_image', brand_twitter_image()) @section('content') @php $moduleConfig = get_module_page_header_config('faqs'); $currentDemo = get_active_demo(); $isRestaurant = ($currentDemo === 'demo-restaurant'); // Para demo-restaurant, usar valores directamente sin traducción if ($isRestaurant) { $pageTitle = isset($currentCategory) ? $currentCategory->name : config('site.modules.faqs.page_header.title', $moduleConfig['title'] ?? 'FAQs'); $pageSubtitle = isset($currentCategory) ? ($currentCategory->description ?? config('site.modules.faqs.page_header.subtitle', $moduleConfig['subtitle'] ?? 'Find answers to frequently asked questions.')) : config('site.modules.faqs.page_header.subtitle', $moduleConfig['subtitle'] ?? 'Find answers to frequently asked questions.'); } else { $pageTitle = isset($currentCategory) ? $currentCategory->name : $moduleConfig['title']; $pageSubtitle = isset($currentCategory) ? ($currentCategory->description ?? $moduleConfig['subtitle']) : $moduleConfig['subtitle']; } // Generar breadcrumbs: solo pasar currentTitle si hay una categoría (página de detalle) // Para la página de índice, no pasar currentTitle para evitar duplicados $breadcrumbs = get_module_breadcrumbs('faqs', isset($currentCategory) ? $pageTitle : null); // Para demo-restaurant, corregir breadcrumbs if ($isRestaurant) { // Cambiar "Inicio" por "Home" if (count($breadcrumbs) > 0 && $breadcrumbs[0]['title'] === __('Inicio')) { $breadcrumbs[0]['title'] = 'Home'; } $faqsTitle = config('site.modules.faqs.page_header.title', 'FAQs'); if (!isset($currentCategory)) { // Actualizar el último breadcrumb (que es el del módulo) con el título correcto if (count($breadcrumbs) > 1) { $breadcrumbs[count($breadcrumbs) - 1]['title'] = $faqsTitle; } } else { // Si hay categoría, asegurar que el breadcrumb del módulo también use el título correcto foreach ($breadcrumbs as $index => $breadcrumb) { if (isset($breadcrumb['url']) && $breadcrumb['url'] === route('faqs.index')) { $breadcrumbs[$index]['title'] = $faqsTitle; break; } } } } @endphp {{-- Dynamic Header --}} @include('modules.cd-base.faqs.frontend.partials.dynamic-header') {{-- Main FAQs Section --}}
{{ $categories->sum(function($cat) { return $cat->faqs->count(); }) }} {{ $isRestaurant ? 'questions available' : __('preguntas disponibles') }}
{{-- Paginación superior --}}
@if ($faqs->onFirstPage()) {{ $isRestaurant ? 'Previous' : 'Anterior' }} @else {{ $isRestaurant ? 'Previous' : 'Anterior' }} @endif {{ $isRestaurant ? 'Page' : 'Página' }} {{ $faqs->currentPage() }} {{ $isRestaurant ? 'of' : 'de' }} {{ $faqs->lastPage() }} @if ($faqs->hasMorePages()) {{ $isRestaurant ? 'Next' : 'Siguiente' }} @else {{ $isRestaurant ? 'Next' : 'Siguiente' }} @endif

{{ $isRestaurant ? 'Search Results' : 'Resultados de búsqueda' }}

@forelse($faqs as $faq)
{!! nl2br($faq->answer) !!}
{{-- --}}
@empty

{{ $isRestaurant ? 'No FAQs available' : 'No hay preguntas frecuentes disponibles' }}

{{ $isRestaurant ? 'We will add more content soon.' : 'Pronto agregaremos más contenido.' }}

@endforelse
@foreach($categories as $category)

{{ $category->name }}

{{ $category->description ?? 'Preguntas sobre ' . $category->name }}

@foreach($category->faqs as $faq)
{!! nl2br($faq->answer) !!}
{{-- --}}
@endforeach
@endforeach

{{ $isRestaurant ? 'No results found' : 'No encontramos resultados' }}

{{ $isRestaurant ? 'Try different search terms or explore the categories.' : 'Intenta con otros términos de búsqueda o explora las categorías.' }}

{{-- Paginación inferior --}}
@if ($faqs->onFirstPage()) {{ $isRestaurant ? 'Previous' : 'Anterior' }} @else {{ $isRestaurant ? 'Previous' : 'Anterior' }} @endif {{ $isRestaurant ? 'Page' : 'Página' }} {{ $faqs->currentPage() }} {{ $isRestaurant ? 'of' : 'de' }} {{ $faqs->lastPage() }} @if ($faqs->hasMorePages()) {{ $isRestaurant ? 'Next' : 'Siguiente' }} @else {{ $isRestaurant ? 'Next' : 'Siguiente' }} @endif
@endsection