/* Avada Before & After Carousel */
.ba-carousel {
  --ba-accent: #f65321;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.ba-carousel,
.ba-carousel * {
  box-sizing: border-box;
}

.ba-carousel__slides {
  width: 100%;
}

.ba-carousel__slide {
  display: none;
  width: 100%;
}

.ba-carousel__slide.is-active {
  display: block;
}

.ba-carousel__comparison {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 9px;
  background: #e8e8e8;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

.ba-carousel__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ba-carousel__image--after {
  z-index: 0;
}

.ba-carousel__image--before {
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--ba-position, 50%)) 0 0);
}

.ba-carousel__label {
  position: absolute;
  z-index: 2;
  top: 14px;
  padding: 6px 10px;
  color: #fff;
  background: rgb(0 0 0 / 52%);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .02em;
  pointer-events: none;
}

.ba-carousel__label--before {
  left: 14px;
}

.ba-carousel__label--after {
  right: 14px;
}

.ba-carousel__range {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  touch-action: pan-y;
}

.ba-carousel__range::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.ba-carousel__range::-webkit-slider-thumb {
  width: 42px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

.ba-carousel__range::-moz-range-track {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.ba-carousel__range::-moz-range-thumb {
  width: 42px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ba-carousel__divider {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: var(--ba-position, 50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 3px rgb(0 0 0 / 15%);
  transform: translateX(-50%);
  pointer-events: none;
}

.ba-carousel__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 8px rgb(0 0 0 / 18%);
  transform: translate(-50%, -50%);
}

.ba-carousel__chevron {
  display: block;
  width: 8px;
  height: 8px;
  border-top: 2px solid #31505a;
  border-right: 2px solid #31505a;
}

.ba-carousel__chevron--left {
  transform: rotate(-135deg);
}

.ba-carousel__chevron--right {
  transform: rotate(45deg);
}

.ba-carousel__range:focus-visible ~ .ba-carousel__divider .ba-carousel__handle {
  outline: 3px solid var(--ba-accent);
  outline-offset: 3px;
}

.ba-carousel__caption {
  margin-top: 12px;
  color: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.ba-carousel__pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-top: 24px;
}

.ba-carousel__dot {
  display: grid;
  place-items: center;
  width: 23px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ba-carousel__dot::before {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f8c4b3;
  content: "";
  transition: width .18s ease, height .18s ease, background-color .18s ease;
}

.ba-carousel__dot.is-active::before {
  width: 22px;
  height: 22px;
  background: var(--ba-accent);
}

.ba-carousel__dot:focus-visible {
  outline: 2px solid var(--ba-accent);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .ba-carousel__comparison {
    border-radius: 6px;
  }

  .ba-carousel__label {
    top: 9px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .ba-carousel__label--before {
    left: 9px;
  }

  .ba-carousel__label--after {
    right: 9px;
  }

  .ba-carousel__handle {
    width: 40px;
    height: 40px;
  }

  .ba-carousel__pagination {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ba-carousel__dot::before {
    transition: none;
  }
}
