<?php
/**
 * Theme functions and definitions
 *
 * @package agriculture_farming
 */

// enque files
if ( ! function_exists( 'agriculture_farming_enqueue_styles' ) ) :
	/**
	 * Load assets.
	 *
	 * @since 1.0.0
	 */
	function agriculture_farming_enqueue_styles() {
		wp_enqueue_style( 'organic-farm-style-parent', get_template_directory_uri() . '/style.css' );
		wp_enqueue_style( 'agriculture-farming-style', get_stylesheet_directory_uri() . '/style.css', array( 'organic-farm-style-parent' ), '1.0.0' );
		// Theme Customize CSS.
		require get_parent_theme_file_path( 'inc/extra_customization.php' );
		wp_add_inline_style( 'agriculture-farming-style',$organic_farm_custom_style );
		require get_theme_file_path( 'inc/extra_customization.php' );
		wp_add_inline_style( 'agriculture-farming-style',$organic_farm_custom_style );

		// blocks css
        wp_enqueue_style( 'agriculture-farming-block-style', get_theme_file_uri( '/assets/css/blocks.css' ), array( 'agriculture-farming-style' ), '1.0' );
	}
endif;
add_action( 'wp_enqueue_scripts', 'agriculture_farming_enqueue_styles', 99 );

// theme setup
function agriculture_farming_setup() {
	load_theme_textdomain( 'agriculture-farming', get_template_directory() . '/languages' );
	add_theme_support( 'align-wide' );
	add_theme_support( 'automatic-feed-links' );
	add_theme_support( "responsive-embeds" );
	add_theme_support( "wp-block-styles" );
	add_theme_support( 'post-thumbnails' );
	add_theme_support( 'title-tag' );
	add_theme_support('custom-background',array(
		'default-color' => 'ffffff',
	));
	add_image_size( 'agriculture-farming-featured-image', 2000, 1200, true );
	add_image_size( 'agriculture-farming-thumbnail-avatar', 100, 100, true );

	$GLOBALS['content_width'] = 525;
	register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'agriculture-farming' ),
	) );

	add_theme_support( 'html5', array(
		'comment-form',
		'comment-list',
		'gallery',
		'caption',
	) );

	// Add theme support for Custom Logo.
	add_theme_support( 'custom-logo', array(
		'width'       => 250,
		'height'      => 250,
		'flex-width'  => true,
		'flex-height' => true,
	) );
	/*
	* This theme styles the visual editor to resemble the theme style,
	* specifically font, colors, and column width.
	*/
	add_editor_style( array( 'assets/css/editor-style.css', organic_farm_fonts_url() ) );

	if ( ! defined( 'ORGANIC_FARM_SUPPORT' ) ) {
	define('ORGANIC_FARM_SUPPORT',__('https://wordpress.org/support/theme/agriculture-farming','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_REVIEW' ) ) {
		define('ORGANIC_FARM_REVIEW',__('https://wordpress.org/support/theme/agriculture-farming/reviews/#new-post','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_LIVE_DEMO' ) ) {
	define('ORGANIC_FARM_LIVE_DEMO',__('https://trial.ovationthemes.com/agriculture-farming/','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_BUY_PRO' ) ) {
	define('ORGANIC_FARM_BUY_PRO',__('https://www.ovationthemes.com/products/farming-wordpress-theme','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_PRO_DOC' ) ) {
	define('ORGANIC_FARM_PRO_DOC',__('https://trial.ovationthemes.com/docs/ot-agriculture-farming-pro-doc/','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_FREE_DOC' ) ) {
	define('ORGANIC_FARM_FREE_DOC',__('https://trial.ovationthemes.com/docs/ot-agriculture-farming-free-doc/','agriculture-farming'));
	}
	if ( ! defined( 'ORGANIC_FARM_THEME_NAME' ) ) {
	define('ORGANIC_FARM_THEME_NAME',__('Premium Agriculture Theme','agriculture-farming'));
	}
}
add_action( 'after_setup_theme', 'agriculture_farming_setup' );

//widgets
function agriculture_farming_widgets_init() {
	register_sidebar( array(
		'name'          => __( 'Sidebar', 'agriculture-farming' ),
		'id'            => 'sidebar-1',
		'description'   => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget wow zoomIn %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<div class="widget_container"><h3 class="widget-title">',
		'after_title'   => '</h3></div>',
	) );

	register_sidebar( array(
		'name'          => __( 'Page Sidebar', 'agriculture-farming' ),
		'id'            => 'sidebar-2',
		'description'   => __( 'Add widgets here to appear in your pages and posts', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget wow zoomIn %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<div class="widget_container"><h3 class="widget-title">',
		'after_title'   => '</h3></div>',
	) );
	
	register_sidebar( array(
		'name'          => __( 'Sidebar 3', 'agriculture-farming' ),
		'id'            => 'sidebar-3',
		'description'   => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget wow zoomIn %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<div class="widget_container"><h3 class="widget-title">',
		'after_title'   => '</h3></div>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer 1', 'agriculture-farming' ),
		'id'            => 'footer-1',
		'description'   => __( 'Add widgets here to appear in your footer.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer 2', 'agriculture-farming' ),
		'id'            => 'footer-2',
		'description'   => __( 'Add widgets here to appear in your footer.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer 3', 'agriculture-farming' ),
		'id'            => 'footer-3',
		'description'   => __( 'Add widgets here to appear in your footer.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );

	register_sidebar( array(
		'name'          => __( 'Footer 4', 'agriculture-farming' ),
		'id'            => 'footer-4',
		'description'   => __( 'Add widgets here to appear in your footer.', 'agriculture-farming' ),
		'before_widget' => '<section id="%1$s" class="widget %2$s">',
		'after_widget'  => '</section>',
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
	) );
}
add_action( 'widgets_init', 'agriculture_farming_widgets_init' );

// remove sections
function agriculture_farming_customize_register() {
  	global $wp_customize;
	$wp_customize->remove_section( 'organic_farm_pro' );
	$wp_customize->remove_section( 'organic_farm_middle_section' );
	$wp_customize->remove_section( 'organic_farm_product_box_section' );

	$wp_customize->remove_setting( 'organic_farm_call_text' );
	$wp_customize->remove_control( 'organic_farm_call_text' );

	$wp_customize->remove_setting( 'organic_farm_email_text' );
	$wp_customize->remove_control( 'organic_farm_email_text' );

	$wp_customize->remove_setting( 'organic_farm_quote_btn' );
	$wp_customize->remove_control( 'organic_farm_quote_btn' );

	$wp_customize->remove_setting( 'organic_farm_quote_btn_link' );
	$wp_customize->remove_control( 'organic_farm_quote_btn_link' );

	$wp_customize->remove_setting( 'organic_farm_slider_content_alignment' );
	$wp_customize->remove_control( 'organic_farm_slider_content_alignment' );

	$wp_customize->remove_setting( 'organic_farm_slider_excerpt_show_hide' );
	$wp_customize->remove_control( 'organic_farm_slider_excerpt_show_hide' );

	$wp_customize->remove_setting( 'organic_farm_slider_opacity' );
	$wp_customize->remove_control( 'organic_farm_slider_opacity' );

	$wp_customize->remove_setting( 'organic_farm_footer_text' );
	$wp_customize->remove_control( 'organic_farm_footer_text' );

	$wp_customize->remove_setting( 'organic_farm_primary_color' );
	$wp_customize->remove_control( 'organic_farm_primary_color' );
	$wp_customize->remove_setting( 'organic_farm_top_bg_color' );
	$wp_customize->remove_control( 'organic_farm_top_bg_color' );
	$wp_customize->remove_setting( 'organic_farm_secondary_color' );
	$wp_customize->remove_control( 'organic_farm_secondary_color' );
	$wp_customize->remove_setting( 'organic_farm_heading_color' );
	$wp_customize->remove_control( 'organic_farm_heading_color' );
	$wp_customize->remove_setting( 'organic_farm_primary_fade' );
	$wp_customize->remove_control( 'organic_farm_primary_fade' );
	$wp_customize->remove_setting( 'organic_farm_footer_bg' );
	$wp_customize->remove_control( 'organic_farm_footer_bg' );
	$wp_customize->remove_setting( 'organic_farm_slider_overlay' );
	$wp_customize->remove_control( 'organic_farm_slider_overlay' );
	$wp_customize->remove_setting( 'organic_farm_slider_heading_color' );
	$wp_customize->remove_control( 'organic_farm_slider_heading_color' );
	$wp_customize->remove_setting( 'organic_farm_slider_excerpt_color' );
	$wp_customize->remove_control( 'organic_farm_slider_excerpt_color' );

}
add_action( 'customize_register', 'agriculture_farming_customize_register', 11 );


// customizer
function agriculture_farming_customize( $wp_customize ) {

	wp_enqueue_style('customizercustom_css', esc_url( get_stylesheet_directory_uri() ). '/assets/css/customizer.css');

	require get_theme_file_path( 'inc/custom-control.php' );

	// pro section
	$wp_customize->add_section('agriculture_farming_pro', array(
		'title'    => __('🔒 Unlock Premium Features', 'agriculture-farming'),
		'priority' => 1,
	));
	$wp_customize->add_setting('agriculture_farming_pro', array(
		'default'           => null,
		'sanitize_callback' => 'sanitize_text_field',
	));
	$wp_customize->add_control(new Agriculture_Farming_Pro_Control($wp_customize, 'agriculture_farming_pro', array(
		'label'    => __('AGRICULTURE PREMIUM', 'agriculture-farming'),
		'section'  => 'agriculture_farming_pro',
		'settings' => 'agriculture_farming_pro',
		'priority' => 1,
	)));

	// slider

	$wp_customize->add_setting('agriculture_farming_slider_heading_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_slider_heading_color', array(
	    'section' => 'organic_farm_slider_section',
	    'label' => esc_html__('Slider Title Color', 'agriculture-farming'),
	 	'priority'    => 2,
	)));

	$wp_customize->add_setting(
		'agriculture_farming_slider_excerpt_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'organic_farm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Agriculture_Farming_Customizer_Customcontrol_Switch(
			$wp_customize,
			'agriculture_farming_slider_excerpt_show_hide',
			array(
				'settings'        => 'agriculture_farming_slider_excerpt_show_hide',
				'section'         => 'organic_farm_slider_section',
				'label'           => __( 'Show Hide excerpt', 'agriculture-farming' ),				
				'choices'		  => array(
					'1'      => __( 'On', 'agriculture-farming' ),
					'off'    => __( 'Off', 'agriculture-farming' ),
				),
				'priority'    => 3,
			)
		)
	);

	$wp_customize->add_setting('agriculture_farming_slider_excerpt_color', array(
	    'default' => '#ffffff',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_slider_excerpt_color', array(
	    'section' => 'organic_farm_slider_section',
	    'label' => esc_html__('Slider Excerpt Color', 'organic-farm'),
	 	'priority'    => 4,
	)));

	$wp_customize->add_setting('agriculture_farming_slider_content_alignment',array(
        'default' => 'CENTER-ALIGN',
        'sanitize_callback' => 'organic_farm_sanitize_choices'
	));
	$wp_customize->add_control('agriculture_farming_slider_content_alignment',array(
		'type' => 'radio',
		'label'     => __('Slider Content Alignment', 'agriculture-farming'),
		'section' => 'organic_farm_slider_section',
		'type' => 'select',
		'choices' => array(
			'LEFT-ALIGN' => __('LEFT','agriculture-farming'),
            'CENTER-ALIGN' => __('CENTER','agriculture-farming'),
            'RIGHT-ALIGN' => __('RIGHT','agriculture-farming'),
		),
		'priority'    => 6,
	) );

	$wp_customize->add_setting('agriculture_farming_slider_overlay', array(
	    'default' => '#181a1e',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_slider_overlay', array(
	    'section' => 'organic_farm_slider_section',
	    'label' => esc_html__('Slider Overlay Color', 'agriculture-farming'),
	 	'priority'    => 7,
	)));

	$wp_customize->add_setting('agriculture_farming_slider_opacity',array(
        'default' => '0.3',
        'sanitize_callback' => 'organic_farm_sanitize_choices'
	));
	$wp_customize->add_control('agriculture_farming_slider_opacity',array(
		'type' => 'radio',
		'label'     => __('Slider Opacity', 'agriculture-farming'),
		'section' => 'organic_farm_slider_section',
		'type' => 'select',
		'choices' => array(
			'0' => __('0','agriculture-farming'),
			'0.1' => __('0.1','agriculture-farming'),
			'0.2' => __('0.2','agriculture-farming'),
			'0.3' => __('0.3','agriculture-farming'),
			'0.4' => __('0.4','agriculture-farming'),
			'0.5' => __('0.5','agriculture-farming'),
			'0.6' => __('0.6','agriculture-farming'),
			'0.7' => __('0.7','agriculture-farming'),
			'0.8' => __('0.8','agriculture-farming'),
			'0.9' => __('0.9','agriculture-farming'),
			'1' => __('1','agriculture-farming')
		),
		'priority'    => 7,
	) );

	//Category Section
	$wp_customize->add_section('agriculture_farming_category_section',array(
		'title'	=> __('Category Section','agriculture-farming'),
		'priority'=> 5,
		'panel' => 'organic_farm_custompage_panel',
	));
	$wp_customize->add_setting( 'agriculture_farming_section_category_heading', array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
	) );
	$wp_customize->add_control( new Agriculture_Farming_Customizer_Customcontrol_Section_Heading( $wp_customize, 'agriculture_farming_section_category_heading', array(
		'label'       => esc_html__( 'Category Section', 'agriculture-farming' ),
		'section'     => 'agriculture_farming_category_section',
		'settings'    => 'agriculture_farming_section_category_heading',
	) ) );
	$wp_customize->add_setting(
		'agriculture_farming_cate_show_hide',
		array(
			'type'                 => 'option',
			'capability'           => 'edit_theme_options',
			'theme_supports'       => '',
			'default'              => '1',
			'transport'            => 'refresh',
			'sanitize_callback'    => 'organic_farm_callback_sanitize_switch',
		)
	);
	$wp_customize->add_control(
		new Agriculture_Farming_Customizer_Customcontrol_Switch(
			$wp_customize,
			'agriculture_farming_cate_show_hide',
			array(
				'settings'        => 'agriculture_farming_cate_show_hide',
				'section'         => 'agriculture_farming_category_section',
				'label'           => __( 'Check To Show Section', 'agriculture-farming' ),
				'choices'		  => array(
					'1'      => __( 'On', 'agriculture-farming' ),
					'off'    => __( 'Off', 'agriculture-farming' ),
				),
				'active_callback' => '',
			)
		)
	);
    $wp_customize->add_setting('agriculture_farming_cate_title',array(
		'default' => '',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('agriculture_farming_cate_title',array(
		'label'	=> __('Section Title','agriculture-farming'),
		'section' => 'agriculture_farming_category_section',
		'type' => 'text',
	));

	$agriculture_farming_categories = get_categories();
	$agriculture_farming_cats = array();
	$agriculture_farming_i = 0;
	$agriculture_farming_cat_pst[]= 'select';
	foreach($agriculture_farming_categories as $category){
		if($agriculture_farming_i==0){
			$default = $category->slug;
			$agriculture_farming_i++;
		}
		$agriculture_farming_cat_pst[$category->slug] = $category->name;
	}

	$wp_customize->add_setting('agriculture_farming_category_setting',array(
		'default' => 'select',
		'sanitize_callback' => 'organic_farm_sanitize_choices',
	));
	$wp_customize->add_control('agriculture_farming_category_setting',array(
		'type' => 'select',
		'choices' => $agriculture_farming_cat_pst,
		'label' => __('Select Category to display Post','agriculture-farming'),
		'section' => 'agriculture_farming_category_section',
	));
	$wp_customize->selective_refresh->add_partial( 'agriculture_farming_category_setting', array(
		'selector' => '#home-mission h3',
		'render_callback' => 'agriculture_farming_customize_partial_agriculture_farming_category_setting',
	) );

	$wp_customize->add_setting('agriculture_farming_category_number',array(
		'default'	=> '',
		'sanitize_callback'	=> 'sanitize_text_field',
	));
	$wp_customize->add_control('agriculture_farming_category_number',array(
		'label'	=> __('Number of posts to show in a category','agriculture-farming'),
		'section' => 'agriculture_farming_category_section',
		'type'	  => 'number',
	));

	$wp_customize->add_setting('agriculture_farming_post_order_type',array(
        'default' => 'ascending',
        'sanitize_callback' => 'organic_farm_sanitize_choices'
	));
	$wp_customize->add_control('agriculture_farming_post_order_type',array(
        'type' => 'select',
        'label' => __('Post Order','agriculture-farming'),
        'section' => 'agriculture_farming_category_section',
        'choices' => array(
            'ascending' => __('Oldest to Newest','agriculture-farming'),
            'descending' => __('Newest to Oldest','agriculture-farming'),
            'a-to-z' => __('A&rarr;Z','agriculture-farming'),
            'z-to-a' => __('Z&rarr;A','agriculture-farming'),
        ),
	) );

	$wp_customize->add_setting('agriculture_farming_footer_text',array(
		'default'	=> 'Agriculture Farming WordPress Theme',
		'sanitize_callback'	=> 'sanitize_text_field'
	));
	$wp_customize->add_control('agriculture_farming_footer_text',array(
		'label'	=> esc_html__('Copyright Text','agriculture-farming'),
		'section'	=> 'organic_farm_footer_copyright',
		'type'		=> 'textarea'
	));
	$wp_customize->selective_refresh->add_partial( 'agriculture_farming_footer_text', array(
		'selector' => '.site-info a',
		'render_callback' => 'organic_farm_customize_partial_agriculture_farming_footer_text',
	) );


	//colors
	$wp_customize->add_setting('agriculture_farming_primary_color', array(
	    'default' => '#8ec63f',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_primary_color', array(
	    'section' => 'colors',
	    'label' => esc_html__('Theme Color', 'agriculture-farming'),
	 
	)));

	$wp_customize->add_setting('agriculture_farming_top_bg_color', array(
	    'default' => '#181a1e',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_top_bg_color', array(
	    'section' => 'colors',
	    'label' => esc_html__('Top Bg Color', 'agriculture-farming'),
	 
	)));

	$wp_customize->add_setting('agriculture_farming_heading_color', array(
	    'default' => '#181a1e',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_heading_color', array(
	    'section' => 'colors',
	    'label' => esc_html__('Theme Heading Color', 'agriculture-farming'),
	 
	)));

	$wp_customize->add_setting('agriculture_farming_primary_fade', array(
	    'default' => '#effbdd',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_primary_fade', array(
	    'section' => 'colors',
	    'label' => esc_html__('theme Color fade', 'agriculture-farming'),
	)));

	$wp_customize->add_setting('agriculture_farming_footer_bg', array(
	    'default' => '#131313',
	    'sanitize_callback' => 'sanitize_hex_color',
	    'transport' => 'refresh',
	));

	$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'agriculture_farming_footer_bg', array(
	    'section' => 'colors',
	    'label' => esc_html__('Footer Bg color', 'agriculture-farming'),
	)));
}
add_action( 'customize_register', 'agriculture_farming_customize' );

// comments
function agriculture_farming_enqueue_comments_reply() {
  if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) {
    // Load comment-reply.js (into footer)
    wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
  }
}
add_action(  'wp_enqueue_scripts', 'agriculture_farming_enqueue_comments_reply' );

// Footer Text
function agriculture_farming_copyright_link() {
    $agriculture_farming_footer_text = get_theme_mod('agriculture_farming_footer_text', esc_html__('Agriculture Farming WordPress Theme', 'agriculture-farming'));
    $agriculture_farming_credit_link = esc_url('https://www.ovationthemes.com/products/free-agriculture-wordpress-theme');

    echo '<a href="' . $agriculture_farming_credit_link . '" target="_blank">' . esc_html($agriculture_farming_footer_text) . '<span class="footer-copyright">' . esc_html__(' By Ovation Themes', 'agriculture-farming') . '</span></a>';
}

/* Pro control */
if (class_exists('WP_Customize_Control') && !class_exists('Agriculture_Farming_Pro_Control')):
    class Agriculture_Farming_Pro_Control extends WP_Customize_Control{

    public function render_content(){?>
        <div style="background: linear-gradient(135deg, #2B136B 0%, #A47AE2 100%); padding: 20px; border-radius: 8px; text-align: center; color: #fff;">
			
			<h3 style="margin-top: 0; color: #fff;">
				<?php esc_html_e('Unlock Advanced Features', 'organic-farm'); ?>
			</h3>
	
			<p style="margin: 15px 0;">
				<?php esc_html_e('Upgrade to Pro to get:', 'organic-farm'); ?>
			</p>
	
			<ul style="list-style: none; padding: 0; text-align: left; max-width: 300px; margin: 20px auto;">
				<li>✓ <?php esc_html_e('12+ Premium Header Layouts', 'organic-farm'); ?></li>
				<li>✓ <?php esc_html_e('Advanced Footer Builder', 'organic-farm'); ?></li>
				<li>✓ <?php esc_html_e('Typography Controls', 'organic-farm'); ?></li>
				<li>✓ <?php esc_html_e('WooCommerce Styling Options', 'organic-farm'); ?></li>
				<li>✓ <?php esc_html_e('Priority Support', 'organic-farm'); ?></li>
				<li>✓ <?php esc_html_e('One-Click Demo Import', 'organic-farm'); ?></li>
			</ul>
	
			<a href="<?php echo esc_url(admin_url('themes.php?page=organic-farm-pro')); ?>"
				style="display:inline-block;background:#fff;color:#667eea;padding:12px 30px;text-decoration:none;border-radius:4px;font-weight:600;margin:10px 5px;">
				<?php esc_html_e('View All Features', 'organic-farm'); ?>
			</a>
	
			<a href="<?php echo esc_url( ORGANIC_FARM_BUY_PRO ); ?>" target="_blank"
				style="display:inline-block;background:#ffc107;color:#333;padding:12px 30px;text-decoration:none;border-radius:4px;font-weight:600;margin:10px 5px;">
				<?php esc_html_e('Upgrade Now 🚀', 'organic-farm'); ?>
			</a>

			<a href="<?php echo esc_url( ORGANIC_FARM_BUNDLE_LINK ); ?>" target="_blank"
				style="display: inline-block; background: #28a745; color: #fff; padding: 12px 30px; text-decoration: none; border-radius: 4px; font-weight: 600; margin: 10px 5px;">
				<?php esc_html_e('WordPress Bundle 🎁', 'organic-farm'); ?>
			</a>
	
		</div>
    <?php } }
endif;

add_action( 'admin_bar_menu', 'agriculture_farming_add_upgrade_button', 100 );

function agriculture_farming_add_upgrade_button( $agriculture_farming_wp_admin_bar ) {

    $agriculture_farming_theme_name = wp_get_theme()->get( 'Name' );

    $agriculture_farming_args = array(
        'id'    => 'agriculture_farming_upgrade',
        'title' => '<span style="color:#fff;font-weight:600;">
            🚀 Upgrade to ' . esc_html( $agriculture_farming_theme_name ) . ' Pro - 20% OFF 
            <span style="background:#ff5722;color:#fff;padding:2px 8px;border-radius:3px;margin-left:6px;">
                Buy Now
            </span>
        </span>',
        'href'  => esc_url( ORGANIC_FARM_BUY_PRO ),
        'meta'  => array(
            'class'  => 'agriculture-farming-upgrade-btn',
            'title'  => 'Upgrade to Pro',
            'target' => '_blank'
        )
    );

    $agriculture_farming_wp_admin_bar->add_node( $agriculture_farming_args );
}