WP_Query Taxonomy categories filtering

You can nest your tax queries. Just make sure you use OR as the first relation and AND relation on the nested tax queries.

$filter_group_a = array(
  'relation' => 'AND',
  array(
    'taxonomy' => 'product_cat',
    'field'    => 'slug',
    'terms'    => $term_a,
  ),
  array(
    'taxonomy' => 'product_cat',
    'field'    => 'slug',
    'terms'    => $term_b,
  ),
);

$filter_group_b = array(
  'relation' => 'AND',
  array(
    'taxonomy' => 'product_cat',
    'field'    => 'slug',
    'terms'    => $term_a,
  ),
  array(
    'taxonomy' => 'product_cat',
    'field'    => 'slug',
    'terms'    => $term_c,
  ),
)

$query_args = array(
  'tax_query' => array(
    'relation' => 'OR',
    $filter_group_a,
    $filter_group_b,
  )
);

You could write some fancy loop that builds the $filter_groups and pushes them to the $query_args['tax_query'] array.