Wordpress css customize

Can someone help me …

I developed a theme that I made personally, but I experienced difficulties. because envanto cannot enter css anywhere other than using wp_add_inline_style (); or enqueue style

I use preview customization directly and add partial refresh.

I have a settings menu:

  1. choice of layout A or B.
  2. the choice of background color for the layout.

everything went smoothly … but I realized when I chose the background color (black) and changed the layout !!

The CSS value (background color: black) returns to the default, while in the control menu settings the background color (black). Does anyone have a solution?