.bfm-marquee-container {
  overflow: hidden; /* Hide overflow in both directions */
  display: flex;
  flex-direction: row;
  position: relative;
  width: var(--width);
  transform: var(--transform);
  transform-origin: center center;
  touch-action: pan-y; /* Default: allow vertical scrolling */
  /* Center rotated elements to prevent displacement */
  margin: 0 auto;
}

/* When drag is enabled, JS toggles these classes */
.bfm-marquee-container.bfm-draggable {
  cursor: grab;
}

.bfm-marquee-container.bfm-dragging {
  cursor: grabbing;
  touch-action: none; /* Prevent scroll while actively dragging */
  user-select: none;
}

.bfm-marquee-container:hover .bfm-marquee {
  animation-play-state: var(--pause-on-hover);
}

.bfm-marquee-container:active .bfm-marquee {
  animation-play-state: var(--pause-on-click);
}

.bfm-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Ensure overlay doesn't block drag events */
}

  .bfm-overlay::before,
  .bfm-overlay::after {
    background: linear-gradient(to right, var(--gradient-color), rgba(255, 255, 255, 0));
    content: "";
    height: 100%;
    position: absolute;
    width: var(--gradient-width);
    z-index: 2;
    pointer-events: none;
    touch-action: none;
  }

  .bfm-overlay::after {
    right: 0;
    top: 0;
    transform: rotateZ(180deg);
  }

  .bfm-overlay::before {
    left: 0;
    top: 0;
  }

.bfm-marquee {
  flex: 0 0 auto;
  min-width: var(--min-width);
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  animation: bfm-scroll var(--duration) linear var(--delay) var(--iteration-count);
  animation-play-state: var(--play);
  animation-direction: var(--direction);
}

@keyframes bfm-scroll {
  from {
    transform: translateX(0%);
  }

  to {
    transform: translateX(-100%);
  }
}

.bfm-initial-child-container {
  flex: 0 0 auto;
  display: flex;
  min-width: auto;
  flex-direction: row;
  align-items: center;
}

.bfm-child {
  transform: var(--transform);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  width: max-content;
}
