<?php
/**
 * Tech Repair Service Widgets
 *
 * @package Tech_Repair_Service
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Tech_Repair_Widgets Class
 */
class Tech_Repair_Widgets {

    /**
     * Constructor
     */
    public function __construct() {
        // Register widgets
        add_action( 'widgets_init', array( $this, 'register_widgets' ) );
        
        // Enqueue widget styles
        add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
    }

    /**
     * Register widgets
     */
    public function register_widgets() {
        // Include widget classes
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'widgets/class-tech-repair-related-products-widget.php';
        
        // Register widgets
        register_widget( 'Tech_Repair_Related_Products_Widget' );
    }

    /**
     * Enqueue widget styles
     */
    public function enqueue_styles() {
        // Enqueue widget styles
        wp_enqueue_style(
            'tech-repair-widgets',
            plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'assets/css/tech-repair-widgets.css',
            array(),
            TECH_REPAIR_VERSION
        );
    }
}
