.related-products {
  padding: 0;
  position: relative;
  background: var(--light-gray);
  padding-left: 5%;
  padding-right: 5%;
}

/* Centered heading like screenshot */
.related-products__header {
  display: block;
  text-align: center;
  margin-bottom: 48px;
}

.related-products__title {
  margin: 0;
}

.related-products__intro {
  text-align: center;
  max-width: 850px;
  margin: auto;
  padding-left: 5%;
  padding-right: 5%;
  
}

/* Hide the default Prev/Next text buttons in the header;
   we’ll restyle them as floating circle controls */
.related-products__controls {
  display: none;
}

/* Carousel wrapper */
.related-products .section_regular {
  position: relative;
  /* anchor for floating arrows */
}

/* Track */
.related-products__track {
  display: grid;
  grid-auto-flow: column;

  /* 3 cards visible */
  grid-auto-columns: calc((100% - (32px * 2)) / 3);

  gap: 32px;

  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 16px;
  padding: 0 16px;

  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.related-products__track::-webkit-scrollbar {
  display: none;
}

/* Make the container the positioning context */
.related-products__carousel {
  position: relative;
}

/* Controls wrapper: stretch across carousel so buttons can sit on edges */
.related-products__controls {
  position: absolute;
  inset: 0;
  z-index: 5;

  display: flex;
  justify-content: space-between;
  align-items: center;

  pointer-events: none;
  padding: 0 8px;
}




/* Buttons: maroon circle */
.related-products__btn {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  cursor: pointer;

  /* hide the “Prev/Next” text */
  font-size: 0;
  line-height: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* White chevron arrow using same idea as your learn-more arrow */
.related-products__btn::before {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: rotate(45deg);
  display: none;
}

/* Prev points left */
.related-products__btn[data-prev]::before {
  display: none;
}

.related-products__btn:hover {
  filter: brightness(0.95);
}

.related-products__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Hide arrows on desktop when 3 or fewer items */
.related-products__controls.hide-on-desktop {
  display: none;
}

@media (max-width: 780px) {
  .related-products__controls.hide-on-desktop {
    display: flex;
  }
}



/* Cards */
.related-products__card {
  scroll-snap-align: start;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  background: white;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

a.related-products__card:hover {
  color: inherit;
}

/* Image */
.related-products__media {
  overflow: hidden;
  background: #f2f2f2;
}

.related-products__media img,
.related-products__placeholder {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

/* Content */
.related-products__content {
  padding: 28px;
}

.related-products__card-title {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 16px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--black);
}

/* “PRODUCT SUBHEADING” line in screenshot
   You don’t have a field for it right now, so we style the “View Product”
   as the small uppercase line (and leave title as the big line). */
.related-products__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
}

/* --- Floating nav buttons --- */
/* We reuse your existing .related-products__btn elements even though they’re
   output in the header. We'll visually place them over the track. */
.related-products__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-10%);
  /* slightly above center like screenshot */
  z-index: 5;

  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  background: var(--primary);
  cursor: pointer;

  /* hide text label */
  font-size: 0;
  line-height: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Left / right placement */
.related-products__btn[data-prev] {
  left: -28px;
}

.related-products__btn[data-next] {
  right: -28px;
}

/* White chevron arrows */
.related-products__btn::after {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: rotate(45deg);
}

.related-products__btn[data-prev]::after {
  transform: rotate(-135deg);
}

/* Hover/focus */
.related-products__btn:hover {
  filter: brightness(0.95);
}

.related-products__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Responsive tweaks */
@media (max-width: 1100px) {
  .related-products__btn[data-prev] {
    left: -10px;
  }

  .related-products__btn[data-next] {
    right: -10px;
  }

  .related-products__track {
    gap: 20px;
  }
}

@media (max-width: 780px) {

  .related-products__header {
    margin-bottom: 28px;
  }

  .related-products__track {
    /* one full card per “page” */
    grid-auto-columns: calc(100% - 24px);
    padding: 0 12px;

    gap: 12px;
    /* optional */
    scroll-padding: 12px;
  }

  .related-products__media img,
  .related-products__placeholder {
    height: 260px;
  }

  /* Move arrows below cards on mobile */
  .related-products__controls {
    position: static;
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding: 0;
  }

  .related-products__btn {
    position: static;
    transform: none;
  }

  .related-products__btn[data-prev],
  .related-products__btn[data-next] {
    left: auto;
    right: auto;
  }
}