<div class="front_page_section front_page_section_woocommerce<?php
	$tourimo_scheme = tourimo_get_theme_option( 'front_page_woocommerce_scheme' );
	if ( ! empty( $tourimo_scheme ) && ! tourimo_is_inherit( $tourimo_scheme ) ) {
		echo ' scheme_' . esc_attr( $tourimo_scheme );
	}
	echo ' front_page_section_paddings_' . esc_attr( tourimo_get_theme_option( 'front_page_woocommerce_paddings' ) );
	if ( tourimo_get_theme_option( 'front_page_woocommerce_stack' ) ) {
		echo ' sc_stack_section_on';
	}
?>"
		<?php
		$tourimo_css      = '';
		$tourimo_bg_image = tourimo_get_theme_option( 'front_page_woocommerce_bg_image' );
		if ( ! empty( $tourimo_bg_image ) ) {
			$tourimo_css .= 'background-image: url(' . esc_url( tourimo_get_attachment_url( $tourimo_bg_image ) ) . ');';
		}
		if ( ! empty( $tourimo_css ) ) {
			echo ' style="' . esc_attr( $tourimo_css ) . '"';
		}
		?>
>
<?php
	// Add anchor
	$tourimo_anchor_icon = tourimo_get_theme_option( 'front_page_woocommerce_anchor_icon' );
	$tourimo_anchor_text = tourimo_get_theme_option( 'front_page_woocommerce_anchor_text' );
if ( ( ! empty( $tourimo_anchor_icon ) || ! empty( $tourimo_anchor_text ) ) && shortcode_exists( 'trx_sc_anchor' ) ) {
	echo do_shortcode(
		'[trx_sc_anchor id="front_page_section_woocommerce"'
									. ( ! empty( $tourimo_anchor_icon ) ? ' icon="' . esc_attr( $tourimo_anchor_icon ) . '"' : '' )
									. ( ! empty( $tourimo_anchor_text ) ? ' title="' . esc_attr( $tourimo_anchor_text ) . '"' : '' )
									. ']'
	);
}
?>
	<div class="front_page_section_inner front_page_section_woocommerce_inner
	<?php
	if ( tourimo_get_theme_option( 'front_page_woocommerce_fullheight' ) ) {
		echo ' tourimo-full-height sc_layouts_flex sc_layouts_columns_middle';
	}
	?>
			"
			<?php
			$tourimo_css      = '';
			$tourimo_bg_mask  = tourimo_get_theme_option( 'front_page_woocommerce_bg_mask' );
			$tourimo_bg_color_type = tourimo_get_theme_option( 'front_page_woocommerce_bg_color_type' );
			if ( 'custom' == $tourimo_bg_color_type ) {
				$tourimo_bg_color = tourimo_get_theme_option( 'front_page_woocommerce_bg_color' );
			} elseif ( 'scheme_bg_color' == $tourimo_bg_color_type ) {
				$tourimo_bg_color = tourimo_get_scheme_color( 'bg_color', $tourimo_scheme );
			} else {
				$tourimo_bg_color = '';
			}
			if ( ! empty( $tourimo_bg_color ) && $tourimo_bg_mask > 0 ) {
				$tourimo_css .= 'background-color: ' . esc_attr(
					1 == $tourimo_bg_mask ? $tourimo_bg_color : tourimo_hex2rgba( $tourimo_bg_color, $tourimo_bg_mask )
				) . ';';
			}
			if ( ! empty( $tourimo_css ) ) {
				echo ' style="' . esc_attr( $tourimo_css ) . '"';
			}
			?>
	>
		<div class="front_page_section_content_wrap front_page_section_woocommerce_content_wrap content_wrap woocommerce">
			<?php
			// Content wrap with title and description
			$tourimo_caption     = tourimo_get_theme_option( 'front_page_woocommerce_caption' );
			$tourimo_description = tourimo_get_theme_option( 'front_page_woocommerce_description' );
			if ( ! empty( $tourimo_caption ) || ! empty( $tourimo_description ) || ( current_user_can( 'edit_theme_options' ) && is_customize_preview() ) ) {
				// Caption
				if ( ! empty( $tourimo_caption ) || ( current_user_can( 'edit_theme_options' ) && is_customize_preview() ) ) {
					?>
					<h2 class="front_page_section_caption front_page_section_woocommerce_caption front_page_block_<?php echo ! empty( $tourimo_caption ) ? 'filled' : 'empty'; ?>">
					<?php
						echo wp_kses( $tourimo_caption, 'tourimo_kses_content' );
					?>
					</h2>
					<?php
				}

				// Description (text)
				if ( ! empty( $tourimo_description ) || ( current_user_can( 'edit_theme_options' ) && is_customize_preview() ) ) {
					?>
					<div class="front_page_section_description front_page_section_woocommerce_description front_page_block_<?php echo ! empty( $tourimo_description ) ? 'filled' : 'empty'; ?>">
					<?php
						echo wp_kses( wpautop( $tourimo_description ), 'tourimo_kses_content' );
					?>
					</div>
					<?php
				}
			}

			// Content (widgets)
			?>
			<div class="front_page_section_output front_page_section_woocommerce_output list_products shop_mode_thumbs">
				<?php
				$tourimo_woocommerce_sc = tourimo_get_theme_option( 'front_page_woocommerce_products' );
				if ( 'products' == $tourimo_woocommerce_sc ) {
					$tourimo_woocommerce_sc_ids      = tourimo_get_theme_option( 'front_page_woocommerce_products_per_page' );
					$tourimo_woocommerce_sc_per_page = count( explode( ',', $tourimo_woocommerce_sc_ids ) );
				} else {
					$tourimo_woocommerce_sc_per_page = max( 1, (int) tourimo_get_theme_option( 'front_page_woocommerce_products_per_page' ) );
				}
				$tourimo_woocommerce_sc_columns = max( 1, min( $tourimo_woocommerce_sc_per_page, (int) tourimo_get_theme_option( 'front_page_woocommerce_products_columns' ) ) );
				echo do_shortcode(
					"[{$tourimo_woocommerce_sc}"
									. ( 'products' == $tourimo_woocommerce_sc
											? ' ids="' . esc_attr( $tourimo_woocommerce_sc_ids ) . '"'
											: '' )
									. ( 'product_category' == $tourimo_woocommerce_sc
											? ' category="' . esc_attr( tourimo_get_theme_option( 'front_page_woocommerce_products_categories' ) ) . '"'
											: '' )
									. ( 'best_selling_products' != $tourimo_woocommerce_sc
											? ' orderby="' . esc_attr( tourimo_get_theme_option( 'front_page_woocommerce_products_orderby' ) ) . '"'
												. ' order="' . esc_attr( tourimo_get_theme_option( 'front_page_woocommerce_products_order' ) ) . '"'
											: '' )
									. ' per_page="' . esc_attr( $tourimo_woocommerce_sc_per_page ) . '"'
									. ' columns="' . esc_attr( $tourimo_woocommerce_sc_columns ) . '"'
					. ']'
				);
				?>
			</div>
		</div>
	</div>
</div>
