@use "sass:math";
@import "../variables";

@if index($hamburger-animations, minimal) {
    .#{$hamburger-class-name}--minimal {
        span.bar {
            transition:
                transform math.div(0.4s, $hamburger-animation-speed) $hamburger-easing,
                opacity math.div(0.3s, $hamburger-animation-speed)
                $hamburger-easing math.div(0.1s, $hamburger-animation-speed);

            &:nth-child(1) {
                top: math.round(-$hamburger-bar-spacing * 0.8);
            }

            &:nth-child(2) {
                top: math.round($hamburger-bar-spacing * 0.8);
            }

            &:nth-child(3) {
                display: none;
            }
        }

        &.#{$hamburger-active-class-name} {
            span.bar {
                transition:
                    transform math.div(0.4s, $hamburger-animation-speed) $hamburger-easing,
                    opacity math.div(0.3s, $hamburger-animation-speed) $hamburger-easing;

                &:nth-child(1) {
                    transform: translate3d(0, math.round($hamburger-bar-spacing * 0.8), 0);
                }

                &:nth-child(2) {
                    opacity: 0;
                    transform: translate3d(0, math.round(-$hamburger-bar-spacing * 0.8), 0);
                }
            }
        }
    }
}
