@import "toggle";
@include wrap-class() {
    .wcc-button,
    a.wcc-button,
    button.wcc-button {
        width: auto;
        min-width: 80px;
        padding: 8px 14px;
        background-color: color(primary, button);
        color: color(primary, button_font);
        border: 1px solid color(primary, button);
        font-weight: 500;
        font-size: 14px;
        border-radius: 3px;
        cursor: pointer;
        line-height: 16px;

        &:hover,
        &:focus {
            background-color: #2D4F97;
            border-color: #2D4F97;
        }

        &.wcc-button-secondary {
            background-color: color(secondary, button);
            border-color: color(secondary, button_border);
            color: color(secondary, button_font);
            &:hover,
            &:focus {
                background-color: darken(color(secondary, button), 10%);
                border-color: darken(color(secondary, button), 10%);
            }
        }
        // Custom Buttons
        &.wcc-button-green {
            background-color: color(green, base);
            border-color: color(green, base);
            &:hover,
            &:focus {
                background-color: darken(color(green, base), 5%);
                border-color: darken(color(green, base), 5%);
            }
        }
        
        &.wcc-button-danger {
            background-color: color(error, base);
            color: color(mono, white);
            border-color: color(error, base);
            &:hover,
            &:focus {
                background-color: darken(color(error, base), 10%);
                border-color: darken(color(error, base), 10%);
            }
        }
        &.wcc-button-medium {
            padding: 12px 16px;
            font-size: 14px;
        }
        &.wcc-button-small {
            padding: 6px 12px;
        }
        &:focus {
            outline: none;
        }
        &.wcc-button-outline {
            background-color: transparent;
            color: color(primary, button);
            &:hover,
            &:focus {
                background-color: color(primary, button);
                color: color(mono, white);
            }
        }
        &.wcc-button-outline-secondary {
            background-color: transparent;
            color: color(secondary, button_font);
            border-color: color(secondary, button_border);
            &:hover,
            &:focus {
                background-color: color(secondary, button);
            }
        }
        &.wcc-button-outline-danger {
            background-color: transparent;
            color: color(error, base);
            border-color: color(error, base);
            &:hover,
            &:focus {
                background-color: color(error, base);
                color: color(mono, white);
            }
        }
        &.wcc-button-outline-blue {
            background-color: transparent;
            color: #3157A6;
            border-color: #3157A6;
            &:hover,
            &:focus {
                background: #F1F8FE;
                border: 1px solid #3157A6
            }
        }
        &.wcc-button-upgrade {
            background: linear-gradient(90deg, #f83600, #f9d423);
            border: none;
            padding: 8px 20px;
            .wcc-icon-base {
                width: 12px;
                margin-right: 8px;
            }
            &:hover,
            &:focus {
                background: linear-gradient(45deg, #f83600, #f9d423);
            }
        }
        &.disabled,
        &:disabled,
        &[disabled],
        &.wcc-button-onload,
        &.wcc-button-onload-text {
            opacity: 0.5;
        }

        // Pagination Button
        &.wcc-pagination-button {
            min-width: 30px;
            background: transparent;
            color: $font--color-main;
            border: 1px solid transparent;
            border-color: $border-color;
            font-size: 16px;
            margin: 2px;

            &.wcc-pagination-number {
                font-size: 12px;
            }
            &.active {
                background: color(primary, base);
                color: color(mono, white);
                opacity: 1;
            }
        }
        &.wcc-button-outline {
            color: color(primary, button);
            background-color: transparent;
            background-image: none;
            border: 1px solid;
            border-color: color(primary, button);
            &:hover,
            &:focus {
                background-color: color(primary, button);
                color: color(mono, white);
            }
        }
        &.wcc-button-red {
            background-color: #ffeded;
            color: #d63638;
            border-color: #ffeded;
            &:hover,
            &:focus {
                background-color: darken(#ffeded, 10%);
                border-color: darken( #ffeded, 10%);
            }
        }
        &.wcc-button-light-blue {
            background-color: #E7F3FD;
            color:  #056BE7;
            border-color: #E7F3FD;
            &:hover,
            &:focus {
                background-color: darken(#E7F3FD, 10%);
                border-color: darken( #E7F3FD, 10%);
            }
        }
        &.wcc-button-light-blue-outline-dashed {
            background-color: #FAFDFF;
            color:  #056BE7;
            border: 1px dashed #3791FE;
            &:hover,
            &:focus {
                animation-timing-function: ease-out;
                animation-duration: 300ms;
                background: #F1F8FE;
                border: 1.5px dashed #3157A6
            }
        }
        &.wcc-button-link {
            background-color: transparent;
            color: #056BE7;
            border: none;
            padding: 0;
            &:hover,
            &:focus {
                background-color: transparent;
                color: #056BE7;
                text-decoration: underline;
            }
        }
        &.wcc-button-icon {
            display: inline-flex;
            @extend %align-center;
            & > span {
                margin-right: 3px;
            }
        }
        .wcc-btn-spinner {
            line-height: 1.15;
            position: absolute;
            right: 15px;
            opacity: 0;
            width: 16px;
            height: 16px;
            top: 50%;
            display: inline-block;
            transform: translateY(-50%);
            transition-property: padding, opacity;
            transition-duration: 0.2s, 0.2s;
            transition-timing-function: ease-in, ease;
            transition-delay: 0s, 0.2s;
        }
        .wcc-btn-spinner span {
            box-sizing: border-box;
            display: inline-block;
            position: absolute;
            right: 0;
            width: 16px;
            height: 16px;
            opacity: 1;
            border: 1px solid #fff;
            border-radius: 50%;
            animation: spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
            border-color: #fff transparent transparent transparent;
        }
        .wcc-btn-spinner span:nth-child(1) {
            animation-delay: 0.45s;
        }
        .wcc-btn-spinner span:nth-child(2) {
            animation-delay: 0.3s;
        }
        .wcc-btn-spinner span:nth-child(3) {
            animation-delay: 0.15s;
        }
        .wcc-button:not(:disabled) {
            transition-delay: 0.2s;
        }
        .wcc-button:not(:disabled) .wcc-btn-spinner span {
            box-shadow: 0 0 0 0.2rem #fff inset;
            border: 7.4px solid transparent;
            -webkit-transition: all 0.4s;
            transition: all 0.4s;
        }
        .wcc-button:not(:disabled) .wcc-btn-spinner span:nth-child(1) {
            transform: rotate(0deg) !important;
        }
        .wcc-button:not(:disabled) .wcc-btn-spinner span:nth-child(2) {
            transform: rotate(90deg) !important;
        }
        .wcc-button:not(:disabled) .wcc-btn-spinner span:nth-child(3) {
            transform: rotate(180deg) !important;
        }
        .wcc-button:not(:disabled) .wcc-btn-spinner span:nth-child(4) {
            transform: rotate(270deg) !important;
        }
        &.wcc-button-loading {
            padding-right: 40px;
            .wcc-btn-spinner {
                opacity: 1;
            }
        }
        @keyframes spinner {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
    }
    a.wcc-button {
        display: inline-flex;
    }
    a.wcc-button-no-style,
    button.wcc-button-no-style {
        font: 500 13px/16px $font;
        background-color: transparent;
        color: color(secondary, font);
        border: none;
        padding: 0;
        cursor: pointer;
        min-width: initial;
        &:hover,
        &:focus {
            color: darken(color(secondary, font), 50%);
            background-color: transparent;
        }

        &:focus {
            outline: none;
            color: darken(color(secondary, font), 50%);
            background-color: transparent;
        }
    }
    .wcc-button[data-type="icon"] {
        padding: 6px;
        height: 30px;
        min-width: initial;
    }
    .wcc-actions-group button:not(:first-child) {
        margin-left: 10px;
    }
}
