.cat{
  
  display: flex;
  flex-wrap: wrap;
}

.cat label {
  width: 23%;
  background: transparent;
  margin: 3px;
}
.cat label:hover span{
  background: #ef5350;
  border: 1px solid #ef5350;
  color: #fff;
  cursor: pointer;
}
.cat label span {
  text-align: center;
   border-radius: 4px;
  display: block;
  font-size: 10px;
  padding: 8px 12px;
  border: 1px solid #797979;
}

.cat label input {
  position: absolute;
  display: none;
  color: #797979 !important;
}
/* selects all of the text within the input element and changes the color of the text */
.cat label input + span{color: #797979;}


/* This will declare how a selected input will look giving generic properties */
.cat input:checked + span {
    color: #ffffff;
    
}


/*
This following statements selects each category individually that contains an input element that is a checkbox and is checked (or selected) and chabges the background color of the span element.
*/

.action input:checked + span{
  background-color: #ef5350;
  border-radius: 4px;
  border: 1px solid #ef5350;
}
