/* PIPPER: horizontal banner strip using images from the Shoptet carousel.
   CSS-only: native horizontal scrolling, no autoplay/arrows/pagination.
   Scoped to the homepage carousel; does not affect other banners.
   Keep this file after the template's styles. */

body.in-index #carousel {
  --pipper-banner-gap: 16px;
  --pipper-banner-width: 300px;
  width: 100%;
  max-width: 100%;
}

body.in-index #carousel > .carousel-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: var(--pipper-banner-gap);
  width: 100%;
  height: auto !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 12px;
}

/* Override every native slide state, including during Shoptet autoplay. */
body.in-index #carousel > .carousel-inner > .item {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  float: none !important;
  flex: 0 0 var(--pipper-banner-width) !important;
  width: var(--pipper-banner-width) !important;
  max-width: none !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  scroll-snap-align: start;
}

body.in-index #carousel > .carousel-inner > .item > a {
  display: block;
  width: 100%;
}

/* Preserve the complete uploaded image, including any text inside it. */
body.in-index #carousel > .carousel-inner > .item img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Native controls refer to the original single-slide carousel. */
body.in-index #carousel > .carousel-control,
body.in-index #carousel > .carousel-indicators {
  display: none !important;
}

/* A single uploaded banner keeps its existing full-width presentation. */
body.in-index #carousel > .carousel-inner > .item:only-child {
  flex-basis: 100% !important;
  width: 100% !important;
}

@media (max-width: 767px) {
  body.in-index #carousel {
    --pipper-banner-gap: 10px;
    --pipper-banner-width: min(300px, 82vw);
  }
}
