/* Featured brands — editorial index, not the hero marquee */

.home-brands {
  --hb-ink: #111;
  --hb-muted: #6a6a70;
  --hb-line: rgba(17, 17, 17, 0.1);
  --hb-red: var(--ayenyx-secondary, #fbaa25);
  --hb-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: var(--hb-ink);
  background: #f7f7f8 !important;
  background-image: none !important;
  border: none !important;
  font-family: var(--ayenyx-font, 'Outfit', Verdana, sans-serif);
}

.home-brands__container {
  width: min(var(--ayenyx-container, 1120px), calc(100% - (2 * var(--ayenyx-gutter))));
  margin: 0 auto;
  padding: clamp(4.75rem, 9vw, 7.5rem) 0;
}

.home-brands__header {
  margin: 0 0 clamp(2.5rem, 4.5vw, 3.5rem);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hb-line);
}

.home-brands__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 100%;
}

.home-brands__tag {
  margin: 0 0 0.9rem !important;
  color: var(--hb-red) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
}

.home-brands__title {
  margin: 0;
  color: var(--hb-ink) !important;
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.home-brands__lead {
  margin: 0;
  max-width: 100%;
  color: var(--hb-muted);
  font-size: 16px;
  line-height: 1.65;
}

.home-brands__board {
  border-top: 1px solid var(--hb-line);
}

.home-brands__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-brands__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  padding: 1.35rem 1rem;
  border-bottom: 1px solid var(--hb-line);
  border-left: 1px solid var(--hb-line);
  cursor: default;
  transition:
    background 0.35s var(--hb-ease),
    transform 0.35s var(--hb-ease);
}

.home-brands__cell:nth-child(6n + 1) {
  border-left: 0;
}

.home-brands__cell::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--hb-red);
  transition: width 0.4s var(--hb-ease);
}

.home-brands__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 9.75rem;
  height: 3.25rem;
  overflow: hidden;
}

.home-brands__logo {
  display: block;
  width: 9.75rem;
  height: 3.25rem;
  object-fit: contain;
  object-position: center;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.88;
  /* Removes white backgrounds from non-transparent PNGs on light cells */
  mix-blend-mode: multiply;
  transition:
    filter 0.35s var(--hb-ease),
    opacity 0.35s var(--hb-ease);
}

.home-brands__cell:hover,
.home-brands__cell:focus-within {
  background: #fff;
  transform: translateY(-3px);
  z-index: 1;
}

.home-brands__cell:hover::before,
.home-brands__cell:focus-within::before {
  width: 100%;
}

.home-brands__cell:hover .home-brands__logo,
.home-brands__cell:focus-within .home-brands__logo {
  filter: grayscale(0) contrast(1);
  opacity: 1;
}

/* Fix padding issues in original logos */
.home-brands__cell[data-brand="bose"] .home-brands__logo {
  transform: scale(2.2);
}

.home-brands__cell[data-brand="synology"] .home-brands__logo,
.home-brands__cell[data-brand="maxhub"] .home-brands__logo,
.home-brands__cell[data-brand="qnap"] .home-brands__logo {
  transform: scale(1.8);
}

.home-brands__cell[data-brand="zkteco"] .home-brands__logo {
  /* The transparent replacement is tightly cropped, so it fits unscaled. */
  transform: none;
}

.home-brands__cell[data-brand="axlogix"] .home-brands__logo {
  /* The transparent replacement is a wide, full lockup; keep it contained. */
  transform: none;
}

.home-brands__cell[data-brand="jbl"] .home-brands__logo {
  transform: scale(1.3);
}

@media (max-width: 991px) {
  .home-brands__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-brands__cell {
    min-height: 96px;
  }

  .home-brands__cell:nth-child(6n + 1) {
    border-left: 1px solid var(--hb-line);
  }

  .home-brands__cell:nth-child(odd) {
    border-left: 0;
  }
}

@media (max-width: 575px) {
  .home-brands__title {
    font-size: clamp(1.85rem, 7vw, 2.35rem);
  }

  .home-brands__cell {
    min-height: 88px;
    padding: 1.1rem 0.75rem;
  }

  .home-brands__mark,
  .home-brands__logo {
    width: 8.5rem;
    height: 2.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-brands__cell,
  .home-brands__cell::before,
  .home-brands__logo {
    transition: none;
  }

  .home-brands__cell:hover,
  .home-brands__cell:focus-within {
    transform: none;
  }
}
