/* Video testimonials block + popup */

.vt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.vt-testimonials {
  display: block;
}

.jc-checkout-form-container[data-next-show-data="true"] .vt-testimonials {
  margin-top: -8px;
}

.vt__title {
  margin: 0;
  font-family: "Pangram", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: -0.32px;
  color: #000;
}

.vt__list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vt__list::-webkit-scrollbar {
  display: none;
}

.vt__item {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.vt__ring {
  position: relative;
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(244, 140, 150, 0.2);
}

.vt__ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(244, 140, 150, 0.55);
  opacity: 0;
  pointer-events: none;
  animation: none;
}

.vt__item:first-child .vt__ring::after {
  animation: vt-pulse 2.2s ease-out infinite;
}

@media (hover: hover) {
  .vt__item:hover .vt__ring::after {
    animation: vt-pulse 2.2s ease-out infinite;
  }
}

@keyframes vt-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }

  70%,
  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vt__ring::after {
    animation: none !important;
  }

  .vt-popup__video-wrap::before {
    animation: none !important;
  }

  .vt-popup__video {
    filter: none;
    transform: none;
    transition: none;
  }
}

.vt__thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border: 2px solid #f48c96;
  border-radius: 999px;
  overflow: hidden;
}

.vt__thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vt__play {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.vt__play::after {
  content: "";
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
}

/* Popup */

.vt-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vt-popup.is-open {
  display: flex;
}

.vt-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
}

.vt-popup__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 526px;
}

.vt-popup__video-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 397px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 16;
  cursor: pointer;
}

.vt-popup__video-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.18) 48%, transparent 68%),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.16), transparent 42%),
    rgba(0, 0, 0, 0.16);
  background-size: 220% 100%, 100% 100%, 100% 100%;
  background-position: 140% 0, 0 0, 0 0;
  transition: opacity 0.2s ease;
}

.vt-popup__video-wrap.is-switching::before {
  opacity: 1;
  animation: vt-video-shimmer 1.1s ease-in-out infinite;
}

.vt-popup__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
  transition:
    opacity 0.24s ease,
    transform 0.32s ease,
    filter 0.32s ease;
}

.vt-popup__video-wrap.is-switching .vt-popup__video {
  opacity: 0.72;
  filter: blur(5px) saturate(0.85);
  transform: scale(1.025);
}

@keyframes vt-video-shimmer {
  0% {
    background-position: 140% 0, 0 0, 0 0;
  }

  100% {
    background-position: -80% 0, 0 0, 0 0;
  }
}

.vt-popup__controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vt-popup__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
}

.vt-popup__btn svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.vt-popup__icon--pause,
.vt-popup__icon--muted {
  display: none;
}

.vt-popup__btn--play.is-paused .vt-popup__icon--play {
  display: block;
}

.vt-popup__btn--play.is-paused .vt-popup__icon--pause,
.vt-popup__btn--play:not(.is-paused) .vt-popup__icon--play {
  display: none;
}

.vt-popup__btn--play:not(.is-paused) .vt-popup__icon--pause {
  display: block;
}

.vt-popup__btn--mute.is-muted .vt-popup__icon--volume {
  display: none;
}

.vt-popup__btn--mute.is-muted .vt-popup__icon--muted,
.vt-popup__btn--mute:not(.is-muted) .vt-popup__icon--volume {
  display: block;
}

.vt-popup__btn--mute:not(.is-muted) .vt-popup__icon--muted {
  display: none;
}

.vt-popup__progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  overflow: hidden;
}

.vt-popup__progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #fff;
  pointer-events: none;
}

.vt-popup__nav {
  display: none;
}

.vt-popup__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #434780;
  border-radius: 999px;
  background: #fff;
  color: #434780;
  cursor: pointer;
  flex-shrink: 0;
}

.vt-popup__nav-btn.vt-popup__nav-btn--prev {
  transform: rotate(180deg);
}

.vt-popup__nav-btn svg {
  width: 15px;
  height: 28px;
}

.vt-popup__nav-btn--prev svg {
  transform: rotate(180deg);
}

@media (max-width: 767px) {
  video-testimonials {
    display: block;
  }

  .vt {
    overflow: visible;
  }

  .vt__list {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-inline: 16px;
    scroll-padding-inline: 16px;
    box-sizing: border-box;
  }

  .vt-popup {
    padding: 0;
    align-items: stretch;
  }

  .vt-popup__body {
    max-width: none;
    height: 100%;
  }

  .vt-popup__video-wrap {
    max-width: none;
    height: 100%;
    border-radius: 0;
    aspect-ratio: auto;
  }
}

@media (min-width: 768px) {
  video-testimonials,
  .vt,
  .vt__list {
    overflow: visible;
  }

  .vt__list {
    padding: 6px;
    margin: -6px;
  }

  .vt-popup {
    padding: 48px;
  }

  .vt-popup__body {
    gap: 0;
  }

  .vt-popup__video-wrap {
    max-width: 397px;
  }

  .vt-popup__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 526px;
    pointer-events: none;
  }

  .vt-popup__nav-btn {
    pointer-events: auto;
  }
}
