/* Shared product rails used on PDP and cart pages. */
.rj-product-rail {
  min-width: 0;
  margin-bottom: 56px;
}

.rj-product-rail > .rj-rail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  margin-bottom: 24px;
}

.rj-rail-heading-copy {
  min-width: 0;
}

.rj-product-rail h2.font-display.text-4xl {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 400;
  text-align: left;
}

.rj-product-rail--compact-heading h2.font-display.text-4xl {
  font-size: clamp(21px, 2.1vw, 26px);
}

.rj-product-rail .rj-rail-heading-copy > .text-center.mt-2 {
  text-align: left;
}

.rj-rail-navigation {
  display: inline-flex;
  flex: none;
  overflow: hidden;
  margin-left: auto;
  border: 1px solid #e4d9cb;
  border-radius: 999px;
  background: #fff;
}

.rj-rail-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8d0c10;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.rj-rail-nav + .rj-rail-nav {
  border-left: 1px solid #e4d9cb;
}

.rj-rail-nav:hover:not(:disabled),
.rj-rail-nav:focus-visible {
  background: #8d0c10;
  color: #fff;
}

.rj-rail-nav:focus-visible {
  outline: 2px solid #b9791b;
  outline-offset: -2px;
}

.rj-rail-nav:disabled {
  color: #c9bfb3;
  cursor: not-allowed;
}

.rj-rail-nav-icon {
  display: block;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.rj-rail-nav--prev .rj-rail-nav-icon {
  transform: rotate(-135deg);
}

.rj-rail-nav--next .rj-rail-nav-icon {
  transform: rotate(45deg);
}

.rj-product-rail .ymal-page {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  flex: 0 0 100%;
  gap: 16px;
  align-items: stretch;
}

@media (min-width: 768px) {
  .rj-product-rail--four .ymal-page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.rj-product-rail .selected_rails {
  min-width: 0;
}

/* A short curated homepage list keeps the same card width as a full rail. */
.rj-home-bestsellers .rj-product-rail > .grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rj-product-rail .selected_rails > div > a {
  color: var(--pdp-ink, var(--color-ink, #171717));
  text-decoration: none;
}

.rj-product-rail .selected_rails > div > div:first-child {
  height: auto !important;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
}

.rj-product-rail .selected_rails img.slider_product_img {
  height: 100%;
  object-fit: contain;
}

@media (hover: hover) and (pointer: fine) {
  .rj-product-rail .selected_rails img.slider_product_img {
    transition: height 240ms ease;
  }

  .rj-product-rail .selected_rails .group\/img:hover img.slider_product_img {
    height: calc(100% - 44px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rj-product-rail .selected_rails img.slider_product_img {
    transition: none;
  }
}

@media (max-width: 767px) {
  .rj-home-bestsellers .rj-product-rail > .grid,
  .rj-product-rail .grid-cols-4,
  .rj-product-rail .ymal-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .rj-product-rail .selected_rails .slider_product_img {
    max-width: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .rj-product-rail .rj-rail-has-video img.slider_product_img {
    transition: none;
  }
  .rj-product-rail .rj-rail-has-video .group\/img:hover img.slider_product_img {
    height: 100%;
  }
}

/* Portrait tablets show three products across. */
@media (min-width: 768px) and (max-width: 1100px) and (orientation: portrait) {
  .rj-product-rail > .grid,
  .rj-product-rail .ymal-page {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
