// Button: Control
.button-control {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    padding-top: 2px;
    pointer-events: auto;
    border-radius: 50vh;
    border: none;
    cursor: pointer;
    outline: none;
    transition: background-color 350ms $ease-quart;
    will-change: background-color;

    @include breakpoint (sm) {
        width: 56px;
        height: 56px;
    }

    // Icon
    .icon {
        overflow: hidden;
        display: block;
        width: 13px;
        height: auto;
        transition: transform 500ms $ease-quart, opacity 150ms $ease-inout;
        will-change: transform;

        @include breakpoint (sm) {
            width: 20px;
        }
    }
    .icon[aria-hidden] {
        opacity: 0;
        position: absolute;
        top: 50%;
        left: 50%;
    }


    /*
    ** Variants
    */
    &--white {
        background-color: #fff;

        &:hover, &:focus {
            background-color: $color-secondary;
        }
    }
    &--pink {
        background-color: rgba($color-secondary, 0.4);

        &:hover, &:focus {
            background-color: rgba($color-secondary, 0.75);
        }
    }
    &--gray {
        background-color: $color-gray;

        &:hover, &:focus {
            background-color: $color-text;
        }
    }


    /*
    ** Directions
    */
    // To left
    &.dir-left {
        .icon[aria-hidden] {
            transform: translate(100%, -50%);
        }

        &:hover, &:focus {
            .icon:not([aria-hidden]) {
                opacity: 0;
                transform: translate(-100%, 0);
            }
            .icon[aria-hidden] {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }
    }
    // To right
    &.dir-right {
        .icon[aria-hidden] {
            transform: translate(-150%, -50%);
        }

        &:hover, &:focus {
            .icon:not([aria-hidden]) {
                opacity: 0;
                transform: translate(100%, 0);
            }
            .icon[aria-hidden] {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }
    }
    // From top
    &.dir-top {
        .icon[aria-hidden] {
            left: auto;
            transform: translate(0, -150%);
        }

        &:hover, &:focus {
            .icon:not([aria-hidden]) {
                opacity: 0;
                transform: translate(0, 100%);
            }
            .icon[aria-hidden] {
                opacity: 1;
                transform: translate(0, -50%);
            }
        }
    }
    // From bottom
    &.dir-bottom {
        .icon[aria-hidden] {
            left: auto;
            transform: translate(0, 150%);
        }

        &:hover, &:focus {
            .icon:not([aria-hidden]) {
                opacity: 0;
                transform: translate(0, -100%);
            }
            .icon[aria-hidden] {
                opacity: 1;
                transform: translate(0, -50%);
            }
        }
    }


    /*
    ** Dashed style
    */
    &--dashed {
        position: relative;
        overflow: visible;
        background-color: rgba($color-lightpurple, 0.5);
        transition: background-color 150ms $ease-inout;
        will-change: background-color;

        // Icon
        svg[fill] {
            height: auto;
        }

        // Dashed circle
        svg:not([fill]) {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 130%;
            height: 130%;
            transform: translate(-50%, -50%);
        }
        circle {
            display: block;
            stroke-width: 1.75;
            stroke-dasharray: 7, 3;
            stroke: rgba($color-lightpurple, 0.35);
            fill: none;
            transform-origin: 50% 50%;
            animation: rotateDashes 5s linear infinite;
            animation-play-state: paused;
            animation-delay: 50ms;
            transition: stroke 150ms $ease-inout;
            will-change: stroke;
        }

        // Hover
        &:hover, &:focus {
            background-color: rgba($color-lightpurple, 0.65);

            * {
                animation-play-state: running;
            }
        }
    }


    /*
    ** Big version
    */
    &--big {
        width: 72px;
        height: 72px;
        text-decoration: none;

        @include breakpoint (sm) {
            width: 152px;
            height: 152px;
        }

        .center {
            display: flex;
            flex-direction: column;
            align-items: center;

            span {
                display: block;
                margin-top: 8px;
                color: rgba(#fff, 0.3);
                text-transform: uppercase;
                font-family: $font-sans-sb;
                font-size: rem(6px);
                letter-spacing: 1px;
                line-height: 1;

                @include breakpoint (sm) {
                    margin-top: 10px;
                    font-size: rem(10px);
                }
            }
        }

        img {
            display: block;
            width: 24px;

            @include breakpoint (sm) {
                width: 40px;
            }
        }

        // Big Dashed
        &.button-control--dashed {
            @include breakpoint (xs) {
                svg[fill] {
                    width: 24px;
                }
            }

            @include breakpoint (sm) {
                circle {
                    stroke-width: 4.5;
                    stroke-dasharray: 20, 8;
                }
            }
        }
    }
}
