<?php $__env->startSection('title', env('APP_NAME') . ' - ' . __('Carta de Serviços')); ?>

<?php $__env->startPush('styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset('pmar/css/servicos/cartaservicos.css')); ?>">
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<?php
    $categoriaAtiva = $categorias->firstWhere('id_tipo', (int) $filtroTipo);
?>


<section>
    <div class="container">
        <div class="row">
            <hr />
            <div class="col-12">
                <?php if (isset($component)) { $__componentOriginal3d8365296ed4a4d5ce6037e216cc1003 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal3d8365296ed4a4d5ce6037e216cc1003 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.portal.breadcrumb','data' => ['items' => [
                    \App\Support\PortalBreadcrumb::home(),
                    \App\Support\PortalBreadcrumb::current(__('Carta de Serviços')),
                ]]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('portal.breadcrumb'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['items' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute([
                    \App\Support\PortalBreadcrumb::home(),
                    \App\Support\PortalBreadcrumb::current(__('Carta de Serviços')),
                ])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal3d8365296ed4a4d5ce6037e216cc1003)): ?>
<?php $attributes = $__attributesOriginal3d8365296ed4a4d5ce6037e216cc1003; ?>
<?php unset($__attributesOriginal3d8365296ed4a4d5ce6037e216cc1003); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal3d8365296ed4a4d5ce6037e216cc1003)): ?>
<?php $component = $__componentOriginal3d8365296ed4a4d5ce6037e216cc1003; ?>
<?php unset($__componentOriginal3d8365296ed4a4d5ce6037e216cc1003); ?>
<?php endif; ?>
            </div>
        </div>
    </div>
</section>


<section class="bg-light py-4">
    <div class="container">
        <div class="row align-items-center g-3">
            <div class="col-12 col-md">
                <div class="d-flex align-items-center gap-3">
                    <div class="d-flex align-items-center justify-content-center rounded-circle bg-primary text-white flex-shrink-0 cs-page-icon"
                        aria-hidden="true">
                        <i class="fa-solid fa-layer-group"></i>
                    </div>
                    <div>
                        <h1 class="h4 fw-bold text-primary mb-0"><?php echo e(__('Carta de Serviços')); ?></h1>
                        <p class="text-muted small mb-0">
                            <?php echo e(__('Serviços municipais oferecidos pela Prefeitura de Angra dos Reis')); ?>

                            <?php if($categoriaAtiva): ?>
                                &mdash; <strong><?php echo e($categoriaAtiva->tip_descricao); ?></strong>
                            <?php endif; ?>
                        </p>
                    </div>
                </div>
            </div>
            <div class="col-12 col-md-6 col-xl-5">
                <form method="GET" action="<?php echo e(route('servicos.index')); ?>" role="search">
                    <?php if((int) $filtroTipo > 0): ?>
                        <input type="hidden" name="t" value="<?php echo e($filtroTipo); ?>">
                    <?php endif; ?>
                    <div class="input-group shadow-sm rounded-5 overflow-hidden">
                        <label for="busca-servicos" class="visually-hidden"><?php echo e(__('Pesquisar serviços')); ?></label>
                        <input
                            id="busca-servicos"
                            name="pq"
                            type="search"
                            class="form-control border-0 py-2 px-3"
                            value="<?php echo e($filtroPesquisa); ?>"
                            placeholder="<?php echo e(__('Buscar serviço por nome ou palavra-chave...')); ?>"
                            autocomplete="off"
                            aria-label="<?php echo e(__('Pesquisar serviços')); ?>"
                        >
                        <button type="submit" class="btn btn-success fw-bold px-4 text-secondary border-0">
                            <i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
                            <span class="d-none d-sm-inline ms-1"><?php echo e(__('Buscar')); ?></span>
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>


<section class="py-4 py-md-5">
    <div class="container">

        <?php if($servicos === null): ?>

            
            <?php if($categorias->isEmpty()): ?>
                <div class="text-center py-5 text-muted">
                    <i class="fa-regular fa-folder-open fa-3x mb-3 d-block" aria-hidden="true"></i>
                    <p><?php echo e(__('As categorias de serviço ainda não foram cadastradas.')); ?></p>
                </div>
            <?php else: ?>
                <div class="d-flex align-items-end justify-content-between mb-4 pb-2 border-bottom">
                    <div>
                        <span class="text-uppercase fw-bold small text-success d-block mb-1 cs-results-subtitle">
                            <?php echo e(__('Serviços Municipais')); ?>

                        </span>
                        <h2 class="h4 fw-bold text-primary mb-0"><?php echo e(__('Navegue por categoria')); ?></h2>
                    </div>
                    <p class="text-muted small mb-0 text-end d-none d-md-block">
                        <?php echo e(__('Escolha uma área para ver os serviços disponíveis.')); ?>

                    </p>
                </div>

                <div class="row row-cols-2 row-cols-sm-3 row-cols-md-4 row-cols-xl-5 g-3" role="list">
                    <?php $__currentLoopData = $categorias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoria): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $imgFallback = "temp/cartadeservicos.angra.rj.gov.br/servicos/images/CDS/0.png";
                            $imgPublic   = public_path("temp/cartadeservicos.angra.rj.gov.br/servicos/images/CDS/{$categoria->id_tipo}.jpg");
                            $imgLegacy   = file_exists($imgPublic)
                                ? "temp/cartadeservicos.angra.rj.gov.br/servicos/images/CDS/{$categoria->id_tipo}.jpg"
                                : $imgFallback;
                            $imgSrc = \Illuminate\Support\Str::startsWith((string) $categoria->tip_class, 'storage/')
                                ? $categoria->tip_class
                                : $imgLegacy;
                        ?>
                        <div class="col" role="listitem">
                            <a
                                href="<?php echo e(route('servicos.index', ['t' => $categoria->id_tipo, 'p' => 1])); ?>"
                                class="card h-100 border-0 shadow-sm text-decoration-none overflow-hidden categoria-card"
                                aria-label="<?php echo e($categoria->tip_descricao); ?>"
                            >
                                <div class="ratio ratio-4x3 overflow-hidden bg-light">
                                    <img
                                        src="<?php echo e(asset($imgSrc)); ?>"
                                        alt="<?php echo e($categoria->tip_descricao); ?>"
                                        class="object-fit-cover w-100 h-100 card-img-zoom"
                                        loading="lazy"
                                    >
                                </div>
                                <div class="card-body p-2 p-sm-3 d-flex flex-column">
                                    <p class="card-title fw-semibold text-primary small mb-2 lh-sm flex-grow-1">
                                        <?php echo e($categoria->tip_descricao); ?>

                                    </p>
                                    <span class="mt-auto text-success fw-bold cs-cat-card-cta">
                                        <?php echo e(__('Ver serviços')); ?>

                                        <i class="fa-solid fa-arrow-right ms-1" aria-hidden="true"></i>
                                    </span>
                                </div>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php endif; ?>

        <?php else: ?>

            
            <div class="row g-4">

                
                <div class="col-12 col-lg-8">

                    
                    <div class="d-flex align-items-center gap-2 mb-3 px-3 py-2 rounded-3 bg-light border small text-muted">
                        <i class="fa-solid fa-magnifying-glass flex-shrink-0 text-success" aria-hidden="true"></i>
                        <span>
                            <?php if($filtroPesquisa !== ''): ?>
                                <?php echo e(__('Resultados para')); ?>

                                <strong class="text-primary">"<?php echo e($filtroPesquisa); ?>"</strong>
                                &mdash;
                            <?php endif; ?>
                            <strong><?php echo e($servicos->total()); ?></strong>
                            <?php echo e(__('serviço(s) encontrado(s)')); ?>

                        </span>
                        <?php if($filtroPesquisa !== '' || (int) $filtroTipo > 0): ?>
                            <a href="<?php echo e(route('servicos.index')); ?>" class="ms-auto text-danger text-decoration-none small fw-semibold flex-shrink-0">
                                <i class="fa-solid fa-xmark me-1" aria-hidden="true"></i><?php echo e(__('Limpar filtros')); ?>

                            </a>
                        <?php endif; ?>
                    </div>

                    <?php if($servicos->isEmpty()): ?>
                        <div class="text-center py-5 text-muted">
                            <i class="fa-regular fa-folder-open fa-3x mb-3 d-block" aria-hidden="true"></i>
                            <p><?php echo e(__('Nenhum serviço encontrado para os filtros informados.')); ?></p>
                            <a href="<?php echo e(route('servicos.index')); ?>" class="btn btn-outline-secondary btn-sm mt-2">
                                <?php echo e(__('Ver todos os serviços')); ?>

                            </a>
                        </div>
                    <?php else: ?>
                        <div role="list">
                            <?php $__currentLoopData = $servicos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $servico): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <article class="card border-0 shadow-sm mb-3 rounded-3 overflow-hidden servico-card" role="listitem">
                                    <div class="card-body p-3 p-md-4">

                                        
                                        <div class="d-flex flex-wrap gap-1 mb-2" aria-label="<?php echo e(__('Categorias')); ?>">
                                            <?php $__currentLoopData = $servico->categorias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <a
                                                    href="<?php echo e(route('servicos.index', ['t' => $cat->id_tipo, 'p' => 1])); ?>"
                                                    class="badge rounded-pill text-decoration-none bg-primary bg-opacity-10 text-white fw-semibold cs-badge-cat"
                                                    title="<?php echo e($cat->tip_descricao); ?>"
                                                >
                                                    <?php if(\Illuminate\Support\Str::startsWith((string) $cat->tip_class, 'storage/')): ?>
                                                        <img src="<?php echo e(asset($cat->tip_class)); ?>" alt="" width="12" height="12" class="rounded-1 me-1 cs-badge-img">
                                                    <?php else: ?>
                                                        <i class="fa <?php echo e($cat->tip_class ?? 'fa-circle'); ?> me-1 cs-badge-icon" aria-hidden="true"></i>
                                                    <?php endif; ?>
                                                    <?php echo e($cat->tip_descricao); ?>

                                                </a>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            <?php if($servico->tem_solicitacao_online): ?>
                                                <span class="badge rounded-pill bg-success bg-opacity-15 text-white fw-semibold cs-badge-cat">
                                                    <i class="fa-solid fa-phone me-1 cs-badge-icon" aria-hidden="true"></i>
                                                    <?php echo e(__('Online')); ?>

                                                </span>
                                            <?php endif; ?>
                                        </div>

                                        
                                        <h3 class="h6 fw-bold text-primary mb-2 lh-sm">
                                            <a
                                                href="<?php echo e(route('servicos.show', ['id' => $servico->id_cds])); ?>"
                                                class="text-decoration-none stretched-link text-primary servico-title-link"
                                            >
                                                <?php echo e($servico->cds_titulo); ?>

                                            </a>
                                        </h3>

                                        
                                        <p class="text-muted small mb-0 lh-lg">
                                            <?php echo e(\Illuminate\Support\Str::limit(strip_tags((string) $servico->cds_descricao), 300)); ?>

                                        </p>

                                    </div>
                                    <div class="card-footer bg-transparent border-top border-light d-flex justify-content-end px-3 px-md-4 py-3">
                                    <span class="text-success small fw-bold cs-servico-footer-cta" aria-hidden="true">
                                        <?php echo e(__('Ver detalhes')); ?>

                                        <i class="fa-solid fa-arrow-right ms-1 servico-arrow-icon"></i>
                                    </span>
                                    </div>
                                </article>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

                        <?php if($servicos->total() > 0): ?>
                            <div class="d-flex justify-content-center mt-4">
                                <?php echo e($servicos->links()); ?>

                            </div>
                        <?php endif; ?>
                    <?php endif; ?>
                </div>

                
                <aside class="col-12 col-lg-4" aria-label="<?php echo e(__('Navegação lateral')); ?>">
                        <div class="sticky-top cs-sidebar-sticky">

                        
                        <nav class="card-slug mb-3" aria-label="<?php echo e(__('Categorias de serviço')); ?>">
                            <h3 class="slug-telefone"><?php echo e(__('Categorias')); ?></h3>
                            <ul class="list-unstyled mb-0">
                                <?php $__empty_1 = true; $__currentLoopData = $categorias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoria): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <li>
                                        <a
                                            href="<?php echo e(route('servicos.index', ['t' => $categoria->id_tipo, 'p' => 1])); ?>"
                                            class="link-secretarias <?php echo e((int) $filtroTipo === (int) $categoria->id_tipo ? 'fw-bold text-primary' : 'text-dark'); ?>"
                                        >
                                            <span><?php echo e($categoria->tip_descricao); ?></span>
                                            <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                        </a>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <li class="text-muted small"><?php echo e(__('Sem categorias disponíveis.')); ?></li>
                                <?php endif; ?>
                            </ul>
                        </nav>

                        
                        <div class="card-slug">
                            <h3 class="slug-telefone"><?php echo e(__('Acesso Rápido')); ?></h3>
                            <ul class="list-unstyled mb-0">
                                <li>
                                    <a href="https://siarm.angra.rj.gov.br/arrecadacao/cobranca/iptu" target="_blank" rel="noopener"
                                        class="link-secretarias text-dark">
                                        <span>IPTU</span>
                                        <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="https://www.spe.angra.rj.gov.br/senhaweb/login.aspx" target="_blank" rel="noopener"
                                        class="link-secretarias text-dark">
                                        <span><?php echo e(__('Nota Fiscal')); ?></span>
                                        <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="https://portaldoservidor.angra.rj.gov.br/" target="_blank" rel="noopener"
                                        class="link-secretarias text-dark">
                                        <span><?php echo e(__('Recursos')); ?></span>
                                        <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="https://portaldoservidor.angra.rj.gov.br/nomeacoes-designacoes" target="_blank" rel="noopener"
                                        class="link-secretarias text-dark">
                                        <span><?php echo e(__('Matrícula')); ?></span>
                                        <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo e(route('sei.index')); ?>"
                                        class="link-secretarias text-dark">
                                        <span><?php echo e(__('Abertura de Processo')); ?></span>
                                        <i class="fa-solid fa-angle-right text-primary" aria-hidden="true"></i>
                                    </a>
                                </li>
                            </ul>
                        </div>

                    </div>
                </aside>

            </div>
        <?php endif; ?>

    </div>
</section>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.pmar.theme', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/portal/resources/views/servicos/index.blade.php ENDPATH**/ ?>