creating different style CTA button in the menu

why don’t you add a class that is the permalink for example?

ie

$output .= "<li class="nav-item $active_class $dropdown_class " .  implode(" ", $item->classes) . "">";

(this line is strange first because it’s going to output “nav item $active_class $dropdown_class”…is that what you want?)

but all the same it COULD be

$output .= "<li class="nav-item $active_class $dropdown_class " .  implode(" ", $item->classes) . " " . $permalink ."">";

Then call that class in your css

li .menu-permalink {
  background-color:blue;
}
li .menu-permalink2 {
  background-color: transparent;
}

you can apply the $permalink to whatever you like (ie li or a etc) and then change the css as needed.