//
// Button Variables
//


$include-html-button-classes: $include-html-classes !default;


// We use these to build padding for buttons.
$button-med:              emCalc(15px) !default;
$button-tny:              emCalc(7px) !default;
$button-sml:              emCalc(9px) !default;
$button-lrg:              emCalc(16px) !default;

// We use this to control the display property.
$button-display:          inline-block !default;
$button-margin-bottom:    emCalc(20px) !default;

// We use these to control button text styles.
$button-font-family:      inherit !default;
$button-font-color:       #555 !default;
$button-font-color-alt:   #333 !default;
$button-border-color:     #aaa !default;
$button-font-med:         emCalc(14px) !default;
$button-font-tny:         emCalc(11px) !default;
$button-font-sml:         emCalc(13px) !default;
$button-font-lrg:         emCalc(20px) !default;
$button-font-weight:      bold !default;
$button-font-align:       center !default;
$button-font-transform:   uppercase !default;

// We use these to control various hover effects.
$button-function-factor:  10% !default;


// We use this to set the default radius used throughout the core.
$button-radius:           $button-radius !default;
$button-round:            $global-rounded !default;

// We use this to set default opacity for disabled buttons.
$button-disabled-opacity: 0.6 !default;


//
// Button Mixins
//

// We use this mixin to create a default button base.
@mixin button-base($style:true, $display:$button-display) {
  @if $style {
    border:1px solid;
    text-transform: $button-font-transform; 
    cursor: pointer;
    font-family: $button-font-family;
    font-weight: $button-font-weight !important;
    line-height: 1;
    margin: 0;
    position: relative;
    text-decoration: none;
    text-align: $button-font-align;
  }
  @if $display { display: $display; }
}

// We use this mixin to add button size styles
@mixin button-size($padding:$button-med, $full-width:false, $is-input:false) {

  // We control which padding styles come through,
  // these can be turned off by setting $padding:false
  @if $padding {
    padding-top: $padding;
    padding-#{$opposite-direction}: $padding * 2;
    padding-bottom: $padding + emCalc(1px);
    padding-#{$default-float}: $padding * 2;

    // We control the font-size based on mixin input.
    @if      $padding == $button-med { font-size: $button-font-med; }
    @else if $padding == $button-tny { font-size: $button-font-tny; }
    @else if $padding == $button-sml { font-size: $button-font-sml; }
    @else if $padding == $button-lrg { font-size: $button-font-lrg; }
    @else                     { font-size: $padding - emCalc(2px); }
  }

  // We can set $full-width:true to remove side padding extend width.
  @if $full-width {
    // We still need to check if $padding is set.
    @if $padding {
    padding-top: $padding;
    padding-bottom: $padding + emCalc(1px);
    } @else if $padding == false {
      padding-top:0;
      padding-bottom:0;
    }
    padding-right: 0px;
    padding-left: 0px;
    width: 100%;
  }

  // <input>'s and <button>'s take on strange padding. We added this to help fix that.
  @if $is-input == $button-lrg {
    padding-top: $is-input + emCalc(.5px);
    padding-bottom: $is-input + emCalc(.5px);
  }
  @else if $is-input {
    padding-top: $is-input + emCalc(1px);
    padding-bottom: $is-input;
  }
}

// We use this mixin to add button color styles
@mixin button-style($bg:#fff, $radius:true, $disabled:false, $border: $button-border-color) {

  // We control which background styles are used,
  // these can be removed by setting $bg:false
  @if $bg {
    // This find the lightness percentage of the background color.
    $bg-lightness: lightness($bg);
    background-color: $bg;
    transition: all 0.5s ease 0s;
    -webkit-transition: all 0.5s ease 0s;
    -moz-transition: all 0.5s ease 0s;



    // We control the text color for you based on the background color.
    @if $bg-lightness > 70% {
      color: $button-font-color-alt;
      &:hover{ color: #fff; border-color: $primary-color;}
    }
    @else {
      color: $button-font-color;
      &:hover, &:focus{ color: #fff; border-color: $color-hover; background: $color-hover;}
    }
  }

  @if $border{
    border-color: $border;
  }

  // We can set $disabled:true to create a disabled transparent button.
  @if $disabled {
    cursor: default;
    opacity: $button-disabled-opacity;
    -webkit-box-shadow: none;
    box-shadow: none;
    &:hover,
    &:focus { background-color: $bg; }
  }

  // We can control how much button radius us used.
  @if $radius == true { @include radius($button-radius); }
  @else if $radius { @include radius($radius); }

}

// We use this to quickly create buttons with a single mixin. As @jaredhardy puts it, "the kitchen sink mixin"
@mixin button($padding:$button-med, $bg:$primary-color, $border: $button-border-color, $radius:true, $full-width:false, $disabled:false, $is-input:false, $is-prefix:false) {
  @include button-base;
  @include button-size($padding, $full-width, $is-input);
  @include button-style($bg, $radius, $disabled, $border);
}


//
// Button Classes
//

// Only include these classes if the variable is true, otherwise they'll be left out.
@if $include-html-button-classes != false {

  // Default styles applied outside of media query

  #submit ,button, .button, input[type="submit"] {
    @include button-base;
    @include button-size;
    @include button-style;

    &.secondary { @include button-style($bg:$secondary-color); }
    &.white { @include button-style($bg:#FFF); }
    &.success   { @include button-style($bg:$success-color); }
    &.alert     { @include button-style($bg:$alert-color); }

    &.large  { @include button-size($padding:$button-lrg); }
    &.small  { @include button-size($padding:$button-sml); }
    &.tiny   { @include button-size($padding:$button-tny); }
    &.expand { @include button-size($padding:null,$full-width:true); }

    &.left-align  { text-align: left; text-indent: emCalc(12px); }
    &.right-align { text-align: right; padding-right: emCalc(12px); }

    
      &.radius { @include button-style($bg:false, $radius:true); }
      &.round  { @include button-style($bg:false, $radius:$button-round); }

    &.disabled, &[disabled] { @include button-style($bg:$primary-color, $disabled:true);
      &.secondary { @include button-style($bg:$secondary-color, $disabled:true); }
      &.white { @include button-style($bg:#eee); }
      &.success { @include button-style($bg:$success-color, $disabled:true); }
      &.alert { @include button-style($bg:$alert-color, $disabled:true); }
    }

  }

  #submit, button, .button, input[type="submit"] {
    @include button-size($padding:false, $is-input:$button-med);
    &.tiny { @include button-size($padding:false, $is-input:$button-tny); }
    &.small { @include button-size($padding:false, $is-input:$button-sml); }
    &.large { @include button-size($padding:false, $is-input:$button-lrg); }
  }

  // Styles for any browser or device that support media queries
  @media only screen {



 #submit,  button, .button, input[type="submit"] {
      &.large  { @include button-size($padding:false, $full-width:false); }
      &.small  { @include button-size($padding:false, $full-width:false); }
      &.tiny   { @include button-size($padding:false, $full-width:false); }

      &.radius { @include button-style($bg:false, $radius:true); }
      &.round  { @include button-style($bg:false, $radius:$button-round); }
    }

  }

  // Additional styles for screens larger than 768px
  @media #{$small} {
   #submit, button, .button, input[type="submit"] {
      @include button-base($style:false, $display:inline-block);
      @include button-size($padding:false, $full-width:false);
    }

  }

}

/* alternative button styles*/
a.secondary.trans-button:hover{background-color:$secondary-color;}
a.alert.trans-button:hover{background-color:$alert-color;}
a.success.trans-button:hover{background-color:$success-color;}

.button.success.trans-button{color: $success-color}
.button.alert.trans-button{color: $alert-color}

.secondary.trans-button{color: $secondary-color;} 


.trans-button{
  background-color: transparent !important;font-weight:500;text-transform: uppercase; font-size: $font-size; border-width: 2px; border-style: solid; padding: 8px 15px;
  &:hover{
    color: #fff !important;
  }
  &.hover-primary{
    background-color: $primary-color !important; color: #fff; border-color: $primary-color;
    &:hover{color: #fff !important; background-color: #000 !important; border-color: #000;} 
  } 
  &.hover-white{
    color: #FFF; border-color: #fff;
    &:hover{color:#000 !important; background-color: #FFF!important; ;} 
  }
  &.hover-gray{
    color: #555; border-color: #555;
    &:hover{color: #fff; background-color: #555 !important;}
  }
  &.primary{
    background-color: $primary-color !important; color: #fff !important; border-color: $primary-color;
  } 
}


.facebook-button{background-color: #3a589d!important}


/* Revolution slider */
.rev_slider_wrapper .type-label-2{
  background: $primary-color;
    height: 5em;
    text-align: center;
    width: 5em;
    @include radius(99px);
    color: #fff;
    text-transform: uppercase;
    font-weight: bold;
    padding-top: 10px;
  }
.rev_slider_wrapper .type-label-2 .sale{line-height: 6px;}
.rev_slider_wrapper .type-label-2 span{display: block;font-size: 60%;}
