<?php

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

?>
<table class="prodigy-product__additional prodigy-custom-template">
	<caption class="prodigy-visually-hidden">
		 <?php esc_html_e( 'Additional product details', 'prodigy-commerce' ); ?>
	</caption>
	<tbody>
	<?php if ( $show_additional ) : ?>
		<?php if ( $show_additional_weight ) : ?>
			<tr>
				<th class="prodigy-product__additional-col-title" scope="row">
					<?php esc_html_e( 'WEIGHT', 'prodigy-commerce' ); ?>
				</th>
				<td class="prodigy-product__additional-col-value prodigy-additional-weight-js">
					<?php echo esc_attr( $prodigy_additional_weight ); ?>
					<?php echo esc_attr( $prodigy_additional_weight_unit ); ?>
				</td>
			</tr>
		<?php endif; ?>
		<tr>
			<th class="prodigy-product__additional-col-title" scope="row">
				<?php esc_html_e( 'DIMENSIONS', 'prodigy-commerce' ); ?>
			</th>
			<td class="prodigy-product__additional-col-value prodigy-additional-dimensions-js">
				<?php echo esc_attr( $prodigy_additional_depth ); ?>
				<span aria-hidden="true">x</span>
				<?php echo esc_attr( $prodigy_additional_width ); ?>
				<span aria-hidden="true">x</span>
				<?php echo esc_attr( $prodigy_additional_height ); ?>
				<?php echo esc_attr( $prodigy_additional_size_unit ); ?>
			</td>
		</tr>
	<?php endif; ?>
	<?php if ( ! empty( $descriptive_option ) && is_array( $descriptive_option ) ) : ?>
		<?php foreach ( $descriptive_option as $key => $item ) : ?>
			<tr>
				<th class="prodigy-product__additional-col-title" scope="row">
					<?php echo esc_html( $key ); ?>
				</th>
				<td class="prodigy-product__additional-col-value">
					<?php echo count( $item ) > 1 ? esc_html( implode( ', ', $item ) ) : esc_html( $item[0] ); ?>
				</td>
			</tr>
		<?php endforeach; ?>
	<?php endif; ?>
	</tbody>
</table>
