    <style>
        .hov:hover {
            background-color: #F6F6F6;
        }

        div.wrapper div.main-product div.item-product {
            position: relative;
        }

        div.wrapper div.main-product div.item-product div.card-body p.newPrice {
            font-size: 16px;
        }

        div.wrapper div.main-product div.item-product div.stars-rating {
            position: relative;
            right: 15px;
        }

        div.wrapper div.main-product div.item-product div.stars-rating i {
            color: orange;
            font-size: 14px;
        }
    </style>
    <?php include __DIR__ . '/../templates/star.php' ?>
    <div class="wrapper">
        <div class="title-head">
            <h2 class="title"><?= strtoupper($category); ?></h2>
            <div class="dropdown">
                <button class="btn btn-sm dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    Urutkan
                </button>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" href="<?= base_url(); ?>c/<?= $slug ?>?sort=bestseller">Paling Laris</a>
                    <a class="dropdown-item" href="<?= base_url(); ?>c/<?= $slug ?>?sort=latest">Terbaru</a>
                    <a class="dropdown-item" href="<?= base_url(); ?>c/<?= $slug ?>?sort=cheapest">Termurah</a>
                    <a class="dropdown-item" href="<?= base_url(); ?>c/<?= $slug ?>?sort=expensive">Termahal</a>
                </div>
            </div>
        </div>
        <div class="core">
            <?php $setting = $this->db->get('settings')->row_array(); ?>
            <div class="main-product">
                <?php if ($products->num_rows() > 0) { ?>
                    <div id="bodyForShowProductCategory">
                        <?php foreach ($products->result_array() as $p) : ?>
                            <a href="<?= base_url(); ?>p/<?= $p['slug']; ?>">
                                <div class="item-product hov">
                                    <img src="<?= $p['ex_img'] == 1 ? $p['img'] : base_url() . 'assets/images/product/' . $p['img']; ?>" class="card-img-top">
                                    <div class="card-body">
                                        <?php if ($p['discount'] == 0) { ?>
                                            <p class="card-text line-3 mb-0"><?= $p['title']; ?></p>
                                            <div class="d-flex justify-content-between">
                                                <p class="newPrice">Rp. <?= str_replace(",", ".", number_format($p['price'])); ?></p>
                                                <div class="stars-rating">
                                                    <?php $starsRating = $this->Products_model->rowRatingByProduct($p['id']); ?>
                                                    <?php if ($starsRating == 0) { ?>
                                                        <i class="far fa-star"></i> <small class="text-muted"><?= round($starsRating, 1) ?></small>
                                                    <?php } else { ?>
                                                        <i class="fa fa-star"></i> <small class="text-muted"><?= round($starsRating, 1) ?></small>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                        <?php } else { ?>
                                            <p class="card-text mb-0"><?= $p['title']; ?></p>
                                            <p class="oldPrice mb-0">Rp. <span><?= str_replace(",", ".", number_format($p['price'])); ?></span> <small class="badge badge-danger"><?= $p['discount']; ?>%</small></p>
                                            <?php $diskonnya = ($p['price'] * $p['discount']) / 100 ?>
                                            <div class="d-flex justify-content-between">
                                                <p class="newPrice">Rp. <?= str_replace(",", ".", number_format($p['price'] - $diskonnya)); ?></p>
                                                <div class="stars-rating">
                                                    <?php $starsRating = $this->Products_model->rowRatingByProduct($p['id']); ?>
                                                    <?php if ($starsRating == 0) { ?>
                                                        <i class="far fa-star"></i> <small class="text-muted"><?= round($starsRating, 1) ?></small>
                                                    <?php } else { ?>
                                                        <i class="fa fa-star"></i> <small class="text-muted"><?= round($starsRating, 1) ?></small>
                                                    <?php } ?>
                                                </div>
                                            </div>
                                        <?php } ?>
                                    </div>
                                </div>
                            </a>
                        <?php endforeach; ?>
                    </div>
                    <div class="clearfix"></div>
                <?php } else { ?>
                    <div class="alert alert-warning">Upss. Tidak ada produk yang dapat ditampilkan</div>
                <?php } ?>
            </div>
            <?php if ($this->db->get_where('products', ['category' => $idCat])->num_rows() > 12) { ?>
                <img src="<?= base_url(); ?>assets/images/icon/loading-v1.gif" alt="loading.." class="loading-animation-load-more">
                <?php $btncolor = $this->Settings_model->general()['btncolor']; ?>
                <button style="border: 1px solid <?= $btncolor; ?>; color: <?= $btncolor; ?>" class="more" id="btnClickLoadMoreProductCategory">MUAT LEBIH BANYAK</button>
            <?php } ?>
        </div>
    </div>