<?php



use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if (!defined('ABSPATH')) exit; // Exit if accessed directly


class Productscarouselsecondstkaveh extends Widget_Base{

  public function get_name(){
    return 'productscarouselsecondstkaveh';
  }
 
  public function get_title(){
    return esc_html__( 'Products Carousel Style Two', 'kavehTheme' );
  }

  public function get_icon(){
    return 'eicon-archive-posts';
  }

  public function get_categories(){
    return ['kavehelements'];
  }
 
  protected function register_controls(){
    
    $this->start_controls_section(
        'contentproductscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Title Settings', 'kavehTheme' ),
                  'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
   
      $this->add_control(
          'titleproductscarouselsecondstkaveh',
          [
              'label' => esc_html__( 'Title', 'kavehTheme' ),
              'type' => \Elementor\Controls_Manager::TEXT,
              'default' => esc_html__( 'Best Selling Products', 'kavehTheme' ),
      
          ]
      );
      $this->add_control(
        'tagheadingproductscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Title Tag', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'H3',
          'options' => [
            'H1'  => esc_html__( 'H1', 'kavehTheme' ),
            'H2' => esc_html__( 'H2', 'kavehTheme' ),
            'H3' => esc_html__( 'H3', 'kavehTheme' ),
            'H4' => esc_html__( 'H4', 'kavehTheme' ),
            'H5' => esc_html__( 'H5', 'kavehTheme' ),
            'H6' => esc_html__( 'H6', 'kavehTheme' ),
            'p' => esc_html__( 'p', 'kavehTheme' ),
            'div' => esc_html__( 'div', 'kavehTheme' ),
            'span' => esc_html__( 'span', 'kavehTheme' ),
          ],
        ]
      );
  $this->end_controls_section();
  $this->start_controls_section(
    'content2productscarouselsecondstkaveh',
    [
      'label' => esc_html__( 'Product Settings', 'kavehTheme' ),
              'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
  );
  $this->add_control(
    'stylecartproductscarouselsecondstkaveh',
    [
      'label' => esc_html__( 'Product Box Layout', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SELECT,
      'default' => 'one',
        'options' => [
          'one'  => esc_html__( 'First Layout', 'kavehTheme' ),
          'two'  => esc_html__( 'Second Layout', 'kavehTheme' ),
          'three'  => esc_html__( 'Third Layout', 'kavehTheme' ),
          'four'  => esc_html__( 'Fourth Layout', 'kavehTheme' ),
          'five'  => esc_html__( 'Fifth Layout', 'kavehTheme' ),
          'six'  => esc_html__( 'Sixth Layout', 'kavehTheme' ),
          'seven'  => esc_html__( 'Seventh Layout', 'kavehTheme' ),
          'eight'  => esc_html__( 'Eighth Layout', 'kavehTheme' ),
          'nine'  => esc_html__( 'Ninth Layout', 'kavehTheme' ),
          'ten'  => esc_html__( 'Tenth Layout', 'kavehTheme' ),
          'eleven'  => esc_html__( 'Eleventh Layout', 'kavehTheme' ),
          'twelve'  => esc_html__( 'Twelfth Layout', 'kavehTheme' ),
          'thirteen'  => esc_html__( 'Thirteenth Layout', 'kavehTheme' ),
          'fourteen'  => esc_html__( 'Fourteenth Layout', 'kavehTheme' ),
          'fifteen'  => esc_html__( 'Fifteenth Layout', 'kavehTheme' ),
          'sixteen'  => esc_html__( 'Sixteenth Layout', 'kavehTheme' ),
          'seventeen'  => esc_html__( 'Seventeenth Layout', 'kavehTheme' ),
          'eighteen'  => esc_html__( 'Eighteenth Layout', 'kavehTheme' ),
          'nineteen'  => esc_html__( 'Nineteenth Layout', 'kavehTheme' ),
          'twenty'  => esc_html__( 'Twentieth Layout', 'kavehTheme' ),
          'twenty-one'  => esc_html__( 'Twenty-First Layout', 'kavehTheme' ),
          'twenty-two'  => esc_html__( 'Twenty-Second Layout', 'kavehTheme' ),
          'twenty-three'  => esc_html__( 'Twenty-Third Layout', 'kavehTheme' ),
          'twenty-four'  => esc_html__( 'Twenty-Fourth Layout', 'kavehTheme' ),
          'twenty-five'  => esc_html__( 'Twenty-Fifth Layout', 'kavehTheme' ),
          'twenty-six'  => esc_html__( 'Twenty-Sixth Layout', 'kavehTheme' ),
          'twenty-seven'  => esc_html__( 'Twenty-Seventh Layout', 'kavehTheme' ),
          'twenty-eight'  => esc_html__( 'Twenty-Eighth Layout', 'kavehTheme' ),
        ],
    ]
    );

    $this->add_control(
      'pproductscarouselsecondstkaveh',
      [
        'label' => esc_html__( 'Display Products', 'kavehTheme' ),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'all',
        'options' => [
          'all'  => esc_html__( 'All', 'kavehTheme' ),
          'cat'  => esc_html__( 'Category', 'kavehTheme' ),
  
        ],
      ]
      );
      $this->add_control(
        'kaveh_exclude_out_of_stock',
        [
          'label' => esc_html__( 'Hide Out of Stock Products', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SWITCHER,
          'yes' => esc_html__( 'Yes', 'kavehTheme' ),
          'no' => esc_html__( 'No', 'kavehTheme' ),
          'return_value' => 'yes',
          'default' => 'yes',
        ]
      );
      $this->add_control(
        'psortproductscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Sort Products By', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'date',
          'options' => [
            'date'  => esc_html__( 'Date', 'kavehTheme' ),
            '_price'  => esc_html__( 'Price', 'kavehTheme' ),
            '_wc_average_rating'  => esc_html__( 'Most Popular', 'kavehTheme' ),
            'total_sales'  => esc_html__( 'Sales Volume', 'kavehTheme' ),
    
          ],
        ]
        );
        $this->add_control(
          'psortiproductscarouselsecondstkaveh',
          [
            'label' => esc_html__( 'Sort Order', 'kavehTheme' ),
            'type' => \Elementor\Controls_Manager::SELECT,
            'default' => 'desc',
            'options' => [
              'asc'  => esc_html__( 'Ascending', 'kavehTheme' ),
              'desc'  => esc_html__( 'Descending', 'kavehTheme' ),
            ],
          ]
          );
  $options2 = array();
$orderby = 'name';
$order = 'asc';
$hide_empty = false ;
$cat_args = array(
    'orderby'    => $orderby,
    'order'      => $order,
    'hide_empty' => $hide_empty,
);

$product_categories = get_terms( 'product_cat', $cat_args );

foreach ( $product_categories as $key => $category ) {
    $options2[$category->term_id] = $category->name;
}
$this->add_control(
    'catproductscarouselsecondstkaveh',
    [
      'label' => esc_html__( 'Select Category', 'kavehTheme' ),
      'type' => \Elementor\Controls_Manager::SELECT2, 
      'multiple' => true,
      'options' => $options2,
      'condition' => [
        'pproductscarouselsecondstkaveh' => 'cat',
      ],
    ]
);
$this->end_controls_section();
$this->start_controls_section(
  'content3productscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Carousel Settings', 'kavehTheme' ),
            'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
  ]
);
$this->add_control(
  'productnumberproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Number of Products to Display', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 50,
    'step' => 1,
    'default' => 5,
  ]
);
$this->add_control(
  'productcolumnproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Desktop', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 4,

  ]
);
$this->add_control(
  'productcolumn2productscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Tablet', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 3,

  ]
);
$this->add_control(
  'productcolumn3productscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Number of Product Columns on Mobile', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 0,
    'max' => 5,
    'step' => 1,
    'default' => 1,

  ]
); 

// Autoplay settings
$this->add_control(
  'autoplayproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Enable Autoplay', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);

$this->add_control(
  'autoplaydelayproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Autoplay Delay (milliseconds)', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 1000,
    'max' => 10000,
    'step' => 500,
    'default' => 3000,
    'condition' => [
      'autoplayproductscarouselsecondstkaveh' => 'yes',
    ],
  ]
);

$this->add_control(
  'pauseonhoverproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Pause on Hover', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'yes',
    'condition' => [
      'autoplayproductscarouselsecondstkaveh' => 'yes',
    ],
  ]
);

// Loop settings
$this->add_control(
  'loopproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Infinite Loop', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'yes',
  ]
);

// Speed settings
$this->add_control(
  'speedproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Transition Speed (milliseconds)', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::NUMBER,
    'min' => 300,
    'max' => 3000,
    'step' => 100,
    'default' => 300,
  ]
);

// Centered slides
$this->add_control(
  'centeredslidesproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Centered Slides', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);

// Free mode
$this->add_control(
  'freemodeproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Free Mode', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
    'description' => esc_html__( 'Slides move freely', 'kavehTheme' ),
  ]
);

// Effect
$this->add_control(
  'effectproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Transition Effect', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SELECT,
    'default' => 'slide',
    'options' => [
      'slide' => esc_html__( 'Slide', 'kavehTheme' ),
      'fade' => esc_html__( 'Fade', 'kavehTheme' ),
      'cube' => esc_html__( 'Cube', 'kavehTheme' ),
      'coverflow' => esc_html__( 'Coverflow', 'kavehTheme' ),
      'flip' => esc_html__( 'Flip', 'kavehTheme' ),
    ],
  ]
);

// Show arrows
$this->add_control(
  'showarrowproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Show Arrows?', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);

// Pagination dots
$this->add_control(
  'showdotsproductscarouselsecondstkaveh',
  [
    'label' => esc_html__( 'Show Pagination Dots', 'kavehTheme' ),
    'type' => \Elementor\Controls_Manager::SWITCHER,
    'yes' => esc_html__( 'Yes', 'kavehTheme' ),
    'no' => esc_html__( 'No', 'kavehTheme' ),
    'return_value' => 'yes',
    'default' => 'no',
  ]
);
       $this->end_controls_section();
       $this->start_controls_section(
        'style_productscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Title Styles', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'textcolor2productscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Title Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .best-selling-products-title' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'titleproductscarouselsecondstkaveh',
          'label' => esc_html__( 'Title Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .best-selling-products-title',
        ]
      );
      $this->end_controls_section();
      $this->start_controls_section(
        'style3_productscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Background Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'bgcolorproductscarouselsecondstkaveh',
        [
          'label' => esc_html__( 'Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .best-selling-products::before' => 'background-color: {{VALUE}}',
          ],
        ]
      ); 
      $this->end_controls_section();
        }


protected function render(){
  $settings = $this->get_settings_for_display();
  $clsid = $this->get_id();
  
  // Build swiper settings array
  $swiper_settings = array(
    'navigation' => array(
      'nextEl' => '.swiper-button-next',
      'prevEl' => '.swiper-button-prev'
    ),
    'breakpoints' => array(
      320 => array(
        'slidesPerView' => (int)$settings['productcolumn3productscarouselsecondstkaveh'],
        'spaceBetween' => 4
      ),
      500 => array(
        'slidesPerView' => (int)$settings['productcolumn3productscarouselsecondstkaveh'],
        'spaceBetween' => 14
      ),
      768 => array(
        'slidesPerView' => (int)$settings['productcolumn2productscarouselsecondstkaveh'],
        'spaceBetween' => 14
      ),
      992 => array(
        'slidesPerView' => (int)$settings['productcolumnproductscarouselsecondstkaveh'],
        'spaceBetween' => 20
      ),
      1200 => array(
        'slidesPerView' => (int)$settings['productcolumnproductscarouselsecondstkaveh'],
        'spaceBetween' => 31
      )
    )
  );

  // Add optional settings only if they exist and are not default
  if (isset($settings['loopproductscarouselsecondstkaveh']) && $settings['loopproductscarouselsecondstkaveh'] === 'yes') {
    $swiper_settings['loop'] = true;
  }

  if (isset($settings['speedproductscarouselsecondstkaveh']) && !empty($settings['speedproductscarouselsecondstkaveh'])) {
    $swiper_settings['speed'] = (int)$settings['speedproductscarouselsecondstkaveh'];
  }

  if (isset($settings['centeredslidesproductscarouselsecondstkaveh']) && $settings['centeredslidesproductscarouselsecondstkaveh'] === 'yes') {
    $swiper_settings['centeredSlides'] = true;
  }

  if (isset($settings['freemodeproductscarouselsecondstkaveh']) && $settings['freemodeproductscarouselsecondstkaveh'] === 'yes') {
    $swiper_settings['freeMode'] = true;
  }

  if (isset($settings['effectproductscarouselsecondstkaveh']) && $settings['effectproductscarouselsecondstkaveh'] !== 'slide') {
    $swiper_settings['effect'] = $settings['effectproductscarouselsecondstkaveh'];
  }

  // Add autoplay if enabled
  if (isset($settings['autoplayproductscarouselsecondstkaveh']) && $settings['autoplayproductscarouselsecondstkaveh'] === 'yes') {
    $autoplay_settings = array(
      'delay' => isset($settings['autoplaydelayproductscarouselsecondstkaveh']) ? (int)$settings['autoplaydelayproductscarouselsecondstkaveh'] : 3000,
      'disableOnInteraction' => false
    );
    
    if (isset($settings['pauseonhoverproductscarouselsecondstkaveh']) && $settings['pauseonhoverproductscarouselsecondstkaveh'] === 'yes') {
      $autoplay_settings['pauseOnMouseEnter'] = true;
    }
    
    $swiper_settings['autoplay'] = $autoplay_settings;
  }

  // Add pagination if enabled
  if (isset($settings['showdotsproductscarouselsecondstkaveh']) && $settings['showdotsproductscarouselsecondstkaveh'] === 'yes') {
    $swiper_settings['pagination'] = array(
      'el' => '.swiper-pagination',
      'type' => 'bullets',
      'clickable' => true
    );
  }

  // Properly encode and escape JSON
  $swiper_json = wp_json_encode($swiper_settings, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
  ?>

  <section class="best-selling-products position-relative">
    <div class="container">
      <<?php echo esc_attr($settings['tagheadingproductscarouselsecondstkaveh']); ?> class="best-selling-products-title text-center"><?php echo esc_html($settings['titleproductscarouselsecondstkaveh']); ?></<?php echo esc_attr($settings['tagheadingproductscarouselsecondstkaveh']); ?>>
      <div class="swiper swiper-products swiper-shadow overflow-hidden" data-swiper='<?php echo esc_attr($swiper_json); ?>'>
        <div class="swiper-wrapper">
          <?php if('cat'===$settings['pproductscarouselsecondstkaveh']){ ?>
            <?php
            // Define your custom query arguments
            $query_args = array(
              'post_type' => array('product'),
              'post_status' => array('publish'),
              'posts_per_page' => $settings['productnumberproductscarouselsecondstkaveh'],
              'orderby' => $settings['psortproductscarouselsecondstkaveh'] === 'date' ? 'date' : 'meta_value_num',
              'order' => $settings['psortiproductscarouselsecondstkaveh'],
              'tax_query' => array(
                'relation' => 'AND',
                array(
                  'taxonomy' => 'product_cat',
                  'field' => 'term_id',
                  'terms' => $settings['catproductscarouselsecondstkaveh'],
                ),
              ),
            );
            
            // Handle specific orderby values
            switch ($settings['psortproductscarouselsecondstkaveh']) {
              case '_price':
                $query_args['meta_key'] = '_price';
                $query_args['orderby'] = 'meta_value_num';
                break;
              case '_wc_average_rating':
                $query_args['meta_key'] = '_wc_average_rating';
                $query_args['orderby'] = 'meta_value_num';
                break;
              case 'total_sales':
                $query_args['meta_key'] = 'total_sales';
                $query_args['orderby'] = 'meta_value_num';
                break;
            }

            if ("yes" === $settings['kaveh_exclude_out_of_stock']) {
              $query_args['tax_query'][] = array(
                'taxonomy' => 'product_visibility',
                'field' => 'name',
                'terms' => array('outofstock'),
                'operator' => 'NOT IN'
              );
            }
            
            // Get the cached query results
            $cached_query = KavehCustomQuery::get_cached_query($query_args);
            if ($cached_query->have_posts()):
              while ($cached_query->have_posts()):
                $cached_query->the_post();
                ?>
                <div class="swiper-slide h-auto">
                  <?php $styleproduct2 = $settings['stylecartproductscarouselsecondstkaveh']; ?>
                  <?php get_template_part("template-part/product-cart-$styleproduct2"); ?>
                </div>
                <?php
              endwhile;
              wp_reset_postdata();
            else:
              echo 'No posts found.';
            endif;
            ?>
          <?php }elseif('all'===$settings['pproductscarouselsecondstkaveh']){ ?>
            <?php
            // Define your custom query arguments for all products
            $query_args = array(
              'post_type' => array('product'),
              'post_status' => array('publish'),
              'posts_per_page' => $settings['productnumberproductscarouselsecondstkaveh'],
              'orderby' => $settings['psortproductscarouselsecondstkaveh'] === 'date' ? 'date' : 'meta_value_num',
              'order' => $settings['psortiproductscarouselsecondstkaveh'],
              'tax_query' => array('relation' => 'AND'),
            );
            
            // Handle specific orderby values
            switch ($settings['psortproductscarouselsecondstkaveh']) {
              case '_price':
                $query_args['meta_key'] = '_price';
                $query_args['orderby'] = 'meta_value_num';
                break;
              case '_wc_average_rating':
                $query_args['meta_key'] = '_wc_average_rating';
                $query_args['orderby'] = 'meta_value_num';
                break;
              case 'total_sales':
                $query_args['meta_key'] = 'total_sales';
                $query_args['orderby'] = 'meta_value_num';
                break;
            }

            if ("yes" === $settings['kaveh_exclude_out_of_stock']) {
              $query_args['tax_query'][] = array(
                'taxonomy' => 'product_visibility',
                'field' => 'name',
                'terms' => array('outofstock'),
                'operator' => 'NOT IN'
              );
            }
            
            // Get the cached query results
            $cached_query = KavehCustomQuery::get_cached_query($query_args);
            if ($cached_query->have_posts()):
              while ($cached_query->have_posts()):
                $cached_query->the_post();
                ?>
                <div class="swiper-slide h-auto">
                  <?php $styleproduct2 = $settings['stylecartproductscarouselsecondstkaveh']; ?>
                  <?php get_template_part("template-part/product-cart-$styleproduct2"); ?>
                </div>
                <?php
              endwhile;
              wp_reset_postdata();
            else:
              echo 'No posts found.';
            endif;
            ?>
          <?php } ?>
        </div>
        
        <?php if(isset($settings['showdotsproductscarouselsecondstkaveh']) && $settings['showdotsproductscarouselsecondstkaveh'] === 'yes'){ ?>
        <div class="swiper-pagination"></div>
        <?php } ?>
        
        <?php 
        $arrow_class = (isset($settings['showarrowproductscarouselsecondstkaveh']) && $settings['showarrowproductscarouselsecondstkaveh'] === 'yes') ? '' : 'd-none';
        ?>
        <div class="swiper-button-next <?php echo esc_attr($arrow_class); ?>"></div>
        <div class="swiper-button-prev <?php echo esc_attr($arrow_class); ?>"></div>
      </div>
    </div>
  </section>
  
  <style>
    <?php echo '.elementor-element-' . $clsid . ''; ?> .top-sellers-two .swiper::before {
      content: "";
      right: 0;
      bottom: 190px;
      left: 0;
      width: 80%;
      -webkit-border-radius: 50px;
      -moz-border-radius: 50px;
      border-radius: 50px;
      background-color: #ee273a;
      height: 50px;
      margin: 0 auto;
    }
  </style>
  <?php
}

}
