<div class="tab-content">
    <div class="single_product">
        <div class="product_thumb">
            <a>
                <?php if (file_exists($nombre_archivo)) {
                    $nu = rand(1, 1000);
                    $nu; ?>
                    <img class="categorias" src="<?php echo $emp_url_sub; ?>/img/articulos/<?php echo $load1['art_id_art'] . '.jpg?' . $nu . ''; ?>" alt="" style="height:270px;">
                <?php
                } else {
                    $nu = rand(1, 1000);
                    $nu; ?>
                    <img src="<?php echo $emp_url_sub . '/img/articulos/sin_imagen.jpg?' . $nu . ''; ?>" alt="#" style="height:270px;">

                <?php
                } ?>
            </a>
            <div class="quick_button">
                <a data-id="<?php echo $load1['art_id_art']; ?>" data-bs-toggle="modal" data-bs-target="#modal_box" class="btn_detalle" title="Ver Detalles"><i class="zmdi zmdi-eye"></i></a>
            </div>
        </div>
        <div class="product_content grid_content">
            <div class="product_name">
                <h3><a href="articulos_detalles.php?art_id=<?php echo $load1['art_id_art']; ?>">
                        <?php echo substr($load1['art_nombre_online'], 0, 55); ?></a></h3>
            </div>
            <div class="price_box">
            <?php include("funcion_precio.php")?>
            
            </div>
            <?php if (isset($_SESSION['clie_id'])) {
                $sqll = mysqli_query($con, "SELECT * FROM cotizacion_detalle_deseo WHERE cotd_art_id='" . $load1['art_id_art'] . "' and clie_id='" . $_SESSION["clie_id"] . "'") or die(mysqli_error($con));
                if ($load2 = mysqli_fetch_array($sqll)) { ?>
                    <div id="div1<?php echo $load1['art_id_art']; ?>" style="display: ">
                        <div class="action_links">
                            <ul>
                                <li class="wishlist" onclick="eliminar_deseo(<?php echo $load1['art_id_art']; ?>);
                                       cambiar1(<?php echo $load1['art_id_art']; ?>);">
                                    <a class="active" title="Eliminar de deseos">
                                        <i class="fa fa-heart-o" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <?php if ($load1['art_atributo_estado'] == 'si') { ?>
                                    <li class="add_to_cart"><a data-id="<?php echo $load1['art_id_art']; ?>" class="btn_agregar">
                                            <i class="zmdi zmdi-shopping-cart-plus"></i> Agregar al Carrito</a>
                                    </li> <?php
                                        } else if ($load1['art_atributo_estado'] == 'no') { ?>
                                    <li class="add_to_cart" onclick="envia_carrito1($('#art_id<?php echo $load1['art_id_art']; ?>').val(),
                                            $('#cantidad<?php echo $load1['art_id_art']; ?>').val());">
                                        <a>
                                            <i class="zmdi zmdi-shopping-cart-plus"></i> Agregar al Carrito
                                        </a>
                                    </li><?php
                                        } ?>
                                <input name="art_id" type="hidden" id="art_id<?php echo $load1["art_id_art"]; ?>"
                                    value="<?php echo $load1["art_id_art"]; ?>" />
                                <input name="cantidad" type="hidden" id="cantidad<?php echo $load1["art_id_art"]; ?>" value="1" class="pl-2" />
                            </ul>
                        </div>
                    </div>

                    <div id="div2<?php echo $load1['art_id_art']; ?>" style="display:none; ">
                        <div class="action_links">
                            <ul>
                                <li class="wishlist" onclick="envia_deseos(<?php echo $load1['art_id_art']; ?>);
                                        cambiar2(<?php echo $load1['art_id_art']; ?>);">
                                    <a class="" title="Eliminar de deseos">
                                        <i class="fa fa-heart-o" aria-hidden="true"></i>
                                    </a>
                                </li>
                                <?php
                                if ($load1['art_atributo_estado'] == 'si') { ?>
                                    <li class="add_to_cart"><a data-id="<?php echo $load1['art_id_art']; ?>" class="btn_agregar">
                                            <i class="zmdi zmdi-shopping-cart-plus"></i> Agregar al Carrito</a>
                                    </li><?php
                                        } else if ($load1['art_atributo_estado'] == 'no') { ?>
                                    <li class="add_to_cart" onclick="envia_carrito1($('#art_id<?php echo $load1['art_id_art']; ?>').val(),
                                           $('#cantidad<?php echo $load1['art_id_art']; ?>').val());">
                                        <a>
                                            <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                        </a>
                                    </li><?php
                                        } ?>
                                <input name="art_id" type="hidden" id="art_id<?php echo $load1["art_id_art"]; ?>"
                                    value="<?php echo $load1["art_id_art"]; ?>" />
                                <input name="cantidad" type="hidden" id="cantidad<?php echo $load1["art_id_art"]; ?>" value="1" class="pl-2" />
                            </ul>
                        </div>
                    </div> <?php
                        } else {  ?>
                    <div id="div1<?php echo $load1['art_id_art']; ?>" style="display:none ">
                        <div class="action_links">
                            <ul>
                                <li class="wishlist" onclick="eliminar_deseo(<?php echo $load1['art_id_art']; ?>);cambiar1(<?php echo $load1['art_id_art']; ?>);">
                                    <a class="active" title="Eliminar de deseos">
                                        <i class="fa fa-heart-o" aria-hidden="true"></i>
                                    </a>
                                </li>

                                <?php if ($load1['art_atributo_estado'] == 'si') { ?>

                                    <li class="add_to_cart">
                                        <a data-id="<?php echo $load1['art_id_art']; ?>" class="btn_agregar">
                                            <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                        </a>
                                    </li>

                                <?php  } else if ($load1['art_atributo_estado'] == 'no') { ?>

                                    <li class="add_to_cart" onclick="envia_carrito1($('#art_id<?php echo $load1['art_id_art']; ?>').val(),$('#cantidad<?php echo $load1['art_id_art']; ?>').val());">
                                        <a>
                                            <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                        </a>
                                    </li>
                                <?php   } ?>

                                <input name="art_id" type="hidden" id="art_id<?php echo $load1["art_id_art"]; ?>" value="<?php echo $load1["art_id_art"]; ?>" />
                                <input name="cantidad" type="hidden" id="cantidad<?php echo $load1["art_id_art"]; ?>" value="1" class="pl-2" />
                            </ul>
                        </div>
                    </div>

                    <!------ carrito inicial ----->
                    <div id="div2<?php echo $load1['art_id_art']; ?>" style="display: ">
                        <div class="action_links">
                            <ul>
                                <li class="wishlist" onclick="envia_deseos(<?php echo $load1['art_id_art']; ?>);cambiar2(<?php echo $load1['art_id_art']; ?>);">
                                    <a class="" title="Eliminar de deseos">
                                        <i class="fa fa-heart-o" aria-hidden="true"></i>
                                    </a>
                                </li>

                                <?php if ($load1['art_atributo_estado'] == 'si') { ?>
                                    <li class="add_to_cart">
                                        <a data-id="<?php echo $load1['art_id_art']; ?>" class="btn_agregar">
                                            <i class="zmdi zmdi-shopping-cart-plus">Agregar al Carrito</i>
                                        </a>
                                        </i>
                                    <?php  } else if ($load1['art_atributo_estado'] == 'no') { ?>
                                    <li class="add_to_cart" onclick="envia_carrito1($('#art_id<?php echo $load1['art_id_art']; ?>').val(),$('#cantidad<?php echo $load1['art_id_art']; ?>').val());">
                                        <a>
                                            <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                        </a>
                                    </li>
                                <?php } ?>

                                <input name="art_id" type="hidden" id="art_id<?php echo $load1["art_id_art"]; ?>" value="<?php echo $load1["art_id_art"]; ?>" />
                                <input name="cantidad" type="hidden" id="cantidad<?php echo $load1["art_id_art"]; ?>" value="1" class="pl-2" />
                            </ul>
                        </div>
                    </div>
                <?php   }
                    } else {
                        $voy = 'voy'; ?>
                <div class="action_links">
                    <ul>
                        <li class="wishlist">
                            <a data-id="" data-bs-toggle="modal" data-bs-target="#modal_box_sesion">
                                <i class="fa fa-heart-o" aria-hidden="true"></i>
                            </a>
                        </li>

                        <?php if ($load1['art_atributo_estado'] == 'si') { ?>
                            <li class="add_to_cart">
                                <a data-id="<?php echo $load1['art_id_art']; ?>" class="btn_agregar">
                                    <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                </a>
                            </li>

                        <?php  } else if ($load1['art_atributo_estado'] == 'no') { ?>

                            <li class="add_to_cart" onclick="envia_carrito1($('#art_id<?php echo $load1['art_id_art']; ?>').val(),$('#cantidad<?php echo $load1['art_id_art']; ?>').val());">
                                <a>
                                    <i class="zmdi zmdi-shopping-cart-plus"> Agregar al Carrito</i>
                                </a>
                            </li>
                        <?php } ?>

                        <input name="art_id" type="hidden" id="art_id<?php echo $load1["art_id_art"]; ?>" value="<?php echo $load1["art_id_art"]; ?>" />
                        <input name="cantidad" type="hidden" id="cantidad<?php echo $load1["art_id_art"]; ?>" value="1" class="pl-2" />
                    </ul>
                </div>
            <?php
                    } ?>
            <script>
                function cambiar1(art_id) {
                    $('#div1' + art_id).hide();
                    $('#div2' + art_id).show();
                }

                function cambiar2(art_id) {
                    $('#div1' + art_id).show();
                    $('#div2' + art_id).hide();
                }
            </script>
        </div>


    </div>
</div>