/* ════════════════════════════════════════════════
   COMPARE CAROUSEL — before/after slider with
   draggable divider that cycles through pairs
   ════════════════════════════════════════════════ */

.compare-carousel-section {
  background: #0d1118;
  padding: 0;
  overflow: hidden;
}

/* ── Outer wrapper ── */
#compare-carousel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  user-select: none;
}

/* ── Stage ── */
.cc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  cursor: ew-resize;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Fade animation on pair switch */
.cc-stage.cc-fade .cc-bad,
.cc-stage.cc-fade .cc-good {
  animation: ccFadeIn 0.4s ease both;
}
@keyframes ccFadeIn {
  from { opacity: 0.2; }
  to   { opacity: 1; }
}

/* ── Left / Right layers ── */
.cc-layer {
  position: absolute;
  inset: 0;
}

/* GOOD = right side (back layer, always full width) */
.cc-good {
  z-index: 1;
}

/* BAD = left side (front layer, clipped) */
.cc-bad {
  z-index: 2;
  clip-path: inset(0 58% 0 0); /* starts at DEFAULT_POS 42% */
  will-change: clip-path;
}

/* ── Divider line ── */
.cc-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%; /* matches DEFAULT_POS */
  width: 3px;
  background: rgba(255,255,255,0.85);
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
  will-change: left;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* ── Handle ── */
.cc-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  pointer-events: all;
  cursor: ew-resize;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.15s ease;
}
.cc-handle:hover {
  transform: translate(-50%, -50%) scale(1.12);
}
.cc-handle svg {
  width: 100%;
  height: 100%;
}
.cc-handle:focus-visible {
  outline: 3px solid #FE5000;
  outline-offset: 3px;
  border-radius: 50%;
}

/* ── Side labels (BAD / GOOD overlaid on image) ── */
.cc-side-label {
  position: absolute;
  top: 16px;
  z-index: 8;
  font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  pointer-events: none;
}
.cc-bad-label {
  left: 16px;
  background: rgba(180, 30, 30, 0.88);
  color: #fff;
  /* stays visible as long as bad side has width — clip doesn't affect this label */
}
.cc-good-label {
  right: 16px;
  background: rgba(254, 80, 0, 0.9);
  color: #fff;
}

/* ── Caption bar ── */
.cc-caption-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0;
  border-top: 3px solid #FE5000;
}

.cc-caption {
  padding: 14px 20px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #9a9890;
}
.cc-caption--bad {
  background: #0f1118;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.cc-caption--good {
  background: #0f1118;
}

/* ── Dots ── */
.cc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.cc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.2s;
}
.cc-dot:hover {
  background: rgba(255,255,255,0.4);
}
.cc-dot.active {
  background: #FE5000;
  transform: scale(1.25);
}

/* ── Pair label ── */
.cc-pair-label {
  text-align: center;
  margin-top: 8px;
  font-family: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  #compare-carousel {
    padding: 24px 12px 28px;
  }
  .cc-stage {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
  }
  .cc-caption-bar {
    grid-template-columns: 1fr;
  }
  .cc-caption--bad { display: none; } /* show only the good caption on mobile */
  .cc-caption {
    font-size: 0.78rem;
    padding: 10px 14px;
  }
  .cc-handle {
    width: 36px;
    height: 36px;
  }
}
