.logo-marquee {
  --logo-gap: 28px;
  --logo-box-width: 180px;
  --logo-box-height: 72px;
  --logo-max-width: 160px;
  --logo-max-height: 56px;
  --carousel-height-desktop: 82px;
  --carousel-height-mobile: 72px;
  --fade-width-desktop: 60px;
  --fade-width-mobile: 28px;
  --bg: #ffffff;

  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: var(--carousel-height-desktop);
}

.logo-marquee * {
  box-sizing: border-box;
}

.logo-marquee__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: var(--carousel-height-desktop);
  display: flex;
  align-items: center;
}

.logo-marquee__viewport::before,
.logo-marquee__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--fade-width-desktop);
  pointer-events: none;
  z-index: 2;
}

.logo-marquee__viewport::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.logo-marquee__viewport::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.logo-marquee__track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: logoMarquee 45s linear infinite;
}

.logo-marquee__group {
  display: flex;
  align-items: center;
  gap: var(--logo-gap);
  flex-shrink: 0;
  padding-right: var(--logo-gap);
}

.logo-marquee__item {
  flex: 0 0 var(--logo-box-width);
  width: var(--logo-box-width);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-marquee__box {
  width: var(--logo-box-width);
  height: var(--logo-box-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-marquee__img {
  display: block;
  max-width: var(--logo-max-width);
  max-height: var(--logo-max-height);
 /* width: auto;
  height: auto;*/
  object-fit: contain;

  filter: grayscale(1) saturate(0);
  opacity: 0.75;

  transition: filter 220ms ease, opacity 220ms ease, transform 220ms ease;

  user-select: none;
  -webkit-user-drag: none;
}

.logo-marquee__track:hover {
  animation-play-state: paused;
}

.logo-marquee__track:hover .logo-marquee__img {
  opacity: 0.35;
}

.logo-marquee__item:hover .logo-marquee__img,
.logo-marquee__item:focus-within .logo-marquee__img {
  filter: grayscale(0) saturate(1);
  opacity: 1;
  transform: translateY(-2px);
}

@keyframes logoMarquee {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (max-width: 767px) {
  .logo-marquee {
    --logo-gap: 18px;
    --logo-box-width: 130px;
    --logo-box-height: 56px;
    --logo-max-width: 115px;
    --logo-max-height: 40px;

    contain-intrinsic-size: var(--carousel-height-mobile);
  }

  .logo-marquee__viewport {
    min-height: var(--carousel-height-mobile);
  }

  .logo-marquee__viewport::before,
  .logo-marquee__viewport::after {
    width: var(--fade-width-mobile);
  }

  .logo-marquee__track {
    animation-duration: 28s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee__track {
    animation: none;
    transform: none;
  }

  .logo-marquee__img {
    transition: none;
  }
}

{# 

.logo-marquee {
  --bg: #ffffff;
  --text: #111111;

  /* control visual */
  --logo-gap: 28px;
  --logo-height-desktop: 90px;
  --logo-height-mobile: 32px;

  --carousel-height-desktop: 82px;
  --carousel-height-mobile: 72px;

  --fade-width-desktop: 60px;
  --fade-width-mobile: 28px;
}

/* ===== RESET ===== */

.logo-marquee * {
  box-sizing: border-box;
}

/* ===== FULLSCREEN CONTAINER ===== */

.logo-marquee {
  overflow: hidden;

  content-visibility: auto;
  contain-intrinsic-size: var(--carousel-height-desktop);
}

/* ===== VIEWPORT ===== */

.logo-marquee__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  min-height: var(--carousel-height-desktop);
  display: flex;
  align-items: center;
}

/* ===== FADE LATERAL ===== */

.logo-marquee__viewport::before,
.logo-marquee__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--fade-width-desktop);
  pointer-events: none;
  z-index: 2;
}

.logo-marquee__viewport::before {
  left: 0;
  background: linear-gradient(to right, var(--bg) 0%, rgba(255,255,255,0) 100%);
}

.logo-marquee__viewport::after {
  right: 0;
  background: linear-gradient(to left, var(--bg) 0%, rgba(255,255,255,0) 100%);
}

/* ===== TRACK ===== */

.logo-marquee__track {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  width: max-content;

  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* ===== ITEM ===== */

.logo-marquee__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-right: var(--logo-gap);
}

/* ===== LINK / BOX ===== */

.logo-marquee__link,
.logo-marquee__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--carousel-height-desktop);

  /* Ajuste seguro en vez de min-width */
  padding-inline: 32px;

  text-decoration: none;
  outline: none;
}

.logo-marquee__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 6px;
}

/* ===== LOGOS ===== */

.logo-marquee__img {
  display: block;
  width: auto;
  height: var(--logo-height-desktop);
  max-width: none;
  object-fit: contain;
  
   /*
    Agranda visualmente sin cambiar el layout.
    Esto es más seguro para tu JS.
  */
  transform: scale(1.5);
  transform-origin: center;

  filter: grayscale(1) saturate(0);
  opacity: 0.75;

  transition:
    filter 220ms ease,
    opacity 220ms ease,
    transform 220ms ease;

  user-select: none;
  -webkit-user-drag: none;
}

/* Hover → color */

.logo-marquee__item:hover .logo-marquee__img,
.logo-marquee__item:focus-within .logo-marquee__img {
  filter: grayscale(0) saturate(1);
  opacity: 1;
  transform: scale(1.5) translateY(-2px);
}

/* Atenuar otros */

.logo-marquee__track:hover .logo-marquee__img {
  opacity: 0.35;
}

.logo-marquee__item:hover .logo-marquee__img {
  opacity: 1;
}

/* ===== DESKTOP CONTROL ===== */

@media (min-width: 1024px) {
  .logo-marquee {
    --logo-gap: 28px;
    --logo-height-desktop: 40px;
  }
}

/* ===== MOBILE CONTROL ===== */

@media (max-width: 767px) {
  .logo-marquee {
    --logo-gap: 18px;
    --logo-height-mobile: 32px;
  }

  .logo-marquee {
    contain-intrinsic-size: var(--carousel-height-mobile);
  }

  .logo-marquee__viewport {
    min-height: var(--carousel-height-mobile);
  }

  .logo-marquee__viewport::before,
  .logo-marquee__viewport::after {
    width: var(--fade-width-mobile);
  }

  .logo-marquee__track {
    padding-right: 30%;
  }

  .logo-marquee__link,
  .logo-marquee__box {
    min-height: var(--carousel-height-mobile);
    padding-inline: 30px;
  }

  .logo-marquee__img {
    height: var(--logo-height-mobile);
  }
}

/* ===== ACCESIBILIDAD ===== */

@media (prefers-reduced-motion: reduce) {
  .logo-marquee__track {
    transform: none !important;
  }

  .logo-marquee__img {
    transition: none;
  }
}
#}