// * ---------------------------------------------------------------------------    
// 
//       __ __  __
//     /  /   /   /     __/__/__
//     \ /   /   /  __   /  /  __  (/__
//      /   /   / /  /  /  /  /__) /  /
//     /   /   / (__/__/_ /__/____/  /_/
//             \
//               SOLUTIONS
// 
// 
//	=Utility - Push
//
// 	Make an element push (add margin) at a breakpoint
//
// ---------------------------------------------------------------------------- *

$mk-util-push-name: push !default;

@if ( map-has-key( __mk_get_global_utility_map(), $mk-util-push-name ) ) {

	$map: map-get( __mk_get_global_utility_map(), $mk-util-push-name );
	$mk-util-push-selector: mk-get-selector( $mk-util-push-name, map-get( map-get( __mk_get_global_utility_map(), $mk-util-push-name ), 'base' ), $mk-util-prefix ) !default;

	#{ $mk-util-push-selector } {

		margin: mk-base-spacing-unit() !important;

		// Top modifier
		@if ( map-has-key( $map, 'top' ) ) {

			&--top {

				margin-top: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'top--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-top: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if




		// Bottom modifier
		@if ( map-has-key( $map, 'bottom' ) ) {

			&--bottom {

				margin-bottom: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'bottom--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-bottom: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if





		// Left modifier
		@if ( map-has-key( $map, 'left' ) ) {

			&--left {

				margin-left: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'left--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-left: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if




		// Right modifier
		@if ( map-has-key( $map, 'right' ) ) {

			&--right {

				margin-right: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'right--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-right: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if





		// Sides modifier
		@if ( map-has-key( $map, 'sides' ) ) {

			&--sides {

				margin-left: mk-base-spacing-unit() !important;
				margin-right: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'sides--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-left: mk-base-spacing-unit() !important;
								margin-right: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if





		// Sides modifier
		@if ( map-has-key( $map, 'sides' ) ) {

			&--ends {

				margin-top: mk-base-spacing-unit() !important;
				margin-bottom: mk-base-spacing-unit() !important;

				// Loop through each breakpoint
				// Check if we want to output the breakpoint
				@each $breakpoints, $breakpoint in map-get( __mk_get_global_grid_config_map(), 'breakpoints' ) {

					@if ( map-has-key( $map, 'ends--#{ $breakpoints }' ) ) {

						&\@#{ $breakpoints } {

							@include mk-media-query( "#{ $breakpoints }" ) {

								margin-top: mk-base-spacing-unit() !important;
								margin-bottom: mk-base-spacing-unit() !important;

							}

						}

					}

				}

			}

		} // end if

	}

}