<div class="lp-container">    
    <div class="wrap-landing-hero grid-50">        

        <div class="wrap-slider">
            <?php if( is_admin() ): ?>
                <img style="width: 100%" src="<?php echo get_stylesheet_directory_uri() . '/assets/images/placeholder-img.jpg' ?>">
            <?php else: ?>

                <?php $images = get_field( 'gallery' );
                if( $images ): ?>
                    <div class="slider slider-for">
                        <?php 
                        foreach( $images as $image ): ?>
                            <div class="item">
                                <?php if( $image['type'] == 'video' ): ?>
                                    <video src="<?php echo esc_url( $image['url'] ); ?>" controls></video>
                                <?php elseif( $image['description'] ): ?>
                                    <?php echo wp_oembed_get( $image['description'], array( 'height' => 500 ) ); ?>
                                <?php else: ?>
                                    <img src="<?php echo esc_url( $image['url'] ); ?>" alt="<?php echo esc_attr( $image['alt'] ); ?>" />
                                <?php endif; ?>
                            </div>
                        <?php 
                        endforeach; ?>
                    </div>

                    <div class="slider slider-nav">
                        <?php foreach( $images as $image ): ?>                              
                            <div class="item <?php if( $image['description'] ) echo 'is-video'; ?>">
                                <?php if( $image['type'] == 'video' ): ?>
                                    <video src="<?php echo esc_url( $image['url'] ); ?>"></video>
                                <?php else: ?>  
                                    <img src="<?php echo esc_url( $image['sizes']['thumbnail'] ); ?>" alt="<?php echo esc_attr( $image['alt'] ); ?>" />
                                <?php endif; ?>
                            </div>                                    
                        <?php endforeach; ?>
                    </div>
                <?php endif; ?>     

            <?php endif; ?>       
        </div>

        <div class="wrap-info">
            <h1 class="title"><?php the_field( 'title' ) ?></h1>
            <?php product_price( get_field( 'price' ), get_field( 'sale_price' ), 'single' ) ?>
            <div class="shipping"><strong><?php _e( 'Vận Chuyển:', 'tbang_text' ) ?></strong> <?php the_field( 'shiping' ) ?></div>
            
            <div class="short-des">
                <h4><?php _e( 'Đặc điểm sản phẩm:', 'tbang_text' ) ?></h4>
                <div class="text"><?php the_field( 'short_description' ) ?></div>
            </div>

            <a href="#" data-bs-toggle="modal" data-bs-target="#staticBackdrop" class="btn-buy"><?php _e( 'Mua ngay', 'tbang_text' ) ?></a>
        </div>
    </div>
</div>

<div id="mobile-float" class="fixed-bottom">
    <div class="left">
        <div class="price-del">
            <del><?php echo format_money( get_field( 'price' ) ) ?></del>
            <ins><?php echo format_money( get_field( 'sale_price' ) ) ?></ins>
        </div>
    </div>

    <div class="right">
        <div class="img">
            <img src="<?php echo get_stylesheet_directory_uri() . '/assets/images/freeship-icon.svg' ?>" />
        </div>

        <div class="wrap-button">
            <a data-bs-toggle="modal" data-bs-target="#staticBackdrop" href="#">NHẬN ƯU ĐÃI NGAY</a>
        </div>
    </div>
</div>