@import 'commons';

.m-scroll-top {
    &__button {
        display: flex;

        &.m--is-position-fixed {
            position: fixed;
            right: $m-space-lg;
            bottom: $m-space-lg;
            z-index: 1;

            @media (max-width: $m-mq-min-sm) {
                display: none;
            }
        }

        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        background-color: $m-color-grey-darker;
        border: none;
        border-radius: $m-border-radius-sm;
        opacity: 0.5;
        cursor: pointer;
        transition: transform 0.3s ease,
        opacity 0.3s ease;
        transform: rotate(0) scale(1);

        .m-icon {
            color: $m-color-white;
            transform: rotate(-90deg);
        }

        &:hover {
            opacity: 1;
        }

        &:active,
        &:focus {
            outline: none;
            opacity: 1;
        }

        &.m--is {

            &-enter,
            &-leave-to {
                transform: rotate(360deg) scale(0);
            }

            &-relative {
                transform: rotate(0) scale(1);
            }
        }
    }

    &__footer {
        display: flex;
        position: relative;
        margin-top: $m-space-sm;
        align-items: center;
        justify-content: flex-end;

        &__content {
            flex: 1;
        }
    }

    &__hidden {
        @include m-visually-hidden;
    }
}
