Add css-class based on productpages' top level taxonomy term
Try something like this in your theme's template.php file (put it into MY_THEME_preprocess_page(&amp;$variables) function):

if(arg(0) == 'taxonomy' &amp;&amp; arg(1) == 'term' &amp;&amp; is_numeric(arg(2))) {
    $tid = arg(2);
    $term = taxonomy_term_load($tid);
    $parent = taxonomy_get_parents($term-&gt;tid);

    if(empty($parent)) {
      $variables['classes_array']['parent_cat_color'] = $term-&gt;name;
      // or $variables['classes_array']['parent_cat_color'] = 'parent_cat_color' .. it's up to you..
    }
  }


and open page.tpl.php and put $classes variable into your wrapper div..