<?php
$menu_id           = $args['$menu_id'];
$settings          = $args['$settings'];
$align             = $settings['align'];
$position = $settings['position'];
$layout_hide_title = $settings['layout_hide_title'] ? true : false;
?>

<div class="sparta-wrapper-mega-menu">
    <div class="field-sparta-icons description">
        <label>Menu Item Icon</label>
        <div class="sparta-field sparta-field-icon <?php if ( empty( $settings['icon'] ) )
			echo esc_attr( 'sparta-field-empty' ) ?>">
            <div class="sparta-icon-selector">
                <div class="choose sparta-open-modal" data-modal="#sparta-megamenu-choose-icons">
					<span class="sparta-preview-icon">
						<?php if ( ! empty( $settings['icon'] ) ): ?>
                            <i class="<?php echo esc_attr( $settings['icon'] ); ?>"></i>
						<?php endif; ?>
					</span>
                    <span class="label">Choose Icon</span>
                </div>
                <span class="sparta-remove"></span>
                <input type="hidden" class="input-icon" value="<?php echo esc_attr( $settings['icon'] ) ?>" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][icon]">
            </div>
        </div>
    </div>

    <div class="field-sparta-sub-align description">
        <label>Menu Item Alignment</label>
        <div class="sparta-field">
            <label>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][align]" value="left" <?php checked( $align, 'left' ) ?>>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][align]" value="right" <?php checked( $align, 'right' ) ?>>
            </label>
        </div>
    </div>
    <div class="wp-clearfix"></div>
    <div class="field-sparta-sub-position description">
        <label>Custom Position Sub Menu</label>
        <div class="sparta-field">
            <label>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][position]" value="default" <?php checked( $position, 'default' ) ?>>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][position]" value="left" <?php checked( $position, 'left' ) ?>>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][position]" value="center" <?php checked( $position, 'center' ) ?>>
                <input type="radio" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][position]" value="right" <?php checked( $position, 'right' ) ?>>
            </label>
        </div>
    </div>

    <div class="wp-clearfix"></div>

    <div class="field-sparta-mega-menu description" data-type="<?php echo esc_attr( $settings['layout'] ) ?>" id="sparta-mega-menu-item-<?php echo esc_attr( $menu_id ) ?>">
        <div class="sparta-menu-extra-field">
            <label>Select Menu Type</label>
            <div class="sparta-field sparta-field-layout">
                <div class="sparta-row">
                    <div class="sparta-col-50">
                        <select title="Type layout" class="sparta-field-type-layout" id="sparta-mega-menu-type-<?php echo esc_attr( $menu_id ) ?>" name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][layout]">
                            <option value="default" <?php selected( 'default', $settings['layout'] ) ?>>Layout Default</option>
                            <option value="column" <?php selected( 'column', $settings['layout'] ) ?>>Layout Columns</option>

                        </select>
                    </div>
                    <div class="sparta-col-50">
                        <label class="sparta-layout-hide-title sparta-hide">
                            <input type="checkbox" <?php checked( true, $layout_hide_title ) ?>
                                   name="sparta-mega-menu[<?php echo esc_attr( $menu_id ) ?>][layout_hide_title]">
                            Hide column title?
                        </label>
                    </div>
                </div>

                <div class="sparta-waring-builder sparta-hide"><?php esc_html_e( 'Content in layout builder will override sub-items', 'sparta' ) ?></div>
            </div>
        </div>
    </div>
</div>