.cs-carousel {
  --cs-carousel-gap: 1rem;
  position: relative;
}

/*
 * flex-wrap: nowrap is required, not optional: the track keeps
 * WooCommerce's own `.is-flex-container` class (from the Product
 * Collection block underneath), which sets `flex-wrap: wrap` with no
 * !important. Without an explicit override here, cards wrap onto
 * separate stacked rows once they no longer fit one line -- confirmed
 * live on Related Products with only 2 items (each card sized to ~50% of
 * track width by design, but 2 cards at 50%+gap don't quite fit one row,
 * so they wrapped to two full-height rows instead of sitting in the
 * horizontally-scrollable track this whole component exists for).
 * !important needed to beat that WooCommerce rule, matching the other
 * !important overrides already in this rule for the same reason.
 */
.cs-carousel__track {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: var(--cs-carousel-gap) !important;
  grid-template-columns: none !important;
  list-style: none;
  margin-inline: 0 !important;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-block-end: 0.75rem;
  scroll-behavior: auto;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
  touch-action: pan-x pan-y pinch-zoom;
}

.cs-carousel__track > * {
  flex: 0 0 var(--cs-carousel-card-width, 25%) !important;
  margin: 0 !important;
  max-width: none !important;
  scroll-snap-align: start;
  width: auto !important;
}

.cs-carousel__toolbar {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-block-end: 1rem;
  margin-inline: auto;
  max-width: 1280px;
  width: 100%;
}

.cs-carousel__control,
.cs-carousel__indicator {
  align-items: center;
  background: var(--wp--preset--color--white, #fff);
  border: 1px solid var(--wp--preset--color--charcoal, #292522);
  color: var(--wp--preset--color--charcoal, #292522);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.75rem;
}

.cs-carousel__control {
  border-radius: 50%;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.cs-carousel__control[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.cs-carousel__indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-block-start: 0.75rem;
}

.cs-carousel__indicator {
  background: transparent;
  border: 0;
  border-radius: 50%;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
}

.cs-carousel__indicator::before {
  background: var(--wp--preset--color--white, #fff);
  border: 1px solid var(--wp--preset--color--charcoal, #292522);
  border-radius: 50%;
  content: "";
  height: .75rem;
  width: .75rem;
}

.cs-carousel__indicator[aria-current="true"]::before {
  background: var(--wp--preset--color--deep-plum, #5b1838);
}

@media (max-width: 767px) {
  .cs-carousel--no-mobile-swipe .cs-carousel__track {
    overflow-x: hidden;
    touch-action: pan-y pinch-zoom;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-carousel__track {
    scroll-behavior: auto;
  }
}
