<?php
/**
 * Template View: Bundle Actions
 *
 * CTA buttons for bundle operations.
 * Requires Pro + Bundles license.
 *
 * @package    BoostBot
 * @subpackage Templates/Views
 * @since      1.6.0
 *
 * @var int    $bundle_id    Bundle ID.
 * @var string $add_to_cart  Add to cart URL.
 * @var string $view_bundle  View bundle URL.
 * @var string $customize    Customize bundle URL.
 */

// phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-scope variables set by the includer, not true globals.

// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

// Need at least one action
if ( empty( $add_to_cart ) && empty( $view_bundle ) && empty( $customize ) ) {
    return;
}

// Direction
$is_rtl = is_rtl();
$dir = $is_rtl ? 'rtl' : 'ltr';
?>

<div class="bb-bundle-actions" dir="<?php echo esc_attr( $dir ); ?>">
    <?php if ( ! empty( $add_to_cart ) ) : ?>
        <a href="<?php echo esc_url( $add_to_cart ); ?>" class="bb-bundle-btn bb-btn-primary">
            <span class="bb-btn-icon">🛒</span>
            <span class="bb-btn-text"><?php esc_html_e( 'Add to Cart', 'boostbot' ); ?></span>
        </a>
    <?php endif; ?>
    
    <?php if ( ! empty( $view_bundle ) ) : ?>
        <a href="<?php echo esc_url( $view_bundle ); ?>" class="bb-bundle-btn bb-btn-secondary">
            <span class="bb-btn-icon">👁️</span>
            <span class="bb-btn-text"><?php esc_html_e( 'View Bundle', 'boostbot' ); ?></span>
        </a>
    <?php endif; ?>
    
    <?php if ( ! empty( $customize ) ) : ?>
        <a href="<?php echo esc_url( $customize ); ?>" class="bb-bundle-btn bb-btn-outline">
            <span class="bb-btn-icon">✏️</span>
            <span class="bb-btn-text"><?php esc_html_e( 'Customize', 'boostbot' ); ?></span>
        </a>
    <?php endif; ?>
</div>
