<?php
    /**
     * Base class for sticky header sections
     * 
     * @package Blog Bee
     * @since 1.0.0
     */
    namespace BBE\Customizer\Section;

    use BBE\Helpers as Helpers;
    use BBE\Customizer\Section\Section as Section;
    use BBE\Customizer\Theme_Defaults as Theme_Defaults;

    if( ! trait_exists( __NAMESPACE__ . '\\Sticky_Header_Trait' ) ) {
        /**
         * Sticky_Header_Trait Class
         */
        trait Sticky_Header_Trait {
            /**
             * Is section active
             * 
             * @param string $widget_id Widget ID
             * @since 1.0.0
             */
            public function is_active( $widget_id ): bool {
                $is_widget_used = Helpers::is_widget_in_builder( 'sticky_header_builder', $widget_id );
                return ( Theme_Defaults::get_theme_option( 'header_builder_enable_sticky' ) && $is_widget_used );
            }
        }
    }