/* Before/After — premium clinical showcase */

.ba-lux {
  --ba-bg: #0e0d0c;
  --ba-text: #f7f4ee;
  --ba-muted: rgba(247, 244, 238, 0.52);
  --ba-gold: #c8b38a;
  --ba-gold-soft: rgba(200, 179, 138, 0.22);
  --ba-glass: rgba(255, 255, 255, 0.045);
  --ba-border: rgba(255, 255, 255, 0.09);
  --ba-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ba-autoplay: 6s;
  position: relative;
  overflow: hidden;
  background: var(--ba-bg);
  color: var(--ba-text);
  padding: clamp(4rem, 8vw, 7rem) 0;
  outline: none;
}

.ba-lux__ambient {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(200, 179, 138, 0.11), transparent 58%),
    radial-gradient(circle at 12% 80%, rgba(255, 255, 255, 0.03), transparent 42%),
    radial-gradient(circle at 88% 65%, rgba(200, 179, 138, 0.05), transparent 40%);
}

.ba-lux__inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

/* Header */
.ba-lux__header {
  max-width: 40rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.ba-lux__eyebrow {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(200, 179, 138, 0.88);
}

.ba-lux__title {
  margin-top: 1rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.ba-lux__title-br {
  display: none;
}

@media (min-width: 640px) {
  .ba-lux__title-br {
    display: block;
  }
}

.ba-lux__lede {
  margin-top: 1.25rem;
  max-width: 32rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ba-muted);
}

/* Carousel track */
.ba-lux__stage-wrap {
  position: relative;
  margin-inline: clamp(-0.5rem, -2vw, 0);
  padding-inline: clamp(2.75rem, 6vw, 3.5rem);
}

.ba-lux__stage-arrow {
  position: absolute;
  top: 58%;
  z-index: 12;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 5vw, 3.25rem);
  height: clamp(2.75rem, 5vw, 3.25rem);
  border-radius: 50%;
  border: 1px solid rgba(200, 179, 138, 0.35);
  background: rgba(28, 27, 26, 0.55);
  color: var(--ba-gold);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    border-color 0.35s var(--ba-ease),
    background 0.35s var(--ba-ease),
    color 0.35s var(--ba-ease),
    transform 0.25s var(--ba-ease);
}

.ba-lux__stage-arrow--prev {
  left: 0;
}

.ba-lux__stage-arrow--next {
  right: 0;
}

@media (hover: hover) {
  .ba-lux__stage-arrow:hover {
    border-color: rgba(200, 179, 138, 0.65);
    background: rgba(200, 179, 138, 0.15);
    color: var(--ba-text);
    transform: translateY(-50%) scale(1.05);
  }
}

.ba-lux__stage-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.ba-lux__stage-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .ba-lux__stage-wrap {
    padding-inline: 2.25rem;
  }

  .ba-lux__stage-arrow {
    top: 52%;
    width: 2.5rem;
    height: 2.5rem;
  }
}

.ba-lux__embla {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}

.ba-lux__embla.is-dragging {
  cursor: grabbing;
}

.ba-lux__embla.is-compare-active {
  cursor: default;
}

.ba-lux__track {
  display: flex;
}

.ba-lux__slide {
  flex: 0 0 100%;
  min-width: 0;
  padding-inline: 0.25rem;
  opacity: 0.35;
  transform: scale(0.96);
  transition:
    opacity 0.8s var(--ba-ease),
    transform 0.8s var(--ba-ease);
}

.ba-lux__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Glass panel — light, airy */
.ba-lux__panel {
  border-radius: 1.5rem;
  border: 1px solid var(--ba-border);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.02) 48%,
    rgba(255, 255, 255, 0.04) 100%
  );
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 80px rgba(0, 0, 0, 0.35),
    0 4px 24px rgba(200, 179, 138, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.ba-lux__panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

@media (min-width: 768px) {
  .ba-lux__panel-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.ba-lux__case-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(200, 179, 138, 0.75);
}

.ba-lux__case-title {
  margin-top: 0.5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  font-weight: 500;
  line-height: 1.15;
}

.ba-lux__case-desc {
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ba-muted);
}

@media (min-width: 768px) {
  .ba-lux__case-desc {
    text-align: right;
  }
}

/* Compare slider — full image visibility */
.ba-compare__frame {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 40px rgba(200, 179, 138, 0.04) inset;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.ba-compare__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(40vh, 360px);
  margin-inline: auto;
  user-select: none;
  touch-action: none;
}

/* Canvas unificat — ambele poze umplu același cadru */
.ba-compare__canvas {
  position: relative;
  display: block;
  flex-shrink: 0;
  margin-inline: auto;
  overflow: hidden;
  line-height: 0;
  isolation: isolate;
  background: #0c0b0a;
  border-radius: 0.75rem;
}

.ba-compare__img {
  opacity: 0;
  transition: opacity 0.55s var(--ba-ease);
  pointer-events: none;
  user-select: none;
}

.ba-compare__img.is-loaded {
  opacity: 1;
}

/* După — strat inferior */
.ba-compare__img--base {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: var(--ba-focus-base, var(--ba-focus, 50% 42%));
  transform: translateY(var(--ba-offset-base-y, 0)) scale(1.02);
  transform-origin: center center;
  will-change: transform;
}

/* Înainte — același cadru, decupat de la stânga */
.ba-compare__reveal {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  height: 100%;
  overflow: hidden;
  will-change: width;
  border-right: 1px solid rgba(200, 179, 138, 0.55);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.28);
}

.ba-compare__img--clip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: var(--ba-cw, 100%);
  height: var(--ba-ch, 100%);
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: var(--ba-focus-clip, var(--ba-focus, 50% 42%));
  transform: translateY(var(--ba-offset-clip-y, 0));
  will-change: transform;
}

.ba-compare__tag {
  position: absolute;
  z-index: 4;
  top: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.ba-compare__tag--before {
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(247, 244, 238, 0.7);
}

.ba-compare__tag--after {
  right: 0.75rem;
  background: rgba(200, 179, 138, 0.18);
  color: var(--ba-gold);
  border: 1px solid rgba(200, 179, 138, 0.25);
}

/* Glass handle */
.ba-compare__handle {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform: translateX(-50%);
  cursor: ew-resize;
  touch-action: none;
}

.ba-compare__handle-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(200, 179, 138, 0.85) 18%,
    rgba(200, 179, 138, 0.85) 82%,
    transparent 100%
  );
  box-shadow: 0 0 16px rgba(200, 179, 138, 0.45);
}

.ba-compare__handle-glow {
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 179, 138, 0.35), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ba-compare__handle-knob {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(200, 179, 138, 0.45);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  color: var(--ba-gold);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition:
    transform 0.35s var(--ba-ease),
    box-shadow 0.35s var(--ba-ease);
}

.ba-compare__handle:hover .ba-compare__handle-glow,
.ba-compare__handle:focus-visible .ba-compare__handle-glow {
  opacity: 1;
}

.ba-compare__handle:hover .ba-compare__handle-knob,
.ba-compare__handle.is-dragging .ba-compare__handle-knob {
  transform: scale(1.06);
  box-shadow:
    0 8px 32px rgba(200, 179, 138, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.ba-compare__handle.is-dragging .ba-compare__handle-knob {
  transform: scale(1.08);
}

.ba-compare__hint {
  margin-top: 0.875rem;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.32);
}

.ba-compare__hint-mobile {
  display: inline;
}

.ba-compare__hint-desktop {
  display: none;
}

@media (min-width: 768px) {
  .ba-compare__hint-mobile {
    display: none;
  }

  .ba-compare__hint-desktop {
    display: inline;
  }
}

/* Footer / pagination */
.ba-lux__footer {
  margin-top: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.ba-lux__pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  width: 100%;
}

.ba-lux__page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 2.75rem;
  padding: 0.25rem 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.35s var(--ba-ease);
}

.ba-lux__page:not(.is-active) {
  opacity: 0.38;
}

.ba-lux__page:hover {
  opacity: 0.75;
}

.ba-lux__page.is-active {
  opacity: 1;
}

.ba-lux__page-num {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
  color: var(--ba-text);
  transition: color 0.35s var(--ba-ease);
}

.ba-lux__page.is-active .ba-lux__page-num {
  color: var(--ba-gold);
}

.ba-lux__page-track {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ba-lux__page-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(200, 179, 138, 0.6), var(--ba-gold));
}

.ba-lux__page.is-active .ba-lux__page-fill.is-animating {
  animation: ba-page-fill var(--ba-autoplay) linear forwards;
}

@keyframes ba-page-fill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.ba-lux__nav-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ba-lux__arrow {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid var(--ba-border);
  background: var(--ba-glass);
  color: rgba(247, 244, 238, 0.75);
  transition:
    border-color 0.35s var(--ba-ease),
    background 0.35s var(--ba-ease),
    color 0.35s var(--ba-ease),
    transform 0.25s var(--ba-ease);
}

.ba-lux__arrow:hover {
  border-color: rgba(200, 179, 138, 0.4);
  background: rgba(200, 179, 138, 0.1);
  color: var(--ba-text);
}

.ba-lux__arrow:active {
  transform: scale(0.94);
}

.ba-lux__status {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 5rem;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  font-variant-numeric: tabular-nums;
  color: rgba(247, 244, 238, 0.4);
}

.ba-lux__status [data-ba-current] {
  color: var(--ba-gold);
}

@media (prefers-reduced-motion: reduce) {
  .ba-lux__slide {
    transition: none;
  }

  .ba-compare__img {
    transition: none;
  }

  .ba-lux__page.is-active .ba-lux__page-fill.is-animating {
    animation: none;
    width: 100%;
  }
}
