/* -------------------------------------
   Brands Carousel Base Layout
-------------------------------------- */

.brands-carousel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  overflow: hidden;
  align-items: center;
  position: relative;
  padding: 20px 40px; /* space for arrows */
  box-sizing: border-box;
}

.brands-carousel .brand-item {
  flex: 0 1 calc(16.666% - 20px); /* 6 per row on desktop */
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.3s ease;
}

.brands-carousel .brand-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.brands-carousel .brand-item img {
  width: 150px; /* enlarged */
  height: auto;
  transition: transform 0.3s ease;
}

.brands-carousel .brand-item:hover img {
  transform: scale(1.08);
}

.brands-carousel .brand-title {
  display: block;
  margin-top: 8px;
  font-size: 0.95em;
  font-weight: 500;
}

/* -------------------------------------
   Responsive fallback grid (for VC editor)
-------------------------------------- */

@media (max-width: 991px) {
  .brands-carousel .brand-item {
    flex: 0 1 calc(25% - 20px); /* 4 per row tablet */
  }
}

@media (max-width: 767px) {
  .brands-carousel .brand-item {
    flex: 0 1 calc(50% - 20px); /* 2 per row mobile */
  }
}

/* -------------------------------------
   Navigation Arrows
-------------------------------------- */

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-size: 28px;
  color: #444;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  pointer-events: all;
}

.carousel-prev:hover,
.carousel-next:hover {
  color: #000;
  background: #fff;
  border-color: #bbb;
}

.carousel-prev {
  left: 8px;
}

.carousel-next {
  right: 8px;
}

/* Keep arrows positioned on mobile/tablet without overlap */
@media (max-width: 991px) {
  .carousel-prev,
  .carousel-next {
    width: 30px;
    height: 30px;
    font-size: 22px;
    line-height: 30px;
    background: rgba(255, 255, 255, 0.95);
  }

  .carousel-prev {
    left: 4px;
  }

  .carousel-next {
    right: 4px;
  }
}

/* Prevent arrows from becoming full width in Slick */
.brands-carousel .carousel-prev.slick-arrow,
.brands-carousel .carousel-next.slick-arrow {
  display: block !important;
  width: auto;
  max-width: 40px;
}

/* -------------------------------------
   WPBakery Frontend Editor Support
-------------------------------------- */

.vc_editor .brands-carousel {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}

.vc_editor .brands-carousel .brand-item {
  display: inline-block !important;
  vertical-align: top !important;
  margin: 10px !important;
}
