Update the CSS to this:
.horizontal.wp-block-categories-list {
list-style: none;
text-transform: uppercase;
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-left: 0;
font-size: 15px;
font-weight: 500;
}
.horizontal.wp-block-categories-list li a {
padding: 5px 0;
margin: 0 5px;
}
.horizontal.wp-block-categories-list li a:hover {
text-decoration: none;
border-bottom: 2px solid var(--naranja-acentuar);
}
Then select the Block you want to apply it to, and go to Advanced > Additional CSS Classes and add: horizontal