/* ══════════════════════════════════════════
   Before / After Comparison for Elementor
   ══════════════════════════════════════════ */

.ba-container {
  margin: 0 auto;
  width: 100%;
}

/* ── Viewer ── */
.ba-viewer {
  position: relative;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 12px;
  line-height: 0;
  touch-action: pan-y;
}

.ba-vertical {
  cursor: ns-resize;
  touch-action: pan-x;
}

/* ── Layers ── */
.ba-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ba-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Before = bottom layer, visible fully */
.ba-before {
  position: relative;
  z-index: 1;
}

/* After = on top, clipped */
.ba-after {
  z-index: 2;
  overflow: hidden;
}

/* Horizontal: after clips from the right */
.ba-horizontal .ba-after {
  clip-path: inset(0 0 0 50%);
}

/* Vertical: after clips from the bottom */
.ba-vertical .ba-after {
  clip-path: inset(50% 0 0 0);
}

/* ── Divider ── */
.ba-divider-wrap {
  position: absolute;
  z-index: 10;
  pointer-events: none;
}

.ba-horizontal .ba-divider-wrap {
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ba-vertical .ba-divider-wrap {
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
}

.ba-divider {
  background: #ffffff;
  flex-shrink: 0;
}

.ba-horizontal .ba-divider {
  width: 3px;
  height: 100%;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.ba-vertical .ba-divider {
  height: 3px;
  width: 100%;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

/* ── Handle ── */
.ba-handle {
  position: absolute;
  z-index: 11;
  pointer-events: none;
}

.ba-horizontal .ba-handle {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ba-vertical .ba-handle {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Circle handle */
.ba-handle-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ba-viewer:hover .ba-handle-circle,
.ba-viewer.ba-active .ba-handle-circle {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.ba-handle-circle svg {
  stroke: #ffffff;
  flex-shrink: 0;
}

.ba-vertical .ba-handle-circle {
  flex-direction: column;
}

/* Diamond handle */
.ba-handle-diamond {
  width: 48px;
  height: 48px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.ba-viewer:hover .ba-handle-diamond {
  transform: rotate(45deg) scale(1.1);
}

/* Minimal dot handle */
.ba-handle-dot {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.3), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.ba-viewer:hover .ba-handle-dot {
  transform: scale(1.3);
}

/* ── Labels ── */
.ba-label {
  position: absolute;
  z-index: 8;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(0,0,0,0.55);
  padding: 6px 16px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

/* Horizontal positions */
.ba-horizontal .ba-label-before { left: 16px; }
.ba-horizontal .ba-label-after { right: 16px; }

/* Vertical positions */
.ba-vertical .ba-label-before { top: 16px; left: 50%; transform: translateX(-50%); }
.ba-vertical .ba-label-after { bottom: 16px; left: 50%; transform: translateX(-50%); }

/* Label vertical position */
.ba-label-top {
  top: 16px;
}
.ba-label-center {
  top: 50%;
}
.ba-horizontal .ba-label-center {
  transform: translateY(-50%);
}
.ba-vertical .ba-label-center.ba-label-before {
  top: 25%;
  transform: translate(-50%, -50%);
}
.ba-vertical .ba-label-center.ba-label-after {
  bottom: auto;
  top: 75%;
  transform: translate(-50%, -50%);
}
.ba-label-bottom {
  bottom: 16px;
  top: auto;
}

/* Labels on hover */
.ba-labels-on-hover .ba-label {
  opacity: 0;
}

.ba-labels-on-hover:hover .ba-label,
.ba-labels-on-hover.ba-active .ba-label {
  opacity: 1;
}

/* ── Hover mode cursor ── */
.ba-mode-hover {
  cursor: col-resize;
}
.ba-mode-hover.ba-vertical {
  cursor: row-resize;
}

/* ── Intro animation ── */
.ba-viewer.ba-animate-intro .ba-after,
.ba-viewer.ba-animate-intro .ba-divider-wrap,
.ba-viewer.ba-animate-intro .ba-handle {
  transition: none;
}

.ba-viewer.ba-animating .ba-after {
  transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ba-viewer.ba-animating .ba-divider-wrap {
  transition: left 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .ba-handle-circle {
    width: 40px !important;
    height: 40px !important;
  }
  .ba-handle-circle svg {
    width: 16px;
    height: 16px;
  }
  .ba-label {
    font-size: 10px !important;
    padding: 4px 10px !important;
  }
}
