<?php
/**
 * CustomerBirthdayGhostTrigger — Pro-only teaser shown in play editor.
 *
 * @package CartCue
 */

namespace CartCue\Triggers;

defined( 'ABSPATH' ) || exit;

final class CustomerBirthdayGhostTrigger extends GhostTrigger {

	public function get_slug(): string {
		return 'customer_birthday';
	}

	public function get_label(): string {
		return __( "Customer's Birthday", 'cartcue-sales-automation' );
	}

	public function get_sentence(): string {
		return __( "it's a customer's birthday", 'cartcue-sales-automation' );
	}

	public function get_description(): string {
		return __( 'Fires on a customer\'s birthday. Collect birthdays via a profile field and send a personal coupon automatically.', 'cartcue-sales-automation' );
	}

	protected function get_pro_description(): string {
		return __( 'Birthday emails have a 40%+ open rate. Send a personalised discount automatically — customers genuinely appreciate the gesture, and it drives repeat purchases.', 'cartcue-sales-automation' );
	}

	public function get_upgrade_html(): string {
		return sprintf(
			'<div class="ap-pro-gate ap-pro-gate--birthday">'
			. '<div class="ap-pro-gate__icon ap-pro-gate__icon--birthday" aria-hidden="true">🎂</div>'
			. '<div class="ap-pro-gate__stat">%s</div>'
			. '<div class="ap-pro-gate__title">%s</div>'
			. '<p class="ap-pro-gate__desc">%s</p>'
			. '<a href="%s" target="_blank" rel="noopener noreferrer" class="ap-btn ap-btn-primary">%s →</a>'
			. '</div>',
			esc_html__( '40%+ average open rate', 'cartcue-sales-automation' ),
			esc_html(
				sprintf(
					/* translators: %s: trigger label */
					__( 'Pro Feature: %s', 'cartcue-sales-automation' ),
					$this->get_label()
				)
			),
			esc_html( $this->get_pro_description() ),
			esc_url( \CartCue\Plugin::upgrade_url( 'ghost_trigger_' . $this->get_slug() ) ),
			esc_html__( 'Upgrade to CartCue Pro', 'cartcue-sales-automation' )
		);
	}
}
