<?php

/**
 * Options Settings.
 *
 * @since   4.4.0
 * @package Extra Product Options for WooCommerce
 *
 * Available Variables (from element-form.php):
 * @var array  $epofw_field_data         The field/element data array.
 * @var array  $epofw_general_data       The field general settings array.
 * @var string $epofw_field_type         The field type (text, select, etc.).
 * @var array  $epofw_field_options      The field options array (for select, radio, etc.).
 * @var array  $epofw_options_data       The field settings array.
 * @var array  $epofw_label_data         The label settings array.
 * @var string $epofw_field_name_prefix  The form field name prefix.
 * @var string $epofw_field_id           The field ID/key.
 * @var int    $epofw_get_post_id        The addon post ID.
 * @var array  $epofw_options_for_field_type Field types that have options.
 */
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
$epofw_premium_options_field_types = array('colorswitcher', 'textswitcher', 'imageswitcher');
// Check if this is a premium field type and user is not premium - show preview.
$epofw_is_premium_field_type = epofw_is_premium_field_type( $epofw_field_type );
$epofw_is_premium_options_type = in_array( $epofw_field_type, $epofw_premium_options_field_types, true );
$epofw_is_premium_user_os = false;
$epofw_show_premium_preview = $epofw_is_premium_field_type && !$epofw_is_premium_user_os;
$epofw_mask_preview_data = false;
if ( $epofw_is_premium_field_type ) {
    $epofw_mask_preview_data = true;
}
// Stock management is PRO-only for all option fields.
$epofw_prem_data_stock = epofw_get_premium_field_data();
$epofw_stock_disabled_attr = $epofw_prem_data_stock['disabled'];
$epofw_stock_badge = $epofw_prem_data_stock['badge'];
// Get premium field data for disabled state when showing premium field types to free users.
$epofw_prem_data_os = ( $epofw_show_premium_preview ? epofw_get_premium_field_data() : array(
    'class'      => '',
    'badge'      => '',
    'disabled'   => '',
    'is_premium' => true,
) );
?>
<div class="epofw-tab-content" data-tab="options-settings">

	<?php 
// Show options settings for all eligible field types (including premium types with disabled state for free users).
// Product Group is not in $epofw_options_for_field_type when the Pro-only addon is inactive, but the tab still applies (see element-form.php).
if ( in_array( $epofw_field_type, $epofw_options_for_field_type, true ) || $epofw_show_premium_preview && $epofw_is_premium_options_type || 'productgroup' === $epofw_field_type ) {
    // Allow Multiple setting for Image Switcher only.
    if ( 'imageswitcher' === $epofw_field_type ) {
        $epofw_allow_multiple = epofw_check_array_key_exists( 'allow_multiple', $epofw_general_data );
        ?>
			<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
				<div class="epofw-field-label">
					<label for="allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Allow Multiple Selection', 'extra-product-options-for-woocommerce' );
        echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_os['badge'] : '' ), epofw_get_badge_allowed_html() );
        ?></label>
					<div class="epofw-field-description">
						<?php 
        esc_html_e( 'Enable this option to allow customers to select multiple images. When enabled, customers can choose more than one image option, and each selection will be added to the cart with its corresponding price.', 'extra-product-options-for-woocommerce' );
        ?>
					</div>
				</div>
				<div class="epofw-field-input">
					<input type="checkbox" 
					<?php 
        ?>
					id="allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="on" <?php 
        checked( $epofw_allow_multiple, 'on' );
        ?> class="epofw-allowmultiple"<?php 
        echo esc_attr( $epofw_prem_data_os['disabled'] );
        ?>>
					<label for="allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" class="toggle-switch"></label>
				</div>
			</div>
			<?php 
    }
    // Product Group: use addon-provided options table (product search, product_id, price type).
    $epofw_productgroup_table = '';
    if ( 'productgroup' === $epofw_field_type ) {
        /**
         * Filter the HTML for the Product Group field options table (addon output).
         *
         * @since 4.4.7
         */
        $epofw_productgroup_table = apply_filters(
            'epofw_productgroup_options_table',
            '',
            $epofw_field_id,
            $epofw_field_name_prefix,
            $epofw_field_options,
            $epofw_options_data,
            $epofw_get_post_id
        );
        if ( '' !== $epofw_productgroup_table ) {
            echo $epofw_productgroup_table;
            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Addon-escaped HTML.
        }
    }
    // Product Group: min/max selections and toggles are rendered by the Pro addon. When the addon is inactive, show the same UI read-only (no input names).
    if ( 'productgroup' === $epofw_field_type && '' === $epofw_productgroup_table ) {
        $epofw_pg_can_save = epofw_fs()->can_use_premium_code__premium_only();
        $epofw_pg_min_sel = 0;
        $epofw_pg_max_sel = 5;
        $epofw_pg_allow_multi = false;
        $epofw_pg_qty_en = false;
        $epofw_pg_disable_st = false;
        if ( !$epofw_mask_preview_data && is_array( $epofw_options_data ) ) {
            $epofw_pg_min_sel = ( isset( $epofw_options_data['min_selections'] ) ? absint( $epofw_options_data['min_selections'] ) : 0 );
            $epofw_pg_max_sel = ( isset( $epofw_options_data['max_selections'] ) ? absint( $epofw_options_data['max_selections'] ) : 5 );
            $epofw_pg_allow_multi = !empty( $epofw_options_data['allow_multiple_productgroup'] );
            $epofw_pg_qty_en = !empty( $epofw_options_data['product_quantity_enabled'] );
            $epofw_pg_disable_st = !empty( $epofw_options_data['disable_addon_product_stock'] );
        }
        $epofw_pg_badge = ( $epofw_show_premium_preview ? $epofw_prem_data_os['badge'] : '' );
        ?>
			<div class="epofw-productgroup-general-settings">
				<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
					<div class="epofw-field-label">
						<label for="pg_min_selections_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Min. Selections', 'extra-product-options-for-woocommerce' );
        echo wp_kses( $epofw_pg_badge, epofw_get_badge_allowed_html() );
        ?></label>
						<div class="epofw-field-description"><?php 
        esc_html_e( 'The minimum number of products required to select from the group.', 'extra-product-options-for-woocommerce' );
        ?></div>
					</div>
					<div class="epofw-field-input">
						<input type="number"
						<?php 
        if ( $epofw_pg_can_save ) {
            echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[epofw_field_settings][min_selections]"';
        }
        ?>
							id="pg_min_selections_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="<?php 
        echo esc_attr( (string) $epofw_pg_min_sel );
        ?>" min="0" class="epofw-form-control" <?php 
        disabled( !$epofw_pg_can_save );
        ?> />
					</div>
				</div>
				<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
					<div class="epofw-field-label">
						<label for="pg_max_selections_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Max. Selections', 'extra-product-options-for-woocommerce' );
        echo wp_kses( $epofw_pg_badge, epofw_get_badge_allowed_html() );
        ?></label>
						<div class="epofw-field-description"><?php 
        esc_html_e( 'The maximum number of products that can be selected from the group.', 'extra-product-options-for-woocommerce' );
        ?></div>
					</div>
					<div class="epofw-field-input">
						<input type="number"
						<?php 
        if ( $epofw_pg_can_save ) {
            echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[epofw_field_settings][max_selections]"';
        }
        ?>
							id="pg_max_selections_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="<?php 
        echo esc_attr( (string) $epofw_pg_max_sel );
        ?>" min="0" class="epofw-form-control" <?php 
        disabled( !$epofw_pg_can_save );
        ?> />
					</div>
				</div>
				<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
					<div class="epofw-field-label">
						<label for="pg_allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Allow multiple selections', 'extra-product-options-for-woocommerce' );
        echo wp_kses( $epofw_pg_badge, epofw_get_badge_allowed_html() );
        ?></label>
						<div class="epofw-field-description"><?php 
        esc_html_e( 'Enable customers to select more than one product from the group.', 'extra-product-options-for-woocommerce' );
        ?></div>
					</div>
					<div class="epofw-field-input">
						<input type="checkbox"
						<?php 
        if ( $epofw_pg_can_save ) {
            echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[epofw_field_settings][allow_multiple_productgroup]"';
        }
        ?>
							id="pg_allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="on" <?php 
        checked( $epofw_pg_allow_multi, true );
        ?> <?php 
        disabled( !$epofw_pg_can_save );
        ?> />
						<label for="pg_allow_multiple_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" class="toggle-switch"></label>
					</div>
				</div>
				<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
					<div class="epofw-field-label">
						<label for="pg_qty_enabled_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Enable product quantity field', 'extra-product-options-for-woocommerce' );
        echo wp_kses( $epofw_pg_badge, epofw_get_badge_allowed_html() );
        ?></label>
						<div class="epofw-field-description"><?php 
        esc_html_e( 'Assign quantity for individual products under the group.', 'extra-product-options-for-woocommerce' );
        ?></div>
					</div>
					<div class="epofw-field-input">
						<input type="checkbox"
						<?php 
        if ( $epofw_pg_can_save ) {
            echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[epofw_field_settings][product_quantity_enabled]"';
        }
        ?>
							id="pg_qty_enabled_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="on" <?php 
        checked( $epofw_pg_qty_en, true );
        ?> <?php 
        disabled( !$epofw_pg_can_save );
        ?> />
						<label for="pg_qty_enabled_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" class="toggle-switch"></label>
					</div>
				</div>
				<div class="epofw-form-group<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
					<div class="epofw-field-label">
						<label for="pg_disable_stock_<?php 
        echo esc_attr( $epofw_field_id );
        ?>"><?php 
        esc_html_e( 'Disable stock management of addon products', 'extra-product-options-for-woocommerce' );
        echo wp_kses( $epofw_pg_badge, epofw_get_badge_allowed_html() );
        ?></label>
						<div class="epofw-field-description"><?php 
        esc_html_e( 'Prevent inventory tracking of addon product stock when purchased as addons.', 'extra-product-options-for-woocommerce' );
        ?></div>
					</div>
					<div class="epofw-field-input">
						<input type="checkbox"
						<?php 
        if ( $epofw_pg_can_save ) {
            echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[epofw_field_settings][disable_addon_product_stock]"';
        }
        ?>
							id="pg_disable_stock_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" value="on" <?php 
        checked( $epofw_pg_disable_st, true );
        ?> <?php 
        disabled( !$epofw_pg_can_save );
        ?> />
						<label for="pg_disable_stock_<?php 
        echo esc_attr( $epofw_field_id );
        ?>" class="toggle-switch"></label>
					</div>
				</div>
			</div>
			<?php 
    }
    // When Product Group has no addon HTML (e.g. free tier), show the same read-only options preview as other premium option fields.
    if ( 'productgroup' !== $epofw_field_type || '' === $epofw_productgroup_table ) {
        ?>
		<div class="epofw-form-row<?php 
        echo esc_attr( $epofw_prem_data_os['class'] );
        ?>">
			<div class="epofw-form-group epofw-full-width">
				<div class="epofw-field-description epofw-field-description-full-width">
					<?php 
        esc_html_e( 'Add, edit, or remove options. Each option can have a label, price type, and price value.', 'extra-product-options-for-woocommerce' );
        ?> <span class="epofw-required-note"><?php 
        esc_html_e( 'Option Label is required.', 'extra-product-options-for-woocommerce' );
        ?></span>
					<?php 
        echo wp_kses( ( $epofw_show_premium_preview ? $epofw_prem_data_os['badge'] : '' ), epofw_get_badge_allowed_html() );
        ?>
				</div>
				<div class="epofw-options-container" id="epofw-options-container">
					<?php 
        $epofw_unique_field_slug = 'epofw_cs_' . $epofw_field_type;
        $epofw_unique_field_name_slug = 'epofw_cs_switcher';
        $epofw_field_settings_key = 'epofw_field_settings';
        if ( !empty( $epofw_field_options ) ) {
            $epofw_option_counter = 1;
            foreach ( $epofw_field_options as $epofw_option_key => $epofw_option_value ) {
                $epofw_opt_grp_data = epofw_explore_label_from_opt_group( $epofw_option_value );
                $epofw_opt_id = $epofw_opt_grp_data['opt_id'];
                // Generate ID for existing options that don't have one (will be saved on next save).
                if ( empty( $epofw_opt_id ) ) {
                    $epofw_opt_id = 'opt_' . time() . $epofw_option_counter . '_' . wp_rand( 1000, 9999 );
                }
                $epofw_opt_label = $epofw_opt_grp_data['opt_label'];
                $epofw_opt_price_type = $epofw_opt_grp_data['opt_price_type'];
                $epofw_opt_price = $epofw_opt_grp_data['opt_price'];
                $epofw_opt_stock = ( isset( $epofw_opt_grp_data['opt_stock'] ) ? $epofw_opt_grp_data['opt_stock'] : '' );
                if ( $epofw_mask_preview_data ) {
                    // Do not expose saved premium option data in free preview.
                    $epofw_opt_id = 'opt_locked_' . $epofw_option_counter;
                    $epofw_opt_label = '';
                    $epofw_opt_price = '';
                    $epofw_opt_stock = '';
                    $epofw_opt_colorswticher = '';
                }
                ?>
							<div class="epofw-option-row opt-li" id="opt-li-<?php 
                echo esc_attr( $epofw_option_counter );
                ?>" data-opt-id="<?php 
                echo esc_attr( $epofw_opt_id );
                ?>">
								<input type="hidden" 
								<?php 
                if ( !$epofw_is_premium_field_type ) {
                    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_id][]"';
                } else {
                }
                ?>
								value="<?php 
                echo esc_attr( $epofw_opt_id );
                ?>" class="epofw-option-id">
								<div class="heading_nu_move">
									<span><i class="sortable-icon dashicons dashicons-move"></i></span>
								</div>
								<?php 
                ?>
								<input type="text" 
								<?php 
                if ( !$epofw_is_premium_field_type ) {
                    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][label][]"';
                } else {
                }
                ?>
								value="<?php 
                echo esc_attr( $epofw_opt_label );
                ?>" placeholder="<?php 
                esc_attr_e( 'Option Label', 'extra-product-options-for-woocommerce' );
                ?>" class="epofw-form-control <?php 
                echo esc_attr( $epofw_unique_field_slug );
                ?>" required="required"<?php 
                echo esc_attr( $epofw_prem_data_os['disabled'] );
                ?>>
								<select 
								<?php 
                if ( !$epofw_is_premium_field_type ) {
                    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_price_type][]"';
                } else {
                }
                ?>
								id="opt_price_type_id" class="epofw-form-control"<?php 
                echo esc_attr( $epofw_prem_data_os['disabled'] );
                ?>>
									<?php 
                $epofw_price_type_data = epofw_price_type_data( $epofw_opt_price_type );
                if ( !empty( $epofw_price_type_data ) ) {
                    foreach ( $epofw_price_type_data as $epofw_price_t_key => $epofw_price_type_value ) {
                        ?>
											<option value="<?php 
                        echo esc_attr( $epofw_price_t_key );
                        ?>" <?php 
                        selected( $epofw_opt_price_type, $epofw_price_t_key );
                        ?>><?php 
                        echo esc_html( $epofw_price_type_value );
                        ?></option>
											<?php 
                    }
                }
                ?>
								</select>
								<input type="text" 
								<?php 
                if ( !$epofw_is_premium_field_type ) {
                    echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_price][]"';
                } else {
                }
                ?>
								value="<?php 
                echo esc_attr( $epofw_opt_price );
                ?>" placeholder="<?php 
                esc_attr_e( 'Option Price', 'extra-product-options-for-woocommerce' );
                ?>" class="epofw-form-control"<?php 
                echo esc_attr( $epofw_prem_data_os['disabled'] );
                ?>>
								<input type="number"
								<?php 
                ?>
								value="<?php 
                echo esc_attr( $epofw_opt_stock );
                ?>" placeholder="<?php 
                esc_attr_e( 'Stock', 'extra-product-options-for-woocommerce' );
                ?>" min="0" step="1" class="epofw-form-control"<?php 
                echo esc_attr( $epofw_stock_disabled_attr );
                ?>>
								<?php 
                echo wp_kses( $epofw_stock_badge, epofw_get_badge_allowed_html() );
                ?>
								<button type="button" class="epofw-btn epofw-btn-danger epofw-remove-option remove-opt-btn"<?php 
                echo esc_attr( $epofw_prem_data_os['disabled'] );
                ?>>
									<i class="dashicons dashicons-no-alt"></i>
								</button>
							</div>
							<?php 
                ++$epofw_option_counter;
            }
        } else {
            $epofw_new_opt_id = 'opt_' . time() . '_' . wp_rand( 1000, 9999 );
            ?>
						<div class="epofw-option-row opt-li" id="opt-li-<?php 
            echo esc_attr( wp_rand() );
            ?>" data-opt-id="<?php 
            echo esc_attr( $epofw_new_opt_id );
            ?>">
							<input type="hidden" 
							<?php 
            if ( !$epofw_is_premium_field_type ) {
                echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_id][]"';
            } else {
            }
            ?>
							value="<?php 
            echo esc_attr( $epofw_new_opt_id );
            ?>" class="epofw-option-id">
							<div class="heading_nu_move">
								<span><i class="sortable-icon dashicons dashicons-move"></i></span>
							</div>
							<?php 
            ?>
							<input type="text" 
							<?php 
            if ( !$epofw_is_premium_field_type ) {
                echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][label][]"';
            } else {
            }
            ?>
							value="" placeholder="<?php 
            esc_attr_e( 'Option Label', 'extra-product-options-for-woocommerce' );
            ?>" class="epofw-form-control" required="required"<?php 
            echo esc_attr( $epofw_prem_data_os['disabled'] );
            ?>>
							<select 
							<?php 
            if ( !$epofw_is_premium_field_type ) {
                echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_price_type][]"';
            } else {
            }
            ?>
							id="opt_price_type_id" class="epofw-form-control"<?php 
            echo esc_attr( $epofw_prem_data_os['disabled'] );
            ?>>
								<?php 
            $epofw_price_type_data = epofw_price_type_data( 'fixed' );
            if ( !empty( $epofw_price_type_data ) ) {
                foreach ( $epofw_price_type_data as $epofw_price_t_key => $epofw_price_type_value ) {
                    ?>
										<option value="<?php 
                    echo esc_attr( $epofw_price_t_key );
                    ?>"><?php 
                    echo esc_html( $epofw_price_type_value );
                    ?></option>
										<?php 
                }
            }
            ?>
							</select>
							<input type="text" 
							<?php 
            if ( !$epofw_is_premium_field_type ) {
                echo 'name="' . esc_attr( $epofw_field_name_prefix ) . '[' . esc_attr( $epofw_field_settings_key ) . '][options][opt_price][]"';
            } else {
            }
            ?>
							value="" placeholder="<?php 
            esc_attr_e( 'Option Price', 'extra-product-options-for-woocommerce' );
            ?>" class="epofw-form-control" required="required"<?php 
            echo esc_attr( $epofw_prem_data_os['disabled'] );
            ?>>
							<input type="number"
							<?php 
            ?>
							value="" placeholder="<?php 
            esc_attr_e( 'Stock', 'extra-product-options-for-woocommerce' );
            ?>" min="0" step="1" class="epofw-form-control"<?php 
            echo esc_attr( $epofw_stock_disabled_attr );
            ?>>
							<?php 
            echo wp_kses( $epofw_stock_badge, epofw_get_badge_allowed_html() );
            ?>
							<button type="button" class="epofw-btn epofw-btn-danger epofw-remove-option remove-opt-btn"<?php 
            echo esc_attr( $epofw_prem_data_os['disabled'] );
            ?>>
								<i class="dashicons dashicons-no-alt"></i>
							</button>
						</div>
						<?php 
        }
        ?>
				</div>
				<button type="button" class="epofw-btn epofw-btn-secondary epofw-add-option"<?php 
        echo esc_attr( $epofw_prem_data_os['disabled'] );
        ?>>
					<i class="dashicons dashicons-plus"></i>
					<?php 
        esc_html_e( 'Add Option', 'extra-product-options-for-woocommerce' );
        ?>
				</button>
			</div>
		</div>
			<?php 
    }
} elseif ( 'text' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_restriction"><?php 
    esc_html_e( 'Input Validation', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Control what type of content customers can enter in this field. This helps ensure data quality and prevents invalid submissions. Choose the restriction that best matches your business requirements and customer needs.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    $epofw_is_premium_user_local = false;
    $epofw_field_restriction = epofw_check_array_key_exists( 'field_restriction', $epofw_general_data );
    ?>
				<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][field_restriction]" id="field_restriction" class="epofw-form-control">
					<option value="all" <?php 
    selected( $epofw_field_restriction, 'all' );
    ?>><?php 
    esc_html_e( 'Allow All (No Restrictions)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="only_text" <?php 
    selected( $epofw_field_restriction, 'only_text' );
    ?>><?php 
    esc_html_e( 'Text Only (No Numbers)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="only_number" <?php 
    selected( $epofw_field_restriction, 'only_number' );
    ?>><?php 
    esc_html_e( 'Numbers Only (No Text)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="all_number" <?php 
    selected( $epofw_field_restriction, 'all_number' );
    ?>><?php 
    esc_html_e( 'Numbers with Decimals', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="text_number" <?php 
    selected( $epofw_field_restriction, 'text_number' );
    ?>><?php 
    esc_html_e( 'Text and Numbers', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="email" <?php 
    selected( $epofw_field_restriction, 'email' );
    ?>><?php 
    esc_html_e( 'Email Address Only', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="url" <?php 
    selected( $epofw_field_restriction, 'url' );
    ?>><?php 
    esc_html_e( 'URL/Website Only', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="tel" <?php 
    selected( $epofw_field_restriction, 'tel' );
    ?>><?php 
    esc_html_e( 'Phone Number Only', 'extra-product-options-for-woocommerce' );
    ?></option>
				</select>
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_default_value"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter a default value that will appear in this field when the form loads.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    // Check for default_value first (for backward compatibility), then fall back to value (new format).
    $epofw_default_value = epofw_check_array_key_exists( 'default_value', $epofw_general_data );
    if ( empty( $epofw_default_value ) ) {
        $epofw_default_value = epofw_check_array_key_exists( 'value', $epofw_general_data );
    }
    ?>
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="field_default_value" value="<?php 
    echo esc_attr( $epofw_default_value );
    ?>" class="epofw-form-control">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_placeholder"><?php 
    esc_html_e( 'Placeholder', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter placeholder text that will appear inside the field before the user types.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][placeholder]" id="field_placeholder" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'placeholder', $epofw_general_data ) );
    ?>" class="epofw-form-control">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_readonly"><?php 
    esc_html_e( 'Readonly Field', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enable this to make the field read-only. Users can see the value but cannot edit it.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][readonly]" id="field_readonly" value="on" <?php 
    checked( epofw_check_array_key_exists( 'readonly', $epofw_general_data ), 'on' );
    ?>>
				<label for="field_readonly" class="toggle-switch"></label>
			</div>
		</div>

		<?php 
    // Premium fields: Max Length and Mask Format - show with disabled state for free users.
    $epofw_prem_data = epofw_get_premium_field_data();
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_max_length"><?php 
    esc_html_e( 'Max Length', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the maximum number of characters allowed in this field. Leave empty for no limit.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="field_max_length" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'max_length', $epofw_general_data ) );
    ?>" class="epofw-form-control" min="1"<?php 
    echo esc_attr( $epofw_prem_data['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_mask_format"><?php 
    esc_html_e( 'Mask Format', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter a mask format to control how users input data (e.g., (999) 999-9999 for phone numbers).', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" 
				<?php 
    ?>
				id="field_mask_format" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'mask_format', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="(999) 999-9999"<?php 
    echo esc_attr( $epofw_prem_data['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'textarea' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_default_value"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter a default value that will appear in this field when the form loads.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    // Check for default_value first (for backward compatibility), then fall back to value (new format).
    $epofw_default_value = epofw_check_array_key_exists( 'default_value', $epofw_general_data );
    if ( empty( $epofw_default_value ) ) {
        $epofw_default_value = epofw_check_array_key_exists( 'value', $epofw_general_data );
    }
    ?>
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="field_default_value" value="<?php 
    echo esc_attr( $epofw_default_value );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'Enter default message', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_placeholder"><?php 
    esc_html_e( 'Placeholder', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter placeholder text that will appear inside the field before the user types.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][placeholder]" id="field_placeholder" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'placeholder', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'Enter your message', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_cols"><?php 
    esc_html_e( 'Field Width (Columns)', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the width of the textarea field in terms of character columns. This is a technical setting that affects the visual appearance and layout of the field. Higher values create wider fields, while lower values create narrower ones.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][cols]" id="field_cols" value="<?php 
    echo esc_attr( ( epofw_check_array_key_exists( 'cols', $epofw_general_data ) ? epofw_check_array_key_exists( 'cols', $epofw_general_data ) : '30' ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'e.g., 30, 50, or 80', 'extra-product-options-for-woocommerce' );
    ?>" min="10" max="200">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_rows"><?php 
    esc_html_e( 'Field Height (Rows)', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the height of the textarea field in terms of text rows. This determines how much vertical space the field occupies and affects the user experience. More rows provide more space for longer content, while fewer rows create compact fields.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][rows]" id="field_rows" value="<?php 
    echo esc_attr( ( epofw_check_array_key_exists( 'rows', $epofw_general_data ) ? epofw_check_array_key_exists( 'rows', $epofw_general_data ) : '5' ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'e.g., 3, 5, or 10', 'extra-product-options-for-woocommerce' );
    ?>" min="1" max="50">
			</div>
		</div>

		<?php 
    // Premium helper for textarea.
    $epofw_prem_data_textarea = epofw_get_premium_field_data();
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_textarea['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_maxlength"><?php 
    esc_html_e( 'Maximum Character Limit', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_textarea['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the maximum number of characters that customers can enter in this textarea field. This helps control content length and ensures consistent data quality. Leave empty for no limit, or set a reasonable limit based on your business needs.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="field_maxlength" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'maxlength', $epofw_general_data ) );
    ?>" class="epofw-form-control default_num_class" min="1" placeholder="<?php 
    esc_attr_e( 'e.g., 500, 1000, or leave empty for no limit', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_textarea['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'number' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_default_value"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter a default value that will appear in this field when the form loads.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    // Check for default_value first (for backward compatibility), then fall back to value (new format).
    $epofw_default_value = epofw_check_array_key_exists( 'default_value', $epofw_general_data );
    if ( empty( $epofw_default_value ) ) {
        $epofw_default_value = epofw_check_array_key_exists( 'value', $epofw_general_data );
    }
    ?>
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="field_default_value" value="<?php 
    echo esc_attr( $epofw_default_value );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'Enter default message', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_min"><?php 
    esc_html_e( 'Minimum Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the lowest number that customers can enter in this field. This establishes a lower boundary and helps prevent invalid or unrealistic values. Choose a minimum that makes sense for your product context.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][min]" id="field_min" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'min', $epofw_general_data ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'e.g., 0, 1, or -100', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_max"><?php 
    esc_html_e( 'Maximum Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the highest number that customers can enter in this field. This establishes an upper boundary and helps prevent unrealistic or excessive values. Consider business constraints and practical limits when setting this value.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][max]" id="field_max" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'max', $epofw_general_data ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'e.g., 100, 1000, or 999999', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_step"><?php 
    esc_html_e( 'Increment Step', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Define the increment value between valid numbers in this field. This determines the precision and granularity of the input. For example, a step of 1 allows whole numbers, while 0.01 allows two decimal places.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][step]" id="field_step" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'step', $epofw_general_data ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'e.g., 1, 0.5, or 0.01', 'extra-product-options-for-woocommerce' );
    ?>" min="0.01" step="0.01">
			</div>
		</div>
		<?php 
} elseif ( 'datepicker' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="datepicker_default_value"><?php 
    esc_html_e( 'Default Date', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the initial date that will appear in the datepicker when the page loads. This provides a starting point for customers and can improve user experience by pre-selecting a sensible default date.', 'extra-product-options-for-woocommerce' );
    ?>
					<br><strong><?php 
    esc_html_e( 'Note: Custom dates must match the selected Date Format (e.g., for mm-dd-yy use 12-25-2026).', 'extra-product-options-for-woocommerce' );
    ?></strong>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="datepicker_default_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw_datepicker epofw-date-input" placeholder="<?php 
    esc_attr_e( 'e.g., 15-05-2024 or leave empty', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="datepicker_placeholder"><?php 
    esc_html_e( 'Placeholder Text', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter helpful text that will appear inside the datepicker field before customers select a date. This text should guide users on what type of date to enter or provide formatting examples.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][placeholder]" id="datepicker_placeholder" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'placeholder', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Select a date or DD-MM-YYYY', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_readonly"><?php 
    esc_html_e( 'Readonly Field', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enable this to make the field read-only. Users can see the value but cannot edit it.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[epofw_field_settings][readonly]" id="field_readonly" value="on" <?php 
    checked( epofw_check_array_key_exists( 'readonly', $epofw_options_data ), 'on' );
    ?>>
				<label for="field_readonly" class="toggle-switch"></label>
			</div>
		</div>

		<?php 
    // Premium helper for datepicker.
    $epofw_prem_data_datepicker = epofw_get_premium_field_data();
    $epofw_is_premium_datepicker = $epofw_prem_data_datepicker['is_premium'];
    $epofw_current_date_format = epofw_check_array_key_exists( 'date_format', $epofw_options_data );
    if ( empty( $epofw_current_date_format ) ) {
        $epofw_current_date_format = 'dd-mm-yy';
        // Default format.
    }
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_datepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_date_format"><?php 
    esc_html_e( 'Date Format', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_datepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose the date format that will be displayed to customers on the frontend. This affects how dates appear in the datepicker field.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select 
				<?php 
    ?>
				id="field_date_format" class="epofw-form-control"<?php 
    echo esc_attr( $epofw_prem_data_datepicker['disabled'] );
    ?>>
					<option value="dd-mm-yy" <?php 
    selected( $epofw_current_date_format, 'dd-mm-yy' );
    ?>><?php 
    esc_html_e( 'dd-mm-yy', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="mm-dd-yy" <?php 
    selected( $epofw_current_date_format, 'mm-dd-yy' );
    ?>><?php 
    esc_html_e( 'mm-dd-yy', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="dd/mm/yy" <?php 
    selected( $epofw_current_date_format, 'dd/mm/yy' );
    ?>><?php 
    esc_html_e( 'dd/mm/yy', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="mm/dd/yy" <?php 
    selected( $epofw_current_date_format, 'mm/dd/yy' );
    ?>><?php 
    esc_html_e( 'mm/dd/yy', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="yy-mm-dd" <?php 
    selected( $epofw_current_date_format, 'yy-mm-dd' );
    ?>><?php 
    esc_html_e( 'yy-mm-dd', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="yy/mm/dd" <?php 
    selected( $epofw_current_date_format, 'yy/mm/dd' );
    ?>><?php 
    esc_html_e( 'yy/mm/dd', 'extra-product-options-for-woocommerce' );
    ?></option>
				</select>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_datepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_min_date"><?php 
    esc_html_e( 'Minimum Date', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_datepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the earliest date that customers can select. Use dynamic formats like {currentDate}, {currentDate}{+1d}, {currentDate}{+2d} or specific dates.', 'extra-product-options-for-woocommerce' );
    ?>
					<br><strong><?php 
    esc_html_e( 'Note: Custom dates must match the selected Date Format (e.g., for mm-dd-yy use 12-25-2026).', 'extra-product-options-for-woocommerce' );
    ?></strong>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" 
				<?php 
    ?>
				id="field_min_date" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'min_date', $epofw_options_data ) );
    ?>" class="epofw-form-control epofw_min_datepicker" placeholder="<?php 
    esc_attr_e( 'Select Min Date', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_datepicker['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_datepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_max_date"><?php 
    esc_html_e( 'Maximum Date', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_datepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the latest date that customers can select. Use dynamic formats like {currentDate}, {currentDate}{+1d}, {currentDate}{+2d} or specific dates.', 'extra-product-options-for-woocommerce' );
    ?>
					<br><strong><?php 
    esc_html_e( 'Note: Custom dates must match the selected Date Format (e.g., for mm-dd-yy use 12-25-2026).', 'extra-product-options-for-woocommerce' );
    ?></strong>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" 
				<?php 
    ?>
				id="field_max_date" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'max_date', $epofw_options_data ) );
    ?>" class="epofw-form-control epofw_max_datepicker" placeholder="<?php 
    esc_attr_e( 'Select Max Date', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_datepicker['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_datepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_disable_weekends"><?php 
    esc_html_e( 'Disable Weekends', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_datepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'When enabled, customers will not be able to select Saturday or Sunday dates. This is useful for business applications that only operate on weekdays.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" 
				<?php 
    ?>
				id="field_disable_weekends" value="on" <?php 
    checked( epofw_check_array_key_exists( 'epofw_disable_weekends', $epofw_options_data ), 'on' );
    echo esc_attr( $epofw_prem_data_datepicker['disabled'] );
    ?>>
				<label for="field_disable_weekends" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_datepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_disable_custom_dates"><?php 
    esc_html_e( 'Disable Custom Dates', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_datepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Specify specific dates that should be disabled for selection. Enter dates separated by commas. Useful for holidays or unavailable dates.', 'extra-product-options-for-woocommerce' );
    ?>
					<br><strong><?php 
    esc_html_e( 'Note: Custom dates must match the selected Date Format (e.g., for mm-dd-yy use 12-25-2026).', 'extra-product-options-for-woocommerce' );
    ?></strong>
				</div>
			</div>
			<div class="epofw-field-input">
				<textarea 
				<?php 
    ?>
				id="field_disable_custom_dates" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'Enter dates separated by commas (e.g., 10-05-2022, 11-05-2022)', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_datepicker['disabled'] );
    ?>><?php 
    echo esc_textarea( epofw_check_array_key_exists( 'epofw_disable_custom_dates', $epofw_options_data ) );
    ?></textarea>
			</div>
		</div>
		<?php 
} elseif ( 'timepicker' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="timepicker_default_value"><?php 
    esc_html_e( 'Default Time', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the initial time that will appear in the timepicker when the page loads. This provides a starting point for customers and can improve user experience by pre-selecting a sensible default time.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="time" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="timepicker_default_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw_timepicker epofw-time-input" placeholder="<?php 
    esc_attr_e( 'e.g., 09:00 or leave empty', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="timepicker_placeholder"><?php 
    esc_html_e( 'Placeholder Text', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter helpful text that will appear inside the timepicker field before customers select a time. This text should guide users on what type of time to enter or provide formatting examples.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][placeholder]" id="timepicker_placeholder" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'placeholder', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Select a time or HH:MM', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<?php 
    // Premium helper for timepicker.
    $epofw_prem_data_timepicker = epofw_get_premium_field_data();
    $epofw_is_premium_timepicker = $epofw_prem_data_timepicker['is_premium'];
    $epofw_current_time_format = epofw_check_array_key_exists( 'epofw_tf', $epofw_options_data );
    if ( empty( $epofw_current_time_format ) ) {
        $epofw_current_time_format = 'hh:mm tt';
        // Default 12-hour format.
    }
    // Time format options for display.
    $epofw_time_format_options = ( $epofw_is_premium_timepicker ? epofw_field_time_format_data__premium_only() : array(
        'hh:mm tt' => __( '12-hour (hh:mm AM/PM)', 'extra-product-options-for-woocommerce' ),
        'HH:mm'    => __( '24-hour (HH:mm)', 'extra-product-options-for-woocommerce' ),
    ) );
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_timepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_time_format"><?php 
    esc_html_e( 'Time Display Format', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_timepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose how time values are displayed to customers on the frontend. The 12-hour format (AM/PM) is more familiar to most users, while the 24-hour format provides precise military time notation. Select the format that best matches your target audience and business requirements.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select 
				<?php 
    ?>
				id="field_time_format" class="epofw-form-control epofw_time_format"<?php 
    echo esc_attr( $epofw_prem_data_timepicker['disabled'] );
    ?>>
					<?php 
    foreach ( $epofw_time_format_options as $epofw_key => $epofw_value ) {
        ?>
						<option value="<?php 
        echo esc_attr( $epofw_key );
        ?>" <?php 
        selected( $epofw_current_time_format, $epofw_key );
        ?>><?php 
        echo esc_html( $epofw_value );
        ?></option>
						<?php 
    }
    ?>
				</select>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_timepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_min_time"><?php 
    esc_html_e( 'Earliest Available Time', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_timepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the earliest time that customers can select from the timepicker. This establishes a lower boundary for time selection and helps prevent customers from choosing times outside your business hours or availability window.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="time" 
				<?php 
    ?>
				id="field_min_time" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'epofw_mint', $epofw_options_data ) );
    ?>" class="epofw-form-control epofw_min_time_timepicker epofw-time-input" placeholder="<?php 
    esc_attr_e( 'e.g., 09:00 or 08:30', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_timepicker['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_timepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_max_time"><?php 
    esc_html_e( 'Latest Available Time', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_timepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the latest time that customers can select from the timepicker. This establishes an upper boundary for time selection and helps ensure customers only choose times within your business hours or service availability period.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="time" 
				<?php 
    ?>
				id="field_max_time" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'epofw_maxt', $epofw_options_data ) );
    ?>" class="epofw-form-control epofw_max_time_timepicker epofw-time-input" placeholder="<?php 
    esc_attr_e( 'e.g., 17:00 or 18:30', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_timepicker['disabled'] );
    ?>>
			</div>
		</div>

		<?php 
    $epofw_min_hour_value = epofw_check_array_key_exists( 'epofw_minh', $epofw_options_data );
    // Ensure the value is within valid range (0-23).
    if ( '' !== $epofw_min_hour_value && (!is_numeric( $epofw_min_hour_value ) || $epofw_min_hour_value < 0 || $epofw_min_hour_value > 23) ) {
        $epofw_min_hour_value = '';
    }
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_timepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_min_hour"><?php 
    esc_html_e( 'Earliest Available Hour', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_timepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the earliest hour (0-23) that customers can select for time-based services. This provides granular control over time restrictions and helps manage scheduling constraints. Use this when you need more precise control than the full time picker. Valid range: 0 (midnight) to 23 (11 PM).', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="field_min_hour" value="<?php 
    echo esc_attr( $epofw_min_hour_value );
    ?>" class="epofw-form-control epofw_min_hour_timepicker" placeholder="<?php 
    esc_attr_e( 'e.g., 8, 9, or 10 (0-23)', 'extra-product-options-for-woocommerce' );
    ?>" min="0" max="23"<?php 
    echo esc_attr( $epofw_prem_data_timepicker['disabled'] );
    ?>>
			</div>
		</div>

		<?php 
    $epofw_max_hour_value = epofw_check_array_key_exists( 'epofw_maxh', $epofw_options_data );
    // Ensure the value is within valid range (0-23).
    if ( '' !== $epofw_max_hour_value && (!is_numeric( $epofw_max_hour_value ) || $epofw_max_hour_value < 0 || $epofw_max_hour_value > 23) ) {
        $epofw_max_hour_value = '';
    }
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_timepicker['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_max_hour"><?php 
    esc_html_e( 'Latest Available Hour', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_timepicker['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the latest hour (0-23) that customers can select for time-based services. This provides granular control over time restrictions and helps manage scheduling constraints. Use this when you need more precise control than the full time picker. Valid range: 0 (midnight) to 23 (11 PM).', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="field_max_hour" value="<?php 
    echo esc_attr( $epofw_max_hour_value );
    ?>" class="epofw-form-control epofw_max_hour_timepicker" placeholder="<?php 
    esc_attr_e( 'e.g., 17, 18, or 19 (0-23)', 'extra-product-options-for-woocommerce' );
    ?>" min="0" max="23"<?php 
    echo esc_attr( $epofw_prem_data_timepicker['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'colorpicker' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="colorpicker_default_value"><?php 
    esc_html_e( 'Default Color', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the initial color that will appear in the color picker when the page loads. This provides a starting point for customers and can improve user experience by pre-selecting a sensible default color.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="color" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="colorpicker_default_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw-color-input" data-default-color="#ffffff">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_readonly"><?php 
    esc_html_e( 'Readonly Field', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enable this to make the field read-only. Users can see the value but cannot edit it.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][readonly]" id="field_readonly" value="on" <?php 
    checked( epofw_check_array_key_exists( 'readonly', $epofw_general_data ), 'on' );
    ?>>
				<label for="field_readonly" class="toggle-switch"></label>
			</div>
		</div>
		<?php 
} elseif ( 'slider' === $epofw_field_type ) {
    $epofw_prem_data_slider = epofw_get_premium_field_data();
    $epofw_slider_mode = epofw_check_array_key_exists( 'slider_mode', $epofw_general_data );
    if ( empty( $epofw_slider_mode ) ) {
        $epofw_slider_mode = 'single';
    }
    $epofw_slider_mode = 'single';
    $epofw_default_min_value = epofw_check_array_key_exists( 'default_min_value', $epofw_general_data );
    $epofw_default_max_value = epofw_check_array_key_exists( 'default_max_value', $epofw_general_data );
    $epofw_slider_range_pricing_strategy = epofw_check_array_key_exists( 'slider_range_pricing_strategy', $epofw_general_data );
    if ( empty( $epofw_slider_range_pricing_strategy ) ) {
        $epofw_slider_range_pricing_strategy = 'max';
    }
    $epofw_allowed_range_pricing_strategies = array('max', 'min', 'spread');
    if ( !in_array( $epofw_slider_range_pricing_strategy, $epofw_allowed_range_pricing_strategies, true ) ) {
        $epofw_slider_range_pricing_strategy = 'max';
    }
    $epofw_slider_range_pricing_strategy = 'max';
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_slider_mode"><?php 
    esc_html_e( 'Slider Mode', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Single-handle mode is available in Free. Dual-handle (min/max range) is a Pro feature.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][slider_mode]" id="field_slider_mode" class="epofw-form-control epofw-slider-mode">
					<option value="single" <?php 
    selected( $epofw_slider_mode, 'single' );
    ?>><?php 
    esc_html_e( 'Single Handle', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="range" <?php 
    selected( $epofw_slider_mode, 'range' );
    ?>
						<?php 
    echo 'disabled';
    ?>
						>
						<?php 
    esc_html_e( 'Dual Handle (Min/Max) (PRO)', 'extra-product-options-for-woocommerce' );
    ?>
					</option>
				</select>
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_min_value"><?php 
    esc_html_e( 'Minimum Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the lowest value that customers can select using the slider. This establishes the starting point of the range and helps define the scope of available options. Choose a value that makes sense for your product (e.g., 0 for quantities, 1 for minimum orders, or any relevant starting point).', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][min_value]" id="field_min_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'min_value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw_min_value_slider" placeholder="<?php 
    esc_attr_e( 'e.g., 0, 1, or 10', 'extra-product-options-for-woocommerce' );
    ?>" min="0">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_max_value"><?php 
    esc_html_e( 'Maximum Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the highest value that customers can select using the slider. This defines the upper limit of the range and should be reasonable for your product context. Consider factors like inventory limits, practical usage, or business constraints when setting this value.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][max_value]" id="field_max_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'max_value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw_max_value_slider" placeholder="<?php 
    esc_attr_e( 'e.g., 100, 1000, or 50', 'extra-product-options-for-woocommerce' );
    ?>" min="1">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_step_value"><?php 
    esc_html_e( 'Step Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Define the increment value between each step on the slider. This determines how much the value changes when customers move the slider. Smaller step values provide more precise control, while larger steps offer quicker selection. Choose a value that balances precision with usability.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>

			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][step_value]" id="field_step_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'step_value', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw_step_value_slider" placeholder="<?php 
    esc_attr_e( 'e.g., 1, 5, 10, or 0.1', 'extra-product-options-for-woocommerce' );
    ?>" min="0.01" step="0.01">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="field_default_value"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the initial position of the slider when the page loads. This value should be within your minimum and maximum range and represent a sensible starting point for customers. A well-chosen default value can improve user experience by reducing the need for customers to adjust the slider.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    // Check for default_value first (for backward compatibility), then fall back to value (new format).
    $epofw_default_value = epofw_check_array_key_exists( 'default_value', $epofw_general_data );
    if ( empty( $epofw_default_value ) ) {
        $epofw_default_value = epofw_check_array_key_exists( 'value', $epofw_general_data );
    }
    ?>
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="field_default_value" value="<?php 
    echo esc_attr( $epofw_default_value );
    ?>" class="epofw-form-control epofw_default_value_slider" placeholder="<?php 
    esc_attr_e( 'e.g., 5, 25, or 50', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group epofw-slider-range-defaults <?php 
    echo ( 'range' === $epofw_slider_mode ? '' : 'epofw-hidden' );
    echo esc_attr( $epofw_prem_data_slider['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_default_min_value"><?php 
    esc_html_e( 'Default Range (Min)', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_slider['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Default minimum handle value for dual range slider.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number"
				<?php 
    ?>
				id="field_default_min_value" value="<?php 
    echo esc_attr( $epofw_default_min_value );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., 10', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_slider['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group epofw-slider-range-defaults <?php 
    echo ( 'range' === $epofw_slider_mode ? '' : 'epofw-hidden' );
    echo esc_attr( $epofw_prem_data_slider['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_default_max_value"><?php 
    esc_html_e( 'Default Range (Max)', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_slider['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Default maximum handle value for dual range slider.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number"
				<?php 
    ?>
				id="field_default_max_value" value="<?php 
    echo esc_attr( $epofw_default_max_value );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., 90', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_slider['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group epofw-slider-range-defaults <?php 
    echo ( 'range' === $epofw_slider_mode ? '' : 'epofw-hidden' );
    echo esc_attr( $epofw_prem_data_slider['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="field_slider_range_pricing_strategy"><?php 
    esc_html_e( 'Range Pricing Strategy', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_slider['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Controls how “Price Per Step” is calculated for dual-handle sliders: based on max handle, min handle, or spread.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select
				<?php 
    ?>
				id="field_slider_range_pricing_strategy" class="epofw-form-control epofw-slider-range-pricing-strategy"<?php 
    echo esc_attr( $epofw_prem_data_slider['disabled'] );
    ?>>
					<option value="max" <?php 
    selected( $epofw_slider_range_pricing_strategy, 'max' );
    ?>><?php 
    esc_html_e( 'Based on Max Handle', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="min" <?php 
    selected( $epofw_slider_range_pricing_strategy, 'min' );
    ?>><?php 
    esc_html_e( 'Based on Min Handle', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="spread" <?php 
    selected( $epofw_slider_range_pricing_strategy, 'spread' );
    ?>><?php 
    esc_html_e( 'Based on Spread (Max - Min)', 'extra-product-options-for-woocommerce' );
    ?></option>
				</select>
			</div>
		</div>
		<script type="text/javascript">
		jQuery( function( $ ) {
			$( document ).off( 'change.epofwSliderMode' ).on( 'change.epofwSliderMode', '.epofw-slider-mode', function() {
				var isRange = $( this ).val() === 'range';
				var $tab = $( this ).closest( '.epofw-tab-content' );
				$tab.find( '.epofw-slider-range-defaults' ).toggleClass( 'epofw-hidden', ! isRange );
			} );
		} );
		</script>
		<?php 
} elseif ( 'switch' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="switch_default_value"><?php 
    esc_html_e( 'Default State', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the initial state of the switch when the page loads. When enabled, the switch will appear in the "on" position by default. This is useful for pre-selecting common options or highlighting recommended choices for customers.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="switch_default_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control" <?php 
    checked( epofw_check_array_key_exists( 'value', $epofw_general_data ), 'on' );
    ?>>
				<label for="switch_default_value" class="toggle-switch"></label>
			</div>
		</div>

		<?php 
    // Premium helper for switch.
    $epofw_prem_data_switch = epofw_get_premium_field_data();
    $epofw_is_premium_switch = $epofw_prem_data_switch['is_premium'];
    $epofw_current_switch_layout = epofw_check_array_key_exists( 'switch_layout', $epofw_general_data );
    if ( empty( $epofw_current_switch_layout ) ) {
        $epofw_current_switch_layout = 'default';
    }
    $epofw_current_switch_animation = epofw_check_array_key_exists( 'switch_animation', $epofw_general_data );
    if ( empty( $epofw_current_switch_animation ) ) {
        $epofw_current_switch_animation = 'none';
    }
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_checked_icon"><?php 
    esc_html_e( 'Active State Icon', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose an icon to display when the switch is in the "on" or active state. This icon helps customers visually understand the current state and adds a professional touch to your interface. Use icons that clearly represent the active state.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<div class="epofw-icon-picker-wrapper" id="epofw-icon-picker-wrapper-0">
					<input type="text" 
					<?php 
    ?>
					id="switch_checked_icon" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'checked_icon', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw-switch-icon-picker epofw-icon-picker" placeholder="<?php 
    esc_attr_e( 'e.g., dashicons-yes, dashicons-check, or custom icon class', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
					<div class="epofw-button-group">
						<button type="button" class="epofw-btn epofw-icon-picker-button" title="<?php 
    esc_attr_e( 'Select Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-edit"></i>
						</button>
						<button type="button" class="epofw-btn" title="<?php 
    esc_attr_e( 'Preview Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-visibility"></i>
						</button>
						<button type="button" class="epofw-btn epofw-btn-remove" title="<?php 
    esc_attr_e( 'Remove Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-no-alt"></i>
						</button>
					</div>
				</div>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_checked_bg_color"><?php 
    esc_html_e( 'Active State Background Color', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Select the background color for the switch when it is in the "on" or active state. This color should provide good contrast with the icon and text to ensure readability. Consider using your brand colors or standard success colors like green.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="color" 
				<?php 
    ?>
				id="switch_checked_bg_color" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'checked_bg_color', $epofw_general_data ) );
    ?>" class="epofw-form-control" data-default-color="#28a745"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_unchecked_icon"><?php 
    esc_html_e( 'Inactive State Icon', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose an icon to display when the switch is in the "off" or inactive state. This icon should clearly indicate the inactive state and complement the active state icon. Use icons that are easily distinguishable from the active state.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<div class="epofw-icon-picker-wrapper" id="epofw-icon-picker-wrapper-1">
					<input type="text" 
					<?php 
    ?>
					id="switch_unchecked_icon" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'unchecked_icon', $epofw_general_data ) );
    ?>" class="epofw-form-control epofw-switch-icon-picker epofw-icon-picker" placeholder="<?php 
    esc_attr_e( 'e.g., dashicons-no, dashicons-minus, or custom icon class', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
					<div class="epofw-button-group">
						<button type="button" class="epofw-btn epofw-icon-picker-button" title="<?php 
    esc_attr_e( 'Select Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-edit"></i>
						</button>
						<button type="button" class="epofw-btn" title="<?php 
    esc_attr_e( 'Preview Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-visibility"></i>
						</button>
						<button type="button" class="epofw-btn epofw-btn-remove" title="<?php 
    esc_attr_e( 'Remove Icon', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
							<i class="dashicons dashicons-no-alt"></i>
						</button>
					</div>
				</div>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_unchecked_bg_color"><?php 
    esc_html_e( 'Inactive State Background Color', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Select the background color for the switch when it is in the "off" or inactive state. This color should provide good contrast and clearly differentiate from the active state. Consider using neutral colors like gray or your brand\'s secondary colors.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="color" 
				<?php 
    ?>
				id="switch_unchecked_bg_color" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'unchecked_bg_color', $epofw_general_data ) );
    ?>" class="epofw-form-control" data-default-color="#6c757d"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_layout"><?php 
    esc_html_e( 'Switch Design Style', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose the visual design style for your switch. The default style provides a traditional toggle appearance, while the square style offers a more modern, geometric look. Select the style that best matches your overall design aesthetic and brand identity.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select 
				<?php 
    ?>
				id="switch_layout" class="epofw-form-control epofw-switch-layout"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
					<option value="default" <?php 
    selected( $epofw_current_switch_layout, 'default' );
    ?>><?php 
    esc_html_e( 'Default (Rounded)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="square" <?php 
    selected( $epofw_current_switch_layout, 'square' );
    ?>><?php 
    esc_html_e( 'Square (Modern)', 'extra-product-options-for-woocommerce' );
    ?></option>
				</select>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_switch['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="switch_animation"><?php 
    esc_html_e( 'Transition Animation', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_switch['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Select the animation style that occurs when the switch transitions between states. Smooth animations provide a polished user experience, while more dynamic animations like bounce or elastic can add personality to your interface. Choose based on your brand\'s style and user experience preferences.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<select 
				<?php 
    ?>
				id="switch_animation" class="epofw-form-control epofw-switch-animation"<?php 
    echo esc_attr( $epofw_prem_data_switch['disabled'] );
    ?>>
					<option value="none" <?php 
    selected( $epofw_current_switch_animation, 'none' );
    ?>><?php 
    esc_html_e( 'None (Instant)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="smooth" <?php 
    selected( $epofw_current_switch_animation, 'smooth' );
    ?>><?php 
    esc_html_e( 'Smooth (Professional)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="bounce" <?php 
    selected( $epofw_current_switch_animation, 'bounce' );
    ?>><?php 
    esc_html_e( 'Bounce (Playful)', 'extra-product-options-for-woocommerce' );
    ?></option>
					<option value="elastic" <?php 
    selected( $epofw_current_switch_animation, 'elastic' );
    ?>><?php 
    esc_html_e( 'Elastic (Dynamic)', 'extra-product-options-for-woocommerce' );
    ?></option>
				</select>
			</div>
		</div>
		<?php 
} elseif ( 'heading' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="heading_title"><?php 
    esc_html_e( 'Heading Title', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter the main heading text that will be displayed prominently on your product page. This heading serves as a section title or category label to organize and structure your product information. Use clear, descriptive language that helps customers navigate your content.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[label][title]" id="heading_title" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'title', $epofw_label_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Product Features, Specifications, or Important Information', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="heading_type"><?php 
    esc_html_e( 'Heading Level', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose the HTML heading level (H1, H2, H3, etc.) for this heading. Higher levels (H1, H2) are more prominent and typically used for main section titles, while lower levels (H3, H4) are used for subsections. This affects both visual hierarchy and SEO structure.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    $epofw_heading_type_options = epofw_field_heading_type_options_data();
    $epofw_current_heading_type = epofw_check_array_key_exists( 'heading_type', $epofw_general_data );
    if ( empty( $epofw_current_heading_type ) && !empty( $epofw_heading_type_options ) ) {
        $epofw_current_heading_type = array_key_first( $epofw_heading_type_options );
        // Default to first option.
    }
    ?>
				<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][heading_type]" id="heading_type" class="epofw-form-control epofw-heading-type">
					<?php 
    foreach ( $epofw_heading_type_options as $epofw_key => $epofw_value ) {
        ?>
						<option value="<?php 
        echo esc_attr( $epofw_key );
        ?>" <?php 
        selected( $epofw_current_heading_type, $epofw_key );
        ?>><?php 
        echo esc_html( $epofw_value );
        ?></option>
						<?php 
    }
    ?>
				</select>
			</div>
		</div>

		<?php 
    // Premium helper for heading.
    $epofw_prem_data_heading = epofw_get_premium_field_data();
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_heading['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="heading_color"><?php 
    esc_html_e( 'Heading Color', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_heading['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Select a custom color for this heading to match your brand or design theme. The color will be applied to the heading text and can help create visual hierarchy, improve readability, or maintain consistency with your overall page design. Leave empty to use the default theme color.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="color" 
				<?php 
    ?>
				id="heading_color" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'heading_color', $epofw_general_data ) );
    ?>" class="epofw-form-control" data-default-color="#333333"<?php 
    echo esc_attr( $epofw_prem_data_heading['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'paragraph' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="paragraph_title"><?php 
    esc_html_e( 'Paragraph Title', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter a descriptive title for this paragraph section. This title will be displayed prominently above the content to help customers understand what information follows. Keep it concise but informative.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[label][title]" id="paragraph_title" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'title', $epofw_label_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Product Information, Important Notes, or Instructions', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="paragraph_content_type"><?php 
    esc_html_e( 'Content Type', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Choose how the content should be displayed and formatted. Different content types offer various styling options and may affect how customers interact with the information. Select the type that best suits your content purpose.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<?php 
    $epofw_content_type_options = epofw_field_content_type_options_data();
    $epofw_current_content_type = epofw_check_array_key_exists( 'content_type', $epofw_general_data );
    if ( empty( $epofw_current_content_type ) && !empty( $epofw_content_type_options ) ) {
        $epofw_current_content_type = array_key_first( $epofw_content_type_options );
        // Default to first option.
    }
    ?>
				<select name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][content_type]" id="paragraph_content_type" class="epofw-form-control epofw-content-type">
					<?php 
    foreach ( $epofw_content_type_options as $epofw_key => $epofw_value ) {
        ?>
						<option value="<?php 
        echo esc_attr( $epofw_key );
        ?>" <?php 
        selected( $epofw_current_content_type, $epofw_key );
        ?>><?php 
        echo esc_html( $epofw_value );
        ?></option>
						<?php 
    }
    ?>
				</select>
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="paragraph_content"><?php 
    esc_html_e( 'Paragraph Content', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter the main content for this paragraph section. This can include product descriptions, instructions, terms and conditions, or any other information you want to display to customers. Use clear, concise language and consider formatting for readability.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<textarea name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][content]" id="paragraph_content" class="epofw-form-control" rows="6" placeholder="<?php 
    esc_attr_e( 'Enter your paragraph content here...', 'extra-product-options-for-woocommerce' );
    ?>"><?php 
    echo esc_textarea( epofw_check_array_key_exists( 'content', $epofw_general_data ) );
    ?></textarea>
			</div>
		</div>

		<?php 
    // Premium helper for paragraph.
    $epofw_prem_data_paragraph = epofw_get_premium_field_data();
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_paragraph['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="paragraph_color"><?php 
    esc_html_e( 'Paragraph Color', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_paragraph['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Select a custom color for this paragraph text to match your brand or design theme. The color will be applied to the paragraph content and can help create visual hierarchy, improve readability, or maintain consistency with your overall page design. Leave empty to use the default theme color.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="color" 
				<?php 
    ?>
				id="paragraph_color" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'paragraph_color', $epofw_general_data ) );
    ?>" class="epofw-form-control" data-default-color="#333333"<?php 
    echo esc_attr( $epofw_prem_data_paragraph['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'file' === $epofw_field_type || 'fileupload' === $epofw_field_type ) {
    // Premium helper for file upload.
    $epofw_prem_data_file = epofw_get_premium_field_data();
    ?>
		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_file['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="file_ajax_upload"><?php 
    esc_html_e( 'Enable AJAX File Upload', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_file['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enable AJAX file upload for better user experience. Files will be uploaded immediately when selected, without requiring form submission. This provides instant feedback and progress indication.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" 
				<?php 
    ?>
				id="file_ajax_upload" class="epofw-form-control" <?php 
    checked( epofw_check_array_key_exists( 'epofw_fau', $epofw_options_data ), 'on' );
    echo esc_attr( $epofw_prem_data_file['disabled'] );
    ?>>
				<label for="file_ajax_upload" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_file['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="file_ajax_multiple_upload"><?php 
    esc_html_e( 'Allow Multiple File Uploads', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_file['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Allow customers to select and upload multiple files simultaneously. When enabled, users can choose several files at once or add files one by one. Useful for document collections, image galleries, or bulk file submissions.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="checkbox" 
				<?php 
    ?>
				id="file_ajax_multiple_upload" class="epofw-form-control" <?php 
    checked( epofw_check_array_key_exists( 'epofw_fmul', $epofw_options_data ), 'on' );
    echo esc_attr( $epofw_prem_data_file['disabled'] );
    ?>>
				<label for="file_ajax_multiple_upload" class="toggle-switch"></label>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_file['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="file_min_size"><?php 
    esc_html_e( 'Minimum File Size (KB)', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_file['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the minimum file size required for uploads. Files smaller than this size will be rejected. Use this to ensure uploaded files contain sufficient content. Example: 10 for 10KB minimum file size.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="file_min_size" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'minsize', $epofw_options_data ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'Enter minimum file size in KB (e.g., 10)', 'extra-product-options-for-woocommerce' );
    ?>" min="0"<?php 
    echo esc_attr( $epofw_prem_data_file['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_file['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="file_max_size"><?php 
    esc_html_e( 'Maximum File Size (KB)', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_file['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the maximum file size allowed for uploads. Files larger than this size will be rejected. This helps control server storage usage and upload times. Example: 2048 for 2MB maximum file size. Note: Server limits may override this setting.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" 
				<?php 
    ?>
				id="file_max_size" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'maxsize', $epofw_options_data ) );
    ?>" class="epofw-form-control default_num_class" placeholder="<?php 
    esc_attr_e( 'Enter maximum file size in KB (e.g., 2048 for 2MB)', 'extra-product-options-for-woocommerce' );
    ?>" min="1"<?php 
    echo esc_attr( $epofw_prem_data_file['disabled'] );
    ?>>
			</div>
		</div>

		<div class="epofw-form-group<?php 
    echo esc_attr( $epofw_prem_data_file['class'] );
    ?>">
			<div class="epofw-field-label">
				<label for="file_extension"><?php 
    esc_html_e( 'Allowed File Extensions', 'extra-product-options-for-woocommerce' );
    echo wp_kses( $epofw_prem_data_file['badge'], epofw_get_badge_allowed_html() );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Specify which file types are allowed for upload. Enter file extensions separated by commas (without dots). This helps ensure security and file compatibility. Examples: jpg,jpeg,png', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" 
				<?php 
    ?>
				id="file_extension" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'extension', $epofw_options_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., jpg,png', 'extra-product-options-for-woocommerce' );
    ?>"<?php 
    echo esc_attr( $epofw_prem_data_file['disabled'] );
    ?>>
			</div>
		</div>
		<?php 
} elseif ( 'hidden' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="hidden_title"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter the default value for this hidden field. This value will be displayed to customers when the field is viewed on the frontend.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="hidden_title" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Default Value', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>
		<?php 
} elseif ( 'password' === $epofw_field_type ) {
    ?>
		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="password_value"><?php 
    esc_html_e( 'Default Value', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Enter the default value for this password field. This value will be displayed to customers when the field is viewed on the frontend.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][value]" id="password_value" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'value', $epofw_general_data ) );
    ?>" class="epofw-form-control" placeholder="<?php 
    esc_attr_e( 'e.g., Default Value', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="password_placeholder"><?php 
    esc_html_e( 'Placeholder', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Show the password field to customers. This option allows customers to view the password they entered.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="text" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][placeholder]" id="password_placeholder" class="epofw-form-control" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'placeholder', $epofw_general_data ) );
    ?>" placeholder="<?php 
    esc_attr_e( 'e.g., Enter your password', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>

		<div class="epofw-form-group">
			<div class="epofw-field-label">
				<label for="password_maxlength"><?php 
    esc_html_e( 'Max Length', 'extra-product-options-for-woocommerce' );
    ?></label>
				<div class="epofw-field-description">
					<?php 
    esc_html_e( 'Set the maximum length for the password field. This option allows customers to enter a password of a specific length.', 'extra-product-options-for-woocommerce' );
    ?>
				</div>
			</div>
			<div class="epofw-field-input">
				<input type="number" name="<?php 
    echo esc_attr( $epofw_field_name_prefix );
    ?>[field][maxlength]" id="password_maxlength" class="epofw-form-control" value="<?php 
    echo esc_attr( epofw_check_array_key_exists( 'maxlength', $epofw_general_data ) );
    ?>" placeholder="<?php 
    esc_attr_e( 'e.g., 10', 'extra-product-options-for-woocommerce' );
    ?>">
			</div>
		</div>
		<?php 
}
?>

</div>
