@extends('layouts.app')

@section('content')
    <div class="container mt-5 ">
         @foreach ($data as $node)
        <div class="card card-rounded-shadow p-1 p-sm-1">
            <div class="container-fliud">
                <div class="wrapper row">
                    <div class="preview col-md-4">

                     <div class="preview-pic">                  <img src="{!! $node['items'][0]['image'] !!}" class="img img-fluid img-responsive" />

                        </div>

                    </div>
                    <div class="details col-md-8">
                        <h3 class="product-title">{!! $node['items'][0]['title'] !!}</h3>
                        <div class="rating">
                           <div class="d-flex align-items-center gap-2 mb-2">
      <div class="d-flex gap-1 fs-xs">
        <i class="fa fa-star-filled text-warning"></i>
        <i class="fa fa-star-filled text-warning"></i>
        <i class="ci-star-filled text-warning"></i>
        <i class="ci-star-half text-warning"></i>
        <i class="ci-star text-body-tertiary opacity-75"></i>
      </div>
        <span><i class="fa fa-barcode"></i>{!! $node['sku'] !!}</span>
    </div>
                            <span class="review-no">41 reviews</span>
                        </div>

                        <p class="product-description">Suspendisse quos? Tempus cras iure temporibus? Eu laudantium cubilia sem sem! Repudiandae et! Massa senectus enim minim sociosqu delectus posuere.</p>
                        <div class="product-card-details ">
    <span class="position-relative top-0 start-0  bg-body mt-n2 py-2"></span>


     <!-- Table with striped rows -->
<div class="col-md-12 col-lg-12 col-sm-12">
  <table class="table table-responsive  table-prices">
    <thead>
      <tr>
        <th scope="col">Farmacia</th>
        <th align="right" scope="col" class="text-end">Precio</th>
        <th align="right" scope="col">Enlace</th>

      </tr>
    </thead>
    <tbody>
         @foreach ($node['items'] as $item)
      <tr  >
        <td class="text-start ">{!! $item['business']!!}  @if ($loop->first)<p class="badge bg-danger"> <i class="fa fa-info"></i> Mejor Precio</p>@endif </td>
        <td class="text-end w-100">Gs {!! number_format($item['price_now'], 0, ' ', '.') !!}</td>
        <td align="right"><a target="_blank" class="btn btn-xs btn-success" href="{!! $item['link'] !!}">Ver</a></td>

      </tr>
     @endforeach
    </tbody>
  </table>
</div>


  </div>
                    </div>
                </div>
            </div>
        </div>
        @endforeach
    </div>
@endsection
