<?php 
    /**
     * Search form
     * 
     * @since 1.0.0
     * @package Blog Postx Pro
     */
    use BBE\Customizer\Theme_Defaults as Theme_Defaults;
    use BBE\Helpers as Helpers;

    $search_icon = [
        'type'  =>  'icon',
        'value'  =>  'fa-solid fa-magnifying-glass',
        'class'  =>  'search-icon',
        'aria_label'    =>  esc_html__( 'Search', 'blog-bee' )
    ];
    if( isset( $args[ 'icon' ] ) ) {
        $icon = $args[ 'icon' ];
        $search_icon[ 'type' ] = $icon[ 'type' ];
        $search_icon[ 'value' ] = $icon[ 'value' ];
    }

    $close_icon = [
        'type'  =>  'icon',
        'value'  =>  'fa-solid fa-xmark',
        'class'  =>  'close-icon',
        'aria_label'    =>  esc_html__( 'Close Search Popup', 'blog-bee' )
    ];
    $placeholder = isset( $args[ 'placeholder' ] ) ? $args[ 'placeholder' ] : __( 'Search...', 'blog-bee' );

    ?>
        <form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">

            <label>

                <span class="screen-reader-text">

                    <?php

                        /* translators: Hidden accessibility text. */
                        _x( 'Search for:', 'label', 'blog-bee' );

                    ?>

                </span>

                <input type="search" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo get_search_query()?>" name="s" />

            </label>

            <?php echo Helpers::get_icon_html( $search_icon ); ?>

            <?php echo Helpers::get_icon_html( $close_icon ); ?>
            
        </form>