.cbp-rfgrid {
  margin: 0 auto;
  padding: 0;
  list-style: none;
  position: relative;
  width: 90%;
}

/* Each grid cell is now square and larger */
.cbp-rfgrid li {
  position: relative;
  float: left;
  overflow: hidden;
  width: 20%; /* Fallback */
  width: -webkit-calc(100% / 5);
  width: calc(100% / 5);
  aspect-ratio: 1 / 1; /* Makes each item a perfect square */
}

/* Anchor inside each square */
.cbp-rfgrid li a {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  color: inherit;
  background: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Logo images — now centered and contained within the square */
.cbp-rfgrid li a img {
  width: 80%;           /* Takes 80% of the square width */
  height: 80%;          /* Same for height to keep it square */
  object-fit: contain;  /* Keeps proportions without distortion */
  transition: transform 0.3s ease;
}

/* Slight zoom when hovered */
.cbp-rfgrid li a:hover img {
  transform: scale(1.05);
}

/* Overlay (appears over logo) */
.cbp-rfgrid li a div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 45, 65, 0.4); /* Semi-transparent */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

/* On hover: slightly darker overlay */
.cbp-rfgrid li a:hover div {
  opacity: 1;
  background: rgba(7, 45, 65, 0.55);
}

/* Text overlay (centered company name) */
.cbp-rfgrid li a div h3 {
  color: #fff;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin: 0;
  font-weight: 700;
}

/* Responsiveness */
@media screen and (max-width: 945px) {
  .cbp-rfgrid li {
    width: 25%;
  }
}

@media screen and (max-width: 660px) {
  .cbp-rfgrid li {
    width: 33.3333%;
  }
}

@media screen and (max-width: 400px) {
  .cbp-rfgrid li {
    width: 50%;
  }
}

@media screen and (max-width: 300px) {
  .cbp-rfgrid li {
    width: 100%;
  }
}
