/* Carrusel de marcas del home (Electrotheme). Vanilla CSS, sin frameworks. */
.em-home-brands {
  --em-brands-gap: clamp(0.75rem, 2cqi, 1.25rem);
  container-type: inline-size;
  margin-block: clamp(1.5rem, 4cqi, 3rem);
}

.em-home-brands__viewport {
  display: block;
}

.em-home-brands__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(120px, 22cqi, 180px);
  gap: var(--em-brands-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-block: 0.25rem;
  cursor: grab;
  touch-action: pan-y;
}

.em-home-brands__track:active {
  cursor: grabbing;
}

.em-home-brands__track::-webkit-scrollbar {
  display: none;
}

.em-home-brands__item {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  min-height: 150px;
  border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  background: light-dark(#fff, #161616);
}

.em-home-brands__item:where(:hover, :focus-visible) {
  border-color: color-mix(in srgb, currentColor 40%, transparent);
}

/* La imagen se centra en el espacio libre y el texto queda anclado abajo. */
.em-home-brands__logo,
.em-home-brands__badge {
  margin: auto;
}

.em-home-brands__badge {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.em-home-brands__logo {
  width: 100px;
  height: 60px;
  object-fit: contain;
}

.em-home-brands__name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  margin-top: auto;
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.em-home-brands__count {
  font-size: 0.75rem;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .em-home-brands__track {
    scroll-behavior: auto;
  }
}
