%button {
    position: relative;
    min-width: $button-width;
    min-height: $button-height;
    padding: 0 1.2em 0 1.2em;
    display: inline-block;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: pointer;
    outline: 0;
    background: none;
    border: 0;
    border-radius: $button-radius;
    font-family: $ff;
    @include font-size(13px);
    font-style: inherit;
    font-variant: inherit;
    text-transform: uppercase;
    letter-spacing: inherit;
    font-weight: 600;
    line-height: $button-height;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
    margin-bottom: 10px;
    font-family: $ff;
    transition: all 0.4s $cb-fast;
    &:focus {
      outline: 0;
    }
    &::-moz-focus-inner {
        border: 0;
    }
    &[disabled] {
        cursor: default;
        pointer-events: none;
    }
}

%clear {
    @include font-size(13px);
    background: none;
    min-width: auto;
    min-height: auto;
    width: auto;
    padding: 0;
    line-height: 1.3em;
    text-decoration: none;
    border: 0;
    &:hover,
    &:focus {
        text-decoration: underline;
        background: none;
    }
    &:active {
        font-weight: bolder;
        background: none;
        border: 0;
        line-height: 1.3em;
    }
}

.button-primary {
    @extend %button;
    background-color: palette(purple);
    color: palette(white);
    .svg-icon {
        margin-right: 1em;
        vertical-align: middle;
        fill: palette(white);
    }
    &:hover,
    &:focus,
    &:active,
    &.active {
        background-color: darken(palette(purple), 10%);
    }
    &[disabled] {
        background-color: palette(purple, disabled);
        box-shadow: none;
    }
    &--main {
        @extend .button-primary;
        box-shadow: $shadow;
        min-height: 46px;
        line-height: 46px;
        &:hover,
        &:focus {
            box-shadow: none;
            background-color: palette(purple);
        }
    }
    &--small {
        @extend .button-primary;
        text-transform: none;
        min-height: 30px;
        line-height: 30px;
        min-width: auto;
    }
}

.button-secondary {
    @extend %button;
    background: palette(white);
    color: palette(purple);
    .svg-icon {
        margin-right: 1em;
        vertical-align: middle;
        fill: palette(purple);
    }
    &:hover,
    &:focus {
        box-shadow: none;
    }
    &[disabled] {
        color: palette(purple, disabled);
        box-shadow: none;
    }
    &--main {
        @extend .button-secondary;
        box-shadow: $shadow;
        min-height: 46px;
        line-height: 46px;
    }
    &--dropdown {
        @extend .button-secondary--main;
        text-align: left;
        &:after {
            content: '';
            border-color: palette(purple);
            border-style: solid;
            border-width: 1px 1px 0 0;
            display: inline-block;
            height: 8px;
            width: 8px;
            transform: rotate(133deg);
            transition: all 1.5s ease;
            margin-bottom: 2px;
            margin-left: 1em;
        }
    }
    &--small {
        @extend .button-secondary;
        min-height: 26px;
        line-height: 26px;
        min-width: auto;
    }
}

.button-tertiary {
    @extend %button;
    background: palette(grey, medium);
    color: palette(white);
    .svg-icon {
        margin-right: 1em;
        vertical-align: middle;
        fill: palette(white);
    }
    &:hover,
    &:focus,
    &:active,
    &.active {
        background-color: darken(palette(grey, medium), 10%);
    }
    &[disabled] {
        background-color: lighten(palette(grey, medium), 20%);
    }
    &--outline {
        @extend .button-tertiary;
        background: transparent;
        border: 1px solid palette(grey, smooth);
        color: palette(grey, medium);
        text-transform: none;
        &:hover,
        &:focus {
            background: transparent;
            border-color: darken(palette(grey, medium), 10%);
            color: darken(palette(grey, medium), 10%);
        }
        &[disabled] {
          background-color: transparent;
          opacity: 0.6;
        }
    }
    &--small {
        @extend .button-tertiary;
        text-transform: none;
        min-height: 30px;
        line-height: 30px;
        min-width: auto;
    }
}

.button-clear {
    @extend %button;
    @extend %clear;
    text-transform: none;
    &:hover,
    &:focus {
        text-decoration: none;
        color: palette(black);
    }
    &--small {
        @extend %button;
        @include font-size(12px);
        min-height: 26px;
        line-height: 26px;
        min-width: auto;
        background: none;
    }
    &[disabled] {
        opacity: 0.4
    }
}

.button--icon {
    min-width: auto;
    width: 30px;
    height: 30px;
    padding: 0;
    text-align: center;
    display: flex;
    box-shadow: $shadow-100;
    border-radius: 2px;
    position: relative;
    transition: box-shadow 0.3s ease;
    .svg-icon {
      margin: auto;
      fill: palette(orange);
    }
    &:hover {
      box-shadow: $shadow-200;
      transition: box-shadow 0.3s ease;
    }
    &.--active {
      background: palette(orange);
      transition: all 0.3s ease-in-out;
      .svg-icon {
        fill: palette(white);
      }
    }
}

.button--position-top {
    position: absolute;
    top: 1.5em;
    right: 3em;
    z-index: 1;
    @include media('<desktop') {
        right: 2em;
    }
}

.button--full {
    width: 100%;
}

.link-form {
    margin-left: auto;
    display: block;
    margin-top: -20px;
    margin-bottom: 2.3em;
}

.button-icon {
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 15px;
    outline: none;
    .hide {
        display: none;
    }
    .show {
        display: block;
    }
}

.re-button+.re-button {
    margin-left: 1em;
}

.modal-buttons {
    .re-button {
        margin-bottom: 0;
        &:last-child {
            margin-left: 1em;
        }
    }
}

.button-group {
    display: flex;
    .re-button {
        min-height: 50px;
        width: 100%;
        margin: 2px;
        &:active {
            color: palette(white);
        }
        &.inactive {
            opacity: 0.5;
            &:hover {
                opacity: 1;
            }
        }
    }
}

.re-button {
    .spinner {
        position: absolute;
        left: 1em;
        top: 0;
        bottom: 0;
        margin: auto;
    }
    &.loading {
        padding-left: 3.6em;
        .svg-icon {
            display: none;
        }
    }
}

// actions list button
.button-action {
    @extend %button;
    border: 1px solid palette(grey, medium);
    background: none;
    text-transform: capitalize;
    min-width: auto;
    max-width: 80px;
    min-height: 26px;
    line-height: 26px;
    text-align: center;
    &:hover,
    &:focus {
        color: darken(palette(grey, medium), 30%);
    }
    &[disabled] {
        opacity: 0.3;
        pointer-events: none;
        span {
            cursor: not-allowed;
        }
    }
    &--clear {
        &:hover,
        &:focus {
            color: darken(palette(grey, medium), 30%);
        }
        &[disabled] {
            opacity: 0.3;
            pointer-events: none;
            span {
                cursor: not-allowed;
            }
        }
    }
}
.external-link, .external-link a  {
  color: palette(orange);
  display: inline-block;
  margin-left: 1em;
  &:hover, &:focus {
    transition: all 0.3s ease;
    color: darken(palette(orange), 5%);
    .svg-icon {
      fill: darken(palette(orange), 5%);
    }
  }
  .svg-icon {
    margin-left: 0.5em
  }
}
