/// Reverse a map
///
/// @author Sean McEmerson
/// @access public
/// @link http://git.io/vLfuz
///
/// @param {map} $map - the map to be reversed
///
/// @return {map} - reversed map
@function map-reverse($map) {
    $keys: map-keys($map);
    $map-reversed: ();

    @for $i from length($keys) through 1 {
        $map-reversed: map-merge(
            $map-reversed, (nth($keys, $i): map-get($map, nth($keys, $i)))
        );
    }

    $result: $map-reversed;

    @return $result;
}