/* Slider Container (in modal) */
.ba-slider-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4/3;
  overflow: hidden;
  margin: 20px auto;
  border-radius: 8px;
}

.ba-slider-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-after {
  clip-path: inset(0 50% 0 0);
  z-index: 2;
}
.ba-before {
  z-index: 1;
}

/* Slider Handle */
.ba-slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: #fff;
  cursor: ew-resize;
  z-index: 3;
}
.ba-slider-handle:hover { background: #f0f0f0; }

/* Labels */
.ba-label {
  position: absolute;
  bottom: 10px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  font-family: sans-serif;
  border-radius: 4px;
  pointer-events: none;
  z-index: 4;
}
.ba-label-before { left: 10px; }
.ba-label-after  { right: 10px; }

/* Main Image (preview) */
.ba-main-image-wrapper {
  position: relative;
  text-align: center;
  margin: 0 auto 10px auto;
  width: 370px;   /* requested size */
  height: 265px;  /* requested size */
  cursor: pointer;
}
.ba-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
  z-index: 1;
}
.ba-main-image-wrapper:hover .ba-main-image { transform: scale(1.02); }

/* Hover Text on preview */
.ba-main-hover-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: sans-serif;
  background: rgba(0,0,0,0.5);
  padding: 6px 14px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* ensure overlay never blocks clicks */
  z-index: 2;
}
.ba-main-image-wrapper:hover .ba-main-hover-text { opacity: 1; }

/* Caption under preview (outside wrapper in markup) */
.ba-caption {
  text-align: center;
  font-size: 14px;
  color: #333;
  font-family: sans-serif;
  margin-top: 6px;
  /* no pointer-events change needed since it's outside the wrapper */
}

/* Modal */
.ba-modal {
  display: none;
  position: fixed;
  z-index: 2147483647;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  padding-top: 60px;
  overflow: auto;
}
.ba-modal-content {
  margin: auto;
  padding: 0;
  max-width: 90%;
  width: 95%;
  background: transparent;
  border-radius: 8px;
  box-shadow: none;
  position: relative;
}

/* Close Button */
.ba-close {
  color: #fff;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}
.ba-close:hover { color: #ccc; }

/* Responsive */
@media (max-width: 768px) {
  .ba-slider-container { aspect-ratio: 1.5/1; }
  .ba-label { font-size: 12px; padding: 4px 8px; }
  .ba-main-hover-text { font-size: 12px; padding: 4px 8px; }

  .ba-main-image-wrapper {
    width: 100%;
    max-width: 95%;
    height: auto;
  }
  .ba-main-image {
    height: auto;
  }
}
