/* =========================================================
   Smart Sliders - storefront styles
   Native scroll-snap does the swiping (works without JS); smartsliders-v4.js only adds arrows, dots and autoplay.
   The height is reserved by the slide frame's padding-top (set per slider), so nothing jumps while images load.
   ========================================================= */

.smart-slider {
  position: relative;
  width: 100%;
  margin: 0 auto 20px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Themes often wrap a widget zone in a grid of their own (Voyage: .bannersx2, two columns). A slider is the whole zone: it takes
   the full row, so its slides / banners lay themselves out (and stay centered) instead of filling only the theme's first cell. */
.smart-slider,
.smart-banners {
  grid-column: 1 / -1;
}

.smart-slider *,
.smart-slider *::before,
.smart-slider *::after {
  box-sizing: border-box;
}

/* ---------- Track ---------- */
.smart-slider__viewport {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.smart-slider__viewport::-webkit-scrollbar {
  display: none;
}

.smart-slider__slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* padding-top (a % of the width) is set per slider from its desktop/mobile proportions. */
.smart-slider__frame {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 31.25%;
  /* A size container: the sizes chosen in the appearance options scale with the slide (cqw, see SmartSliderStyle). */
  container-type: inline-size;
}

.smart-slider__picture,
.smart-slider__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.smart-slider__img {
  object-fit: cover;
}

.smart-slider__cover {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
}

.smart-slider__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Text over the image ---------- */
.smart-slider__caption {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  padding: 0 6%;
  pointer-events: none;
}

.smart-slider__caption--left { text-align: left; right: auto; max-width: 65%; }
.smart-slider__caption--right { text-align: right; left: auto; max-width: 65%; }
.smart-slider__caption--center { text-align: center; }

/* The caption's color (the slide's text color) must reach the title and subtitle: they are <p>, and themes style p
   directly (Voyage: p { color: #888 }), which beats the inherited color. A class selector outweighs that rule. */
.smart-slider__title,
.smart-slider__subtitle {
  color: inherit;
}

.smart-slider__title {
  margin: 0 0 .4em;
  font-size: clamp(1.25rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
}

.smart-slider__subtitle {
  margin: 0 0 .9em;
  font-size: clamp(.9rem, 1.6vw, 1.25rem);
  line-height: 1.35;
}

.smart-slider__btn {
  display: inline-block;
  padding: .6em 1.4em;
  border: 2px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  pointer-events: auto;
  transition: background-color .2s;
}

/* A button with an icon (library svg or own image): it sits next to the text and follows its size and color. */
.smart-slider__btn--icon { display: inline-flex; align-items: center; gap: .5em; }
.smart-slider__btn-icon { display: inline-flex; flex: none; }
.smart-slider__btn-icon svg,
.smart-slider__btn-icon img { width: 1.2em; height: 1.2em; object-fit: contain; }

.smart-slider__btn:hover,
.smart-slider__btn:focus {
  background: rgba(255, 255, 255, .18);
  color: inherit;
  text-decoration: none;
}

/* ---------- Free HTML slide ---------- */
.smart-slider__html {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
}

/* ---------- Arrows and dots ---------- */
.smart-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  cursor: pointer;
  line-height: 0;
  transition: background-color .2s, opacity .2s;
}

.smart-slider__arrow:hover,
.smart-slider__arrow:focus {
  background: rgba(0, 0, 0, .7);
}

.smart-slider__arrow[disabled] {
  opacity: .3;
  cursor: default;
}

.smart-slider__arrow--prev { left: 12px; }
.smart-slider__arrow--next { right: 12px; }

.smart-slider__arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.smart-slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 5;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.smart-slider__dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.smart-slider__dot::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
  transition: background-color .2s, transform .2s;
}

.smart-slider__dot.is-active::after {
  background: #fff;
  transform: scale(1.25);
}

@media (max-width: 600px) {
  .smart-slider__arrow { width: 34px; height: 34px; margin-top: -17px; }
  .smart-slider__arrow--prev { left: 6px; }
  .smart-slider__arrow--next { right: 6px; }
  .smart-slider__caption--left,
  .smart-slider__caption--right { max-width: 90%; }
}

/* ---------- Fade transition ---------- */
.smart-slider.is-fade .smart-slider__viewport {
  display: grid;
  overflow: hidden;
  scroll-snap-type: none;
}

.smart-slider.is-fade .smart-slider__slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .6s ease, visibility 0s linear .6s;
}

.smart-slider.is-fade .smart-slider__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
  transition: opacity .6s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .smart-slider.is-fade .smart-slider__slide,
  .smart-slider.is-fade .smart-slider__slide.is-active,
  .smart-slider__dot::after,
  .smart-slider__arrow { transition: none; }
}

/* ---------- Buttons: as many as the slide has, in a row that wraps ---------- */
.smart-slider__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6em;
}

.smart-slider__caption--left .smart-slider__buttons { justify-content: flex-start; }
.smart-slider__caption--center .smart-slider__buttons { justify-content: center; }
.smart-slider__caption--right .smart-slider__buttons { justify-content: flex-end; }

/* The link of the whole image sits under the caption (z-index 2 against 3) and the caption lets the pointer through, so only the
   buttons themselves (pointer-events: auto) take the click; anywhere else on the image goes to the image's link. */

/* ---------- Banners layout: every slide at once, side by side ---------- */
/* The columns (--sb-cols), the gap (--sb-gap) and the phone columns are set per slider (an inline <style> next to it).
   A centered flex row, not a grid: a last row with fewer banners than columns (3 in 4) sits in the middle instead of on the left. */
.smart-banners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sb-gap, 16px);
  width: 100%;
  margin: 0 auto 20px;
  box-sizing: border-box;
}

.smart-banners *,
.smart-banners *::before,
.smart-banners *::after {
  box-sizing: border-box;
}

.smart-banner {
  position: relative;
  min-width: 0;
  overflow: hidden;
  /* N banners per row: the width left after the gaps, divided by N (a hair less so rounding never wraps the last one). */
  flex: 0 0 calc((100% - (var(--sb-cols, 2) - 1) * var(--sb-gap, 16px)) / var(--sb-cols, 2) - .02px);
}

/* The text was sized for a full-width slide; a banner is narrower, so the more columns, the smaller it is. */
.smart-banners .smart-slider__caption--left,
.smart-banners .smart-slider__caption--right { max-width: 90%; }
.smart-banners .smart-slider__caption { padding: 0 5%; }
.smart-banners--c1 .smart-slider__title { font-size: clamp(1.25rem, 3vw, 2.4rem); }
.smart-banners--c2 .smart-slider__title { font-size: clamp(1.05rem, 2.2vw, 1.9rem); }
.smart-banners--c3 .smart-slider__title { font-size: clamp(.95rem, 1.7vw, 1.5rem); }
.smart-banners--c4 .smart-slider__title { font-size: clamp(.9rem, 1.35vw, 1.2rem); }
.smart-banners--c1 .smart-slider__subtitle { font-size: clamp(.9rem, 1.4vw, 1.15rem); }
.smart-banners--c2 .smart-slider__subtitle { font-size: clamp(.85rem, 1.2vw, 1rem); }
.smart-banners--c3 .smart-slider__subtitle,
.smart-banners--c4 .smart-slider__subtitle { font-size: clamp(.8rem, 1vw, .9rem); }
.smart-banners--c3 .smart-slider__btn,
.smart-banners--c4 .smart-slider__btn { padding: .45em 1em; font-size: .85em; }

@media (max-width: 600px) {
  .smart-banners .smart-slider__title { font-size: clamp(.95rem, 4.2vw, 1.4rem); }
  .smart-banners .smart-slider__subtitle { font-size: clamp(.8rem, 3vw, .95rem); }
}
