/*
 * weiss-robotics.com - accessory slider ("cross-seller"), own code.
 *
 * Markup: contao/templates/ce_wr_crossseller_start.html5 / _stop.html5
 *   .crossSellerCTE > .crossSeller.wr-crossseller-mobile-slider
 *     > h2
 *     > .wr-crossseller-mobile-stage        the scroll container
 *         > button.wr-crossseller-mobile-prev / -next
 *         > .productList                    one row of tiles, as wide as its content
 *             > a.shopProduct.wr-crossseller-item
 *
 * Until 16.09.2026 the desktop slider was lsjs (slidesManager) and only the
 * mobile part was this CSS, written against the wrapper lsjs created at
 * runtime (.lsSlideboxContainer). Now the stage itself scrolls, at every
 * width, with CSS scroll snapping; wr-crossseller.js only drives the arrows.
 * Replaces the block "Anpassung Zubehör-Slider" in custom.css.
 */

.crossSellerCTE {
  width: 100%;
}

.wr-crossseller-mobile-stage {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.wr-crossseller-mobile-stage::-webkit-scrollbar {
  display: none;
}

.wr-crossseller-mobile-slider .productList {
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0 48px 10px;
  gap: 15px;
  box-sizing: border-box;
  /* centred when everything fits (min-width: 100% makes the list wider than
     its tiles); when it overflows, width: max-content leaves no free space and
     justify-content has nothing to distribute. On 4.9 the list was an
     inline-block inside ".crossSellerCTE { text-align: center }" */
  justify-content: center;
}
/* few tiles: no arrow padding */
.wr-crossseller-mobile-slider .productList:not(:has(> .shopProduct:nth-of-type(4))) {
  padding-left: 0;
  padding-right: 0;
}
.wr-crossseller-mobile-slider .productList > .lsfwk-clear {
  display: none;
}

.wr-crossseller-mobile-slider .productList > .shopProduct {
  float: none;
  flex: 0 0 180px;
  width: 180px;
  max-width: none;
  /* lsjs used to give the tile this height via
     ".lsSlideboxContainer .productList .shopProduct" (custom.css); without
     the wrapper that rule no longer matches and the absolutely positioned
     .bottomWrapper (title, 80px) sat on top of the image */
  height: 260px;
  /* custom.css 4394 ".crossSeller .shopProduct { margin: 15px 7px }": the
     15px above and below stay (also the room for the :hover scale(1.06)
     inside the clipping stage); the 7px left/right are the 15px gap now */
  margin: 15px 0;
  scroll-snap-align: start;
}
/* lsjs gave the slidebox a fixed 320px on the desktop (app.js slideboxSize
   y: 320); with 15 + 260 + 15 for the tile row that left 30px of air below
   it before the sizes note. Mobile had height: auto (custom.css 31.07.2026) */
@media screen and (min-width: 901px) {
  .wr-crossseller-mobile-stage {
    min-height: 320px;
  }
}
@media screen and (max-width: 750px) {
  .wr-crossseller-mobile-slider .productList > .shopProduct {
    flex-basis: min(180px, 44vw);
    width: min(180px, 44vw);
  }
}

/* arrows: round, white, over the tiles */
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow {
  display: flex;
  position: absolute;
  top: 50%;
  z-index: 10;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}
.wr-crossseller-mobile-slider .wr-crossseller-mobile-prev { left: 4px; }
.wr-crossseller-mobile-slider .wr-crossseller-mobile-next { right: 4px; }
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow span {
  display: block;
  transform: translateY(-1px);
}
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow:focus-visible {
  outline: 2px solid #007cbf;
  outline-offset: 2px;
}
/* custom.css (theme, unchanged) hides these arrows on the desktop because the
   desktop slider used to be lsjs; the stage now scrolls at every width, so the
   arrows are shown everywhere and hidden only when there is nothing to scroll to */
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow {
  display: flex !important;
}
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow[disabled],
.wr-crossseller-mobile-slider .wr-crossseller-mobile-arrow:disabled {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .wr-crossseller-mobile-stage {
    scroll-behavior: auto;
  }
}
