<?php
/**
 * Single Product Scene
 *
 * @package scene3d
 */

use Scene3d\Plugin;
use Scene3d\woocommerce\Woo;

defined( 'ABSPATH' ) || exit;

global $product;
$meta              = get_post_meta( $product->get_id(), Woo::$meta_key, true );
$columns           = apply_filters( 'woocommerce_product_thumbnails_columns', 4 );
$post_thumbnail_id = $product->get_image_id();
$wrapper_classes   = apply_filters(
	'woocommerce_single_product_image_gallery_classes',
	array(
		'woocommerce-product-gallery',
		'woocommerce-product-gallery--' . ( $post_thumbnail_id ? 'with-images' : 'without-images' ),
		'woocommerce-product-gallery--columns-' . absint( $columns ),
		'images',
	)
);
?>
<div class="<?php echo esc_attr( implode( ' ', array_map( 'sanitize_html_class', $wrapper_classes ) ) ); ?>" data-columns="<?php echo esc_attr( $columns ); ?>" style="opacity: 0; transition: opacity .25s ease-in-out;">
	<?php
	echo wp_kses(
		Plugin::get_instance()->get_output( $meta['id'] ),
		Plugin::allowed_tags()
	);
	?>
</div>
