<?php
defined( 'ABSPATH' ) || exit;

/**
 * Email footer partial.
 *
 * Expected variables:
 * - Optional: $manage_booking_url
 */

// Fetch site name & year
$bookaro_year = gmdate( 'Y' );
$bookaro_site = get_bloginfo( 'name' );
$bookaro_manage_url = isset( $manage_booking_url ) && is_string( $manage_booking_url ) ? trim( $manage_booking_url ) : '';
?>
</div><!-- .email-body -->
<div style="background:#f8fafc; padding:18px 20px; text-align:center; font-size:13px; color:#64748b; border-top:1px solid #e2e8f0;">
    <?php if ( $bookaro_manage_url !== '' ) : ?>
        <p style="margin-bottom:10px;">
            <a href="<?php echo esc_url( $bookaro_manage_url ); ?>" style="color:#0f766e; text-decoration:underline; font-weight:600;">
                <?php esc_html_e( 'Open booking dashboard', 'mybookaro' ); ?>
            </a>
        </p>
    <?php endif; ?>
    <p style="margin-bottom:8px;">
        <?php
        echo sprintf(
            /* translators: %s: dynamic string */
            esc_html__( 'Thank you for choosing %s.', 'mybookaro' ),
            esc_html( $bookaro_site )
        );
        ?>
    </p>
    <p style="margin-bottom:8px;">
        <?php esc_html_e( 'You received this message because a booking notification is enabled in MyBookaro.', 'mybookaro' ); ?>
    </p>
    <p style="margin-bottom:0;">
        &copy;
        <?php
        echo sprintf(
            /* translators: %1$s: dynamic string, %2$s: dynamic string */
            esc_html__( '%1$s %2$s. All rights reserved.', 'mybookaro' ),
            esc_html( $bookaro_year ),
            esc_html( $bookaro_site )
        );
        ?>
    </p>
</div>
</div><!-- .email-container -->
</div><!-- .email-wrapper -->
</body>
</html>
