<?php $__env->startSection('title', 'CONFINCA - Detalle Inmueble'); ?>
<?php $__env->startSection('content'); ?>

<div class="main-content pt-150">          
                              
                <!-- property-single-wrap -->
                <div class="property-single-wrap sticky-container" data-sticky-container>
                    <div class="cl-container">
                        <div class="row">
                            <div class="col-12">
                                <div class="flex items-center justify-between gap30 flex-wrap pt-30 pb-30">                                    
                                    <div class="list-icons-page">
                                        <div class="item">
                                            <div class="icon">
                                                <i class="flaticon-outbox"></i>
                                            </div>
                                            <p>Compartir</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-12">
                                <div class="wrap-gallery-image">
                                    <div class="list-tags type-1">
                                        <a href="#" class="tags-item for-sell"><?php echo e($property->offer->name); ?></a>
                                    </div>
                                    
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $property->images->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <a href="<?php echo e(Storage::url($image->image)); ?>" 
                                        class="item-<?php echo e($index + 1); ?>" 
                                        data-fancybox="gallery">
                                            <img src="<?php echo e(Storage::url($image->image)); ?>" alt="Imagen <?php echo e($index + 1); ?>">
                                        </a>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $property->images->skip(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <a href="<?php echo e(Storage::url($image->image)); ?>" 
                                        data-fancybox="gallery" 
                                        style="display:none">
                                            <img src="<?php echo e(Storage::url($image->image)); ?>" alt="Imagen propiedad">
                                        </a>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($property->images->count() > 5): ?>
                                        <a href="<?php echo e(Storage::url($property->images->skip(5)->first()->image)); ?>" 
                                        class="more-photos" 
                                        data-fancybox="gallery">
                                            <i class="flaticon-gallery"></i>
                                            <p><?php echo e($property->images->count()); ?> Fotos</p>
                                        </a>
                                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                </div>
                            </div>
                            <div class="col-xl-8">
                    <div class="content-wrap">
                        <div class="head-title wow fadeInUp">
                            <div>
                                <h3><?php echo e($property->typeProperty->name ?? ''); ?></h3>
                                <div class="location">
                                    <div class="icon">
                                        <i class="flaticon-location"></i>
                                    </div>
                                    <div class="text-content"><?php echo e($property->address); ?></div>
                                </div>
                            </div>
                            <div>
                                <div class="price">$<?php echo e(number_format($property->price)); ?></div>
                            </div>
                        </div>

                        <div class="box-items">
                            <div class="item wow fadeInUp" data-wow-delay="0.2s">
                                <div class="icon"><i class="flaticon-minus-front"></i></div>
                                <div class="text-content"><?php echo e($property->area); ?> m²</div>
                            </div>
                            <div class="item wow fadeInUp">
                                <div class="icon"><i class="flaticon-hotel"></i></div>
                                <div class="text-content"><?php echo e($property->rooms); ?> Habitaciones</div>
                            </div>
                            <div class="item wow fadeInUp" data-wow-delay="0.1s">
                                <div class="icon"><i class="flaticon-bath-tub"></i></div>
                                <div class="text-content"><?php echo e($property->bathrooms); ?> Baños</div>
                            </div>
                        </div>

                        <div class="details">
                                        <h4 class="wow fadeInUp">Detalles</h4>
                                        <div class="list-item">
                                            <div class="item wow fadeInUp">
                                                <div class="text">Código:</div>
                                                <p><?php echo e($property->code); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp" data-wow-delay="0.1s">
                                                <div class="text">Garage:</div>
                                                <p><?php echo e($property->parking); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp">
                                                <div class="text">Precio:</div>
                                                <p>$<?php echo e(number_format($property->price)); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp" data-wow-delay="0.1s">
                                                <div class="text">Administración:</div>
                                                <p>$<?php echo e(number_format($property->administration)); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp">
                                                <div class="text">Habitaciones:</div>
                                                <p><?php echo e($property->rooms); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp" data-wow-delay="0.1s">
                                                <div class="text">Baños:</div>
                                                <p><?php echo e($property->bathrooms); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp">
                                                <div class="text">Tipo Inmueble:</div>
                                                <p><?php echo e($property->typeProperty->name); ?></p>
                                            </div>
                                            <div class="item wow fadeInUp" data-wow-delay="0.1s">
                                                <div class="text">Oferta:</div>
                                                <p><?php echo e($property->offer->name); ?></p>
                                            </div>                                          
                                        </div>
                                    </div>

                        <div class="features">
                                        <ul>
                                            <li>
                                                <h5 class="wow fadeInUp">Características Internas</h5>
                                                <div class="wrap-check-ellipse wow fadeInUp" data-wow-delay="0.1s">
                                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $property->internalCharacteristics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ichar): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="check-ellipse-item">
                                                        <div class="icon">
                                                            <i class="flaticon-check"></i>
                                                        </div>
                                                        <p><?php echo e($ichar->name); ?></p>
                                                    </div>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                                </div>
                                            </li>  
                                            <li>
                                                <h5 class="wow fadeInUp">Características Externas</h5>
                                                <div class="wrap-check-ellipse wow fadeInUp" data-wow-delay="0.1s">
                                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $property->externalCharacteristics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $echar): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <div class="check-ellipse-item">
                                                        <div class="icon">
                                                            <i class="flaticon-check"></i>
                                                        </div>
                                                        <p><?php echo e($echar->name); ?></p>
                                                    </div>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                                </div>
                                            </li>                                                                                    
                                        </ul>
                                    </div>            

                        <div class="desc">
                            <h4 class="wow fadeInUp">Descripción</h4>
                            <p class="wow fadeInUp" align="justify"><?php echo $property->description; ?></p>
                        </div>

                        <div class="video">
                            <h4 class="wow fadeInUp">Video</h4>
                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($property->video_url): ?>                          
                            
                            <div class="video-wrap">
                                <img src="images/image-box/video-2.jpg" alt="">
                                <a href="<?php echo e($property->video_url); ?>" class="popup-youtube">
                                    <div class="icon">
                                        <i class="flaticon-play"></i>
                                    </div>
                                </a>
                            </div>
                            <?php else: ?>
                                <div class="no-video-message">
                                    <i class="flaticon-video-off"></i>
                                    <p>No hay video disponible</p>
                                </div>
                            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                        </div>

                        <div class="map">
                            <h4 class="wow fadeInUp">Mapa</h4>
                            <div class="wrap-map-v1">
                                <div class="mapouter"><div class="gmap_canvas"><iframe class="gmap_iframe" width="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?width=600&amp;height=600&amp;hl=en&amp;q=<?php echo e($property->latitude); ?>,<?php echo e($property->longitude); ?>&amp;t=&amp;z=18&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe><a href="https://embed-googlemap.com">google maps embed</a></div><style>.mapouter{position:relative;text-align:right;width:100%;height:600px;}.gmap_canvas {overflow:hidden;background:none!important;width:100%;height:600px;}.gmap_iframe {height:600px!important;}</style></div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-xl-4">
                    <div class="property-single-sidebar po-sticky has-background">
                        <div class="sidebar-item sidebar-contact-info">
                            <div class="sidebar-title">Información de Contacto</div>
                            <div class="contact-info">
                                <div class="person">
                                    <div class="image">
                                        <img src="<?php echo e(Storage::url($property->agent->image)); ?>" alt="">
                                    </div>
                                    <div class="content">
                                        <div class="name">
                                            <a href="#"><?php echo e($property->agent->name); ?></a>
                                        </div>
                                        <p><?php echo e($property->agent->email); ?></p>
                                        <p><?php echo e($property->agent->phone); ?></p>
                                    </div>
                                </div>
                                <form class="form-comment" method="POST" action="<?php echo e(route('property.lead.store')); ?>">
                                    <?php echo csrf_field(); ?>

                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session('success')): ?>
                                        <div class="alert alert-success mb-4"><?php echo e(session('success')); ?></div>
                                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                                    <input type="hidden" name="property_id" value="<?php echo e($property->id); ?>">
                                    <input type="hidden" name="agent_id" value="<?php echo e($property->agent->id); ?>">

                                    <div class="cols">
                                        <fieldset class="name has-top-title">
                                            <input type="text" placeholder="Nombre" name="name" required>
                                            <label>Nombre</label>
                                        </fieldset>
                                        <fieldset class="phone has-top-title">
                                            <input type="number" placeholder="Teléfono" name="phone" required>
                                            <label>Teléfono</label>
                                        </fieldset>
                                    </div>
                                    <div class="cols">
                                        <fieldset class="email has-top-title">
                                            <input type="email" placeholder="Email" name="email" required>
                                            <label>Email</label>
                                        </fieldset>
                                    </div>
                                    <div class="cols">                                        
                                        <fieldset class="message">
                                            <input type="datetime-local" 
                                                name="visit_date" 
                                                min="<?php echo e(now()->addDay()->format('Y-m-d\TH:i')); ?>"
                                                required>
                                        </fieldset>                                      
                                    </div>
                                    <fieldset class="message has-top-title">
                                        <textarea name="message" rows="4" placeholder="Mensaje" required></textarea>
                                        <label>Mensaje</label>
                                    </fieldset>
                                    <div class="button-submit">
                                        <button class="tf-button-primary w-full" type="submit">
                                            Enviar Mensaje<i class="icon-arrow-right-add"></i>
                                        </button>
                                    </div>
                                    <div class="flex gap20">
                                        <a href="tel:<?php echo e($property->agent->phone); ?>" class="tf-button-primary w-full">
                                            Llamar<i class="flaticon-phone"></i>
                                        </a>
                                        <a href="https://wa.me/57<?php echo e($property->agent->phone); ?>?text=Hola, estoy interesado en la propiedad: <?php echo e(urlencode($property->code)); ?>" 
                                        class="tf-button-primary w-full">
                                            WhatsApp<i class="flaticon-whatsapp"></i>
                                        </a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>  

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app' , array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/confinca/resources/views/property-detail.blade.php ENDPATH**/ ?>