/* ========================================
   Before / After Slider – FINAL FIXED CSS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Sofia+Sans:wght@400;500;600;700&display=swap');

/* Main container */
.ba-toggle {
  max-width: 600px;
  margin: 0;
  font-family: 'Sofia Sans', sans-serif;
  position: relative;
}

/* ===============================
   IMAGE WRAPPER (SIZE SOURCE)
   =============================== */
.ba-toggle .ba-images {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  user-select: none;
}

/* Images */
.ba-toggle .ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.ba-toggle .ba-img.active {
  opacity: 1;
  z-index: 2;
}

/* ===============================
   SERVICES OVERLAY (FIXED)
   =============================== */
.ba-services {
  position: relative; /* important */
  width: 100%;
  height: 100%;
  border-radius: 16px;

  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  pointer-events: none;

  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 4;
}

/* Desktop hover ONLY */
@media (hover: hover) and (pointer: fine) {
  .ba-images:hover .ba-services {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }
}

/* Elementor editor safety */
.elementor-editor-active .ba-services {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Services content */
.ba-services ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #ffffff;
  text-align: center;
}

.ba-services li {
  font-size: 18px;
  margin-bottom: 10px;
}

/* ===============================
   JS STATES (MOBILE TAP)
   =============================== */
.ba-services.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(1.02) !important;
}

.ba-services.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}

/* ===============================
   BUTTONS (BELOW IMAGE)
   =============================== */
.ba-toggle .ba-buttons {
  display: flex;
  width: fit-content;
  gap: 14px;
  margin-top: -50px;
  padding: 4px;

  position: relative;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;

  border-radius: 40px;
  background: rgba(0, 0, 0, 0.33);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ba-toggle .ba-btn {
  padding: 10px 26px;
  border-radius: 30px;
  background: transparent;
  border: none;

  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;

  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.ba-toggle .ba-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.ba-toggle .ba-btn.active {
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {
  .ba-toggle {
    max-width: 100%;
  }

  .ba-toggle .ba-buttons {
    margin-top: -40px;
    gap: 10px;
  }

  .ba-toggle .ba-btn {
    font-size: 14px;
    padding: 8px 20px;
  }
}

/* Mobile cursor hint */
@media (hover: none) {
  .ba-images {
    cursor: pointer;
  }
}
