<?php
if ( ! defined( 'ABSPATH' ) ) exit;

$check_BodyCommerce_sale_badge_color_primary = get_bodycommerce_option( 'BodyCommerce_sale_badge_color_primary' );
// $check_BodyCommerce_sale_badge_color_secondary = get_bodycommerce_option( 'BodyCommerce_sale_badge_color_secondary' );
$check_BodyCommerce_sale_badge_edge_distance = get_bodycommerce_option( 'BodyCommerce_sale_badge_edge_distance' );
$check_BodyCommerce_sale_badge_top_distance = get_bodycommerce_option( 'BodyCommerce_sale_badge_top_distance' );
$check_BodyCommerce_sale_badge_position = get_bodycommerce_option( 'BodyCommerce_sale_badge_position' );
$check_BodyCommerce_sale_badge_size = get_bodycommerce_option( 'BodyCommerce_sale_badge_size' );
$check_BodyCommerce_sale_badge_text_color = get_bodycommerce_option( 'BodyCommerce_sale_badge_text_color' );
$check_BodyCommerce_sale_badge_text_size = get_bodycommerce_option( 'BodyCommerce_sale_badge_text_size' );
$check_BodyCommerce_sale_badge_text_position = get_bodycommerce_option( 'BodyCommerce_sale_badge_text_position' );
$check_BodyCommerce_sale_badge_text_line_height = get_bodycommerce_option( 'BodyCommerce_sale_badge_text_line_height' );
$check_BodyCommerce_sale_badge_edge_distance_text = get_bodycommerce_option( 'BodyCommerce_sale_badge_edge_distance_text' );
$check_BodyCommerce_sale_badge_top_distance_text = get_bodycommerce_option( 'BodyCommerce_sale_badge_top_distance_text' );

$check_other_settings_absolute_relative_text = get_bodycommerce_option( 'other_settings_absolute_relative_text' );


if ($check_other_settings_absolute_relative_text == 1){
$css_button = '
<style id="bodycommerce-sale-badge star">
.bodycommerce-sale-badge {position:relative;}

.bodycommerce-sale-badge svg {
  fill: '.$check_BodyCommerce_sale_badge_color_primary.';
  position: absolute;
    z-index: 100;
    '.$check_BodyCommerce_sale_badge_position.': '.$check_BodyCommerce_sale_badge_edge_distance.'px;
    top: '.$check_BodyCommerce_sale_badge_top_distance.'px;
  width: '.$check_BodyCommerce_sale_badge_size.'px;
height: '.$check_BodyCommerce_sale_badge_size.'px;
}

.bodycommerce-sale-badge svg path {
	  fill: '.$check_BodyCommerce_sale_badge_color_primary.' !important;
}

.bodycommerce-percentage {
  position: absolute;
    z-index: 101;
    '.$check_BodyCommerce_sale_badge_position.': '.$check_BodyCommerce_sale_badge_edge_distance_text.'px;
    top: '.$check_BodyCommerce_sale_badge_top_distance_text.'px;
    width: '.$check_BodyCommerce_sale_badge_size.'px;
    font-size: '.$check_BodyCommerce_sale_badge_text_size.'px;
    color: '.$check_BodyCommerce_sale_badge_text_color.';
    line-height: '.$check_BodyCommerce_sale_badge_text_line_height.'px;
		text-align: '.$check_BodyCommerce_sale_badge_text_position.';
	}

		</style>';
  }
  else {
    $css_button = '
    <style id="bodycommerce-sale-badge star">
    .bodycommerce-sale-badge {position:absolute;  top: '.$check_BodyCommerce_sale_badge_top_distance.'px;
    '.$check_BodyCommerce_sale_badge_position.': '.$check_BodyCommerce_sale_badge_edge_distance.'px;
  }

    .bodycommerce-sale-badge svg {
      fill: '.$check_BodyCommerce_sale_badge_color_primary.';
      position: absolute;
      z-index: 100;
      width: '.$check_BodyCommerce_sale_badge_size.'px;
      height: '.$check_BodyCommerce_sale_badge_size.'px;
    }

    .bodycommerce-sale-badge svg path {
    	  fill: '.$check_BodyCommerce_sale_badge_color_primary.' !important;
    }

    .bodycommerce-percentage {
      position: relative;
        z-index: 101;
        '.$check_BodyCommerce_sale_badge_position.': '.$check_BodyCommerce_sale_badge_edge_distance_text.'px;
        top: '.$check_BodyCommerce_sale_badge_top_distance_text.'px;
        width: '.$check_BodyCommerce_sale_badge_size.'px;
        font-size: '.$check_BodyCommerce_sale_badge_text_size.'px;
        color: '.$check_BodyCommerce_sale_badge_text_color.';
        line-height: '.$check_BodyCommerce_sale_badge_text_line_height.'px;
    		text-align: '.$check_BodyCommerce_sale_badge_text_position.';
    	}

    		</style>';
  }
?>
