<?php
/**
 * Icon / Info List widget.
 *
 * @package IMPACT_WIDGETS_ELEMENTOR
 */

namespace ImpactAddons\ImpactWidgetsForElementor\Widgets;

use Elementor\Controls_Manager;
use Elementor\Group_Control_Background;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Icons_Manager;
use Elementor\Repeater;
use Elementor\Widget_Base;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Icon_Info_List extends Widget_Base {
	public function get_name(): string {
		return 'impact_widgets_elementor_icon-info-list';
	}

	public function get_title(): string {
		return esc_html__( 'Icon / Info List', 'impact-widgets-for-elementor' );
	}

	public function get_icon(): string {
		return 'eicon-bullet-list';
	}

	public function get_categories(): array {
		return array( 'impact-widgets-elementor' );
	}

	public function get_style_depends(): array {
		return array( 'impact_widgets_elementor_icon-info-list' );
	}

	protected function register_controls(): void {
		$this->start_controls_section(
			'section_content',
			array(
				'label' => esc_html__( 'Content', 'impact-widgets-for-elementor' ),
			)
		);

		$this->add_control(
			'list_style',
			array(
				'label'   => esc_html__( 'Preset Style', 'impact-widgets-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'style-1',
				'options' => array(
					'style-1' => esc_html__( 'Stats Horizontal', 'impact-widgets-for-elementor' ),
					'style-2' => esc_html__( 'Icon + Details', 'impact-widgets-for-elementor' ),
					'style-3' => esc_html__( 'Vertical Timeline', 'impact-widgets-for-elementor' ),
					'style-4' => esc_html__( 'Numbered Grid', 'impact-widgets-for-elementor' ),
					'style-5' => esc_html__( 'Dark Minimal List', 'impact-widgets-for-elementor' ),
					'style-6' => esc_html__( 'Arrow Card List', 'impact-widgets-for-elementor' ),
					'style-7' => esc_html__( 'Label Badge List', 'impact-widgets-for-elementor' ),
				),
			)
		);

		$this->add_responsive_control(
			'columns',
			array(
				'label'     => esc_html__( 'Columns', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::SELECT,
				'default'   => '2',
				'options'   => array(
					'1' => '1',
					'2' => '2',
					'3' => '3',
					'4' => '4',
				),
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list' => '--eb-info-list-columns: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'show_connector',
			array(
				'label'        => esc_html__( 'Show Connector Line', 'impact-widgets-for-elementor' ),
				'type'         => Controls_Manager::SWITCHER,
				'label_on'     => esc_html__( 'Yes', 'impact-widgets-for-elementor' ),
				'label_off'    => esc_html__( 'No', 'impact-widgets-for-elementor' ),
				'return_value' => 'yes',
				'default'      => 'yes',
			)
		);

		$this->add_control(
			'show_arrow',
			array(
				'label'        => esc_html__( 'Show Arrow', 'impact-widgets-for-elementor' ),
				'type'         => Controls_Manager::SWITCHER,
				'label_on'     => esc_html__( 'Yes', 'impact-widgets-for-elementor' ),
				'label_off'    => esc_html__( 'No', 'impact-widgets-for-elementor' ),
				'return_value' => 'yes',
				'default'      => 'yes',
				'condition'    => array(
					'list_style' => 'style-6',
				),
			)
		);

		$this->add_control(
			'arrow_icon',
			array(
				'label'            => esc_html__( 'Arrow Icon', 'impact-widgets-for-elementor' ),
				'type'             => Controls_Manager::ICONS,
				'fa4compatibility' => 'arrow_icon_fa4',
				'default'          => array(
					'value'   => 'fas fa-arrow-right',
					'library' => 'fa-solid',
				),
				'condition'        => array(
					'list_style'  => 'style-6',
					'show_arrow'  => 'yes',
				),
			)
		);

		$repeater = new Repeater();

		$repeater->add_control(
			'item_title',
			array(
				'label'       => esc_html__( 'Title', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'Service One', 'impact-widgets-for-elementor' ),
				'placeholder' => esc_html__( 'Enter title', 'impact-widgets-for-elementor' ),
			)
		);

		$repeater->add_control(
			'item_subtitle',
			array(
				'label'       => esc_html__( 'Subtitle / Value', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( '250+', 'impact-widgets-for-elementor' ),
				'placeholder' => esc_html__( 'Enter subtitle or value', 'impact-widgets-for-elementor' ),
			)
		);

		$repeater->add_control(
			'item_description',
			array(
				'label'       => esc_html__( 'Description', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::TEXTAREA,
				'default'     => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'impact-widgets-for-elementor' ),
				'rows'        => 3,
				'placeholder' => esc_html__( 'Enter description', 'impact-widgets-for-elementor' ),
			)
		);

		$repeater->add_control(
			'item_media_type',
			array(
				'label'   => esc_html__( 'Media Type', 'impact-widgets-for-elementor' ),
				'type'    => Controls_Manager::SELECT,
				'default' => 'icon',
				'options' => array(
					'icon'   => esc_html__( 'Icon', 'impact-widgets-for-elementor' ),
					'image'  => esc_html__( 'Image', 'impact-widgets-for-elementor' ),
					'number' => esc_html__( 'Number', 'impact-widgets-for-elementor' ),
					'label'  => esc_html__( 'Label Badge', 'impact-widgets-for-elementor' ),
				),
			)
		);

		$repeater->add_control(
			'item_icon',
			array(
				'label'            => esc_html__( 'Icon', 'impact-widgets-for-elementor' ),
				'type'             => Controls_Manager::ICONS,
				'fa4compatibility' => 'item_icon_fa4',
				'default'          => array(
					'value'   => 'fas fa-gem',
					'library' => 'fa-solid',
				),
				'condition'        => array(
					'item_media_type' => 'icon',
				),
			)
		);

		$repeater->add_control(
			'item_image',
			array(
				'label'     => esc_html__( 'Image', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::MEDIA,
				'dynamic'   => array(
					'active' => true,
				),
				'condition' => array(
					'item_media_type' => 'image',
				),
			)
		);

		$repeater->add_control(
			'item_number',
			array(
				'label'       => esc_html__( 'Number', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => '01',
				'placeholder' => esc_html__( 'Enter number', 'impact-widgets-for-elementor' ),
				'condition'   => array(
					'item_media_type' => 'number',
				),
			)
		);

		$repeater->add_control(
			'item_label',
			array(
				'label'       => esc_html__( 'Label Badge', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::TEXT,
				'default'     => esc_html__( 'Featured', 'impact-widgets-for-elementor' ),
				'placeholder' => esc_html__( 'Enter badge label', 'impact-widgets-for-elementor' ),
				'condition'   => array(
					'item_media_type' => 'label',
				),
			)
		);

		$repeater->add_control(
			'item_link',
			array(
				'label'         => esc_html__( 'Item Link', 'impact-widgets-for-elementor' ),
				'type'          => Controls_Manager::URL,
				'placeholder'   => esc_html__( 'https://your-link.com', 'impact-widgets-for-elementor' ),
				'show_external' => true,
			)
		);

		$this->add_control(
			'items',
			array(
				'label'       => esc_html__( 'List Items', 'impact-widgets-for-elementor' ),
				'type'        => Controls_Manager::REPEATER,
				'fields'      => $repeater->get_controls(),
				'title_field' => '{{{ item_title }}}',
				'default'     => array(
					array(
						'item_title'       => esc_html__( 'Worldwide Tours', 'impact-widgets-for-elementor' ),
						'item_subtitle'    => '250+',
						'item_description' => esc_html__( 'Trusted by users globally.', 'impact-widgets-for-elementor' ),
						'item_media_type'  => 'icon',
						'item_icon'        => array(
							'value'   => 'fas fa-plane',
							'library' => 'fa-solid',
						),
					),
					array(
						'item_title'       => esc_html__( 'Working Hours', 'impact-widgets-for-elementor' ),
						'item_subtitle'    => '352+',
						'item_description' => esc_html__( 'Active project support coverage.', 'impact-widgets-for-elementor' ),
						'item_media_type'  => 'icon',
						'item_icon'        => array(
							'value'   => 'far fa-clock',
							'library' => 'fa-regular',
						),
					),
					array(
						'item_title'       => esc_html__( 'Happy Customers', 'impact-widgets-for-elementor' ),
						'item_subtitle'    => '100+',
						'item_description' => esc_html__( 'Client-first delivery model.', 'impact-widgets-for-elementor' ),
						'item_media_type'  => 'icon',
						'item_icon'        => array(
							'value'   => 'fas fa-users',
							'library' => 'fa-solid',
						),
					),
				),
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_layout',
			array(
				'label' => esc_html__( 'Layout', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_responsive_control(
			'list_gap',
			array(
				'label'      => esc_html__( 'Items Gap', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 0,
						'max' => 120,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__items' => 'gap: {{SIZE}}{{UNIT}};',
				),
			)
		);

		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'wrapper_background',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eb-icon-info-list',
			)
		);

		$this->add_responsive_control(
			'wrapper_padding',
			array(
				'label'      => esc_html__( 'Wrapper Padding', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em', 'rem' ),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_item',
			array(
				'label' => esc_html__( 'Item', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_group_control(
			Group_Control_Background::get_type(),
			array(
				'name'     => 'item_background',
				'types'    => array( 'classic', 'gradient' ),
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-inner',
			)
		);

		$this->add_group_control(
			Group_Control_Border::get_type(),
			array(
				'name'     => 'item_border',
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-inner',
			)
		);

		$this->add_responsive_control(
			'item_border_radius',
			array(
				'label'      => esc_html__( 'Border Radius', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__item-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);

		$this->add_responsive_control(
			'item_padding',
			array(
				'label'      => esc_html__( 'Padding', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%', 'em', 'rem' ),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__item-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);

		$this->add_group_control(
			Group_Control_Box_Shadow::get_type(),
			array(
				'name'     => 'item_shadow',
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-inner',
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_media',
			array(
				'label' => esc_html__( 'Media', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_control(
			'media_color',
			array(
				'label'     => esc_html__( 'Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list__item-media' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'media_background_color',
			array(
				'label'     => esc_html__( 'Background Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list__item-media' => 'background-color: {{VALUE}};',
				),
			)
		);

		$this->add_responsive_control(
			'icon_size',
			array(
				'label'      => esc_html__( 'Icon Size', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 10,
						'max' => 140,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__item-media .eb-icon-info-list__icon' => 'font-size: {{SIZE}}{{UNIT}};',
				),
			)
		);

		$this->add_responsive_control(
			'media_size',
			array(
				'label'      => esc_html__( 'Media Box Size', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 24,
						'max' => 200,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__item-media' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
				),
			)
		);

		$this->add_responsive_control(
			'media_radius',
			array(
				'label'      => esc_html__( 'Media Border Radius', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::DIMENSIONS,
				'size_units' => array( 'px', '%' ),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list__item-media' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				),
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_title',
			array(
				'label' => esc_html__( 'Title', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'title_typography',
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-title',
			)
		);

		$this->add_control(
			'title_color',
			array(
				'label'     => esc_html__( 'Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list__item-title' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_control(
			'subtitle_color',
			array(
				'label'     => esc_html__( 'Subtitle / Value Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list__item-subtitle' => 'color: {{VALUE}};',
				),
			)
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'subtitle_typography',
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-subtitle',
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_description',
			array(
				'label' => esc_html__( 'Description', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_group_control(
			Group_Control_Typography::get_type(),
			array(
				'name'     => 'description_typography',
				'selector' => '{{WRAPPER}} .eb-icon-info-list__item-description',
			)
		);

		$this->add_control(
			'description_color',
			array(
				'label'     => esc_html__( 'Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list__item-description' => 'color: {{VALUE}};',
				),
			)
		);

		$this->end_controls_section();

		$this->start_controls_section(
			'section_style_connector',
			array(
				'label' => esc_html__( 'Connector', 'impact-widgets-for-elementor' ),
				'tab'   => Controls_Manager::TAB_STYLE,
			)
		);

		$this->add_control(
			'connector_color',
			array(
				'label'     => esc_html__( 'Color', 'impact-widgets-for-elementor' ),
				'type'      => Controls_Manager::COLOR,
				'selectors' => array(
					'{{WRAPPER}} .eb-icon-info-list' => '--eb-info-list-line-color: {{VALUE}};',
				),
			)
		);

		$this->add_responsive_control(
			'connector_width',
			array(
				'label'      => esc_html__( 'Line Width', 'impact-widgets-for-elementor' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( 'px' ),
				'range'      => array(
					'px' => array(
						'min' => 1,
						'max' => 8,
					),
				),
				'selectors'  => array(
					'{{WRAPPER}} .eb-icon-info-list' => '--eb-info-list-line-width: {{SIZE}}{{UNIT}};',
				),
			)
		);

		$this->end_controls_section();
	}

	protected function render(): void {
		$settings = $this->get_settings_for_display();

		$allowed_styles = array( 'style-1', 'style-2', 'style-3', 'style-4', 'style-5', 'style-6', 'style-7' );
		$list_style = isset( $settings['list_style'] ) ? sanitize_key( $settings['list_style'] ) : 'style-1';
		if ( ! in_array( $list_style, $allowed_styles, true ) ) {
			$list_style = 'style-1';
		}

		$show_connector = isset( $settings['show_connector'] ) && 'yes' === $settings['show_connector'];
		$show_arrow = isset( $settings['show_arrow'] ) && 'yes' === $settings['show_arrow'] && 'style-6' === $list_style;
		$items = isset( $settings['items'] ) && is_array( $settings['items'] ) ? $settings['items'] : array();

		$wrapper_classes = array(
			'eb-icon-info-list',
			'eb-icon-info-list--' . sanitize_html_class( $list_style ),
		);

		if ( $show_connector ) {
			$wrapper_classes[] = 'eb-icon-info-list--has-connector';
		}

		if ( $show_arrow ) {
			$wrapper_classes[] = 'eb-icon-info-list--has-arrow';
		}

		$this->add_render_attribute( 'wrapper', 'class', $wrapper_classes );

		?>
		<div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
			<div class="eb-icon-info-list__items">
				<?php foreach ( $items as $index => $item ) : ?>
					<?php
					$item_title = isset( $item['item_title'] ) ? sanitize_text_field( $item['item_title'] ) : '';
					$item_subtitle = isset( $item['item_subtitle'] ) ? sanitize_text_field( $item['item_subtitle'] ) : '';
					$item_description = isset( $item['item_description'] ) ? sanitize_textarea_field( $item['item_description'] ) : '';
					$item_media_type = isset( $item['item_media_type'] ) ? sanitize_key( $item['item_media_type'] ) : 'icon';
					if ( ! in_array( $item_media_type, array( 'icon', 'image', 'number', 'label' ), true ) ) {
						$item_media_type = 'icon';
					}
					$item_link = ! empty( $item['item_link']['url'] ) ? esc_url( $item['item_link']['url'] ) : '';
					$item_number = isset( $item['item_number'] ) ? sanitize_text_field( $item['item_number'] ) : '';
					$item_label = isset( $item['item_label'] ) ? sanitize_text_field( $item['item_label'] ) : '';
					$auto_number = str_pad( (string) ( $index + 1 ), 2, '0', STR_PAD_LEFT );
					$item_media_class = 'eb-icon-info-list__item-media--' . sanitize_html_class( $item_media_type );

					$tag = '' !== $item_link ? 'a' : 'div';
					$this->add_render_attribute( 'item_' . $index, 'class', 'eb-icon-info-list__item-inner' );
					if ( '' !== $item_link ) {
						$this->add_render_attribute( 'item_' . $index, 'href', $item_link );
						if ( ! empty( $item['item_link']['is_external'] ) ) {
							$this->add_render_attribute( 'item_' . $index, 'target', '_blank' );
							$this->add_render_attribute( 'item_' . $index, 'rel', 'noopener' );
						}

						if ( ! empty( $item['item_link']['nofollow'] ) ) {
							$this->add_render_attribute( 'item_' . $index, 'rel', 'nofollow' );
						}
					}
					?>
					<div class="eb-icon-info-list__item">
						<<?php echo esc_html( $tag ); ?> <?php $this->print_render_attribute_string( 'item_' . $index ); ?>>
							<div class="eb-icon-info-list__item-media <?php echo esc_attr( $item_media_class ); ?>" aria-hidden="true">
								<?php if ( 'image' === $item_media_type && ! empty( $item['item_image']['url'] ) ) : ?>
									<img class="eb-icon-info-list__item-image" src="<?php echo esc_url( $item['item_image']['url'] ); ?>" alt="" />
								<?php elseif ( 'number' === $item_media_type ) : ?>
									<span class="eb-icon-info-list__item-number"><?php echo esc_html( '' !== $item_number ? $item_number : $auto_number ); ?></span>
								<?php elseif ( 'label' === $item_media_type ) : ?>
									<span class="eb-icon-info-list__item-label"><?php echo esc_html( '' !== $item_label ? $item_label : esc_html__( 'New', 'impact-widgets-for-elementor' ) ); ?></span>
								<?php elseif ( ! empty( $item['item_icon']['value'] ) ) : ?>
									<span class="eb-icon-info-list__icon">
										<?php Icons_Manager::render_icon( $item['item_icon'], array( 'aria-hidden' => 'true' ) ); ?>
									</span>
								<?php endif; ?>
							</div>

							<div class="eb-icon-info-list__item-content">
								<?php if ( '' !== $item_subtitle ) : ?>
									<div class="eb-icon-info-list__item-subtitle"><?php echo esc_html( $item_subtitle ); ?></div>
								<?php endif; ?>

								<?php if ( '' !== $item_title ) : ?>
									<h3 class="eb-icon-info-list__item-title"><?php echo esc_html( $item_title ); ?></h3>
								<?php endif; ?>

								<?php if ( '' !== $item_description ) : ?>
									<p class="eb-icon-info-list__item-description"><?php echo esc_html( $item_description ); ?></p>
								<?php endif; ?>
							</div>

							<?php if ( $show_arrow ) : ?>
								<span class="eb-icon-info-list__item-arrow" aria-hidden="true">
									<?php if ( ! empty( $settings['arrow_icon']['value'] ) ) : ?>
										<?php Icons_Manager::render_icon( $settings['arrow_icon'], array( 'aria-hidden' => 'true' ) ); ?>
									<?php endif; ?>
								</span>
							<?php endif; ?>
						</<?php echo esc_html( $tag ); ?>>
					</div>
				<?php endforeach; ?>
			</div>
		</div>
		<?php
	}
}
