/* pwh-swiper-r2.css: the sliders' Swiper layout and first-paint widths
   (POS-1108), the same practice as purewaternv's vendor/pws-swiper.css.
   Swiper's own CSS and JS load only on the first pointerdown, keydown or
   touchstart (SwiperLazyLoad.astro), so until then each track needs the
   widths and gutters Swiper's breakpoints will give it (js/swiper-init-r2.js).
   scripts/check_swiper_fallback.py fails CI if a track loses them. */

/* Keep Swiper 11 layout math, but don't force demo 100% heights onto the cards. */
.swiper {
  height: auto;
}
.swiper-wrapper {
  height: auto;
}
.swiper-slide {
  height: auto;
  box-sizing: border-box;
}
.reviews-track.swiper-wrapper {
  gap: 0;
}
.reviews-track .review-card.swiper-slide {
  flex: 0 0 auto;
}

/* Home page reviews before Swiper loads: 3/2/1 cards with 24px gutters
   (breakpoints 761/521 in swiper-init-r2.js; 3 at most since the slider has
   3 reviews, POS-1161). Dropped once the viewport gets .swiper. */
.reviews-carousel-viewport:not(.swiper) .reviews-track {
  gap: 24px;
}
.reviews-carousel-viewport:not(.swiper) .review-card {
  box-sizing: border-box;
  min-width: 0;
  flex: 0 0 calc((100% - 48px) / 3);
  width: calc((100% - 48px) / 3);
  max-width: calc((100% - 48px) / 3);
}
@media (max-width: 760px) {
  .reviews-carousel-viewport:not(.swiper) .review-card {
    flex-basis: calc((100% - 24px) / 2);
    width: calc((100% - 24px) / 2);
    max-width: calc((100% - 24px) / 2);
  }
}
@media (max-width: 520px) {
  .reviews-carousel-viewport:not(.swiper) .review-card {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }
}

/* Phones and small tablets (the reviews slider's own 760px breakpoint):
   the fixed "Get a Quote" tab (.hsp-pull-tab, right edge, mid-screen)
   covered the Next arrow when the slider sat mid-screen (POS-1161). Here
   Prev and Next sit side by side, centred above the track: never under the
   tab (it is on the right edge) and, with the slider mid-screen, clear of the
   chat and back-to-top buttons along the bottom. The tab itself is
   unchanged. Phones only (760px and down): between 761px and about 1365px
   the tab still overlaps the Next arrow, as on production 3bfeeab; a
   follow-up will decide that. */
@media (max-width: 760px) {
  .reviews-carousel-wrap {
    padding-top: 56px;
  }
  .reviews-carousel-wrap .carousel-btn {
    top: 0;
    transform: none;
  }
  .reviews-carousel-wrap .carousel-btn:hover {
    transform: scale(1.08);
  }
  .reviews-carousel-wrap .carousel-btn-prev {
    left: auto;
    right: calc(50% + 8px);
  }
  .reviews-carousel-wrap .carousel-btn-next {
    right: auto;
    left: calc(50% + 8px);
  }
}
