/*
 * Mobile behaviour of the sliders (loaded after styles.css).
 * - Problem/Solution: pinned scroll-driven slides on desktop, stacked blocks on mobile.
 * - Usage steps / about timeline: follow the finger when swiped.
 * - Educational "3 step" and products "featured": a swipeable slider on mobile,
 *   like the usage steps.
 */

/* Swipeable tracks: horizontal drags go to the slider, vertical ones scroll the page. */
.routine-viewport,
.products-featured-slider-wrap,
.educational-slider-wrap {
  touch-action: pan-y;
}

/* PROBLEMA / SOLUZIONE — the .is-static class is set by main.js on mobile only */
.problem-section.is-static {
  height: auto !important;
}

.problem-section.is-static .problem-sticky {
  position: static;
  height: auto;
  overflow: visible;
}

.problem-section.is-static .problem-track {
  height: auto;
}

.problem-section.is-static .story-slide {
  position: relative;
  inset: auto;
  min-height: 0;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: none;
}

.problem-section.is-static .problem-dots {
  display: none;
}

/* Arrows on a light background (educational) */
.routine-footer-dark .routine-arrow {
  border-color: rgba(0, 0, 0, 0.25);
  color: var(--tp-ink, #111);
}

.routine-footer-dark .routine-arrow:hover:not(.is-disabled),
.routine-footer-dark .routine-arrow:focus-visible:not(.is-disabled) {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 991.98px) {
  /* EDUCATIONAL 3 STEP + PRODUCTS FEATURED: one card in view, the next one peeking */
  .products-featured-slider,
  .educational-featured-track {
    display: flex;
    gap: 1rem;
    transform: translateX(var(--featured-offset, 0px)) !important;
    transition: transform 360ms ease;
    will-change: transform;
  }

  .products-featured-slider::after,
  .products-featured-slider[data-visible-count="1"]::after {
    content: none;
  }

  .products-featured-slider .featured-product-card,
  .educational-featured-track .educational-featured-card {
    flex: 0 0 calc(100% - 3rem);
    width: auto;
    opacity: 0.45;
    transition: opacity 260ms ease;
  }

  .products-featured-slider .featured-product-card.is-active,
  .educational-featured-track .educational-featured-card.is-active {
    opacity: 1;
  }

  .educational-slider-wrap {
    border-radius: 0;
  }

  .educational-featured-card {
    border-radius: 20px;
  }
}
