<?php
/**
 * Category description step 5 target audience template.
 *
 * @package SAAI
 */

if ( ! defined( 'ABSPATH' ) ) {
    die( 'You are not allowed to call this page directly.' );
}

$target_audience_options = require_once SAAI_PLUGIN_DIR_PATH . 'data/options-target-audience.php';
?>

<div class="saai-category-description-form-step saai-category-description-form-step-5 <?php echo ! empty( $target_audiences ) ? 'valid' : ''; ?>" data-step="5">
    <h3><?php esc_html_e( 'Target Audience', 'storeagent-ai-for-woocommerce' ); ?></h3>
    <div class="saai-category-description-form-step-content">
        <p class="saai-category-description-form-step-description"><?php esc_html_e( 'Who is the target audience for this category?', 'storeagent-ai-for-woocommerce' ); ?></p>
        <div class="saai-category-description-form-field saai-category-description-form-checkbox-group">
            <?php foreach ( $target_audience_options as $target_audience_value => $label ) : ?>
            <label class="saai-category-description-form-field-checkbox-label">
                <input type="checkbox" name="target_audiences[]" value="<?php echo esc_attr( $target_audience_value ); ?>" <?php checked( in_array( $target_audience_value, $target_audiences, true ) ); ?> />
                <span><?php echo esc_html( $label ); ?></span>
            </label>
            <?php endforeach; ?>
        </div>

        <div class="saai-category-description-step-actions-field">
            <button type="button" class="button previous-step-button">
                <?php esc_html_e( 'Back', 'storeagent-ai-for-woocommerce' ); ?>
            </button>
            <button type="button" class="button-primary next-step-button">
                <?php esc_html_e( 'Next', 'storeagent-ai-for-woocommerce' ); ?>
            </button>
        </div>
    </div>
</div>
