/* ===== Clogee vergelijk-slider (CSS) ===== */
.cbs {
  --cbs-pos: 50%;
  --cbs-max: 600px;            /* maximale breedte */
  --cbs-ratio: 1 / 1;          /* verhouding van de foto's */
  --cbs-radius: 22px;
  --cbs-accent: #2ec4b6;       /* Clogee-teal */
  --cbs-ink: #0f2340;

  position: relative;
  display: block;
  width: 100%;
  max-width: var(--cbs-max);
  aspect-ratio: var(--cbs-ratio);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--cbs-radius);
  background: #f3f6f6;
  box-shadow: 0 1px 2px rgba(15, 35, 64, .06), 0 26px 50px -26px rgba(15, 35, 64, .38);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.2;
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-user-select: none;
          user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cbs *,
.cbs *::before,
.cbs *::after { box-sizing: border-box; }

/* Lagen: onder = tweede foto, boven = eerste foto (wordt afgeknipt tot de lijn) */
.cbs .cbs-layer { position: absolute; inset: 0; margin: 0; padding: 0; }
.cbs .cbs-layer--before { z-index: 1; clip-path: inset(0 calc(100% - var(--cbs-pos)) 0 0); }
.cbs .cbs-layer--after  { z-index: 0; }
.cbs .cbs-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* Labels zitten ín de laag, dus ze schuiven netjes mee weg met de foto */
.cbs .cbs-label {
  position: absolute;
  top: 14px;
  z-index: 2;
  margin: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 35, 64, .7);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.cbs .cbs-label--before { left: 14px; }
.cbs .cbs-label--after  { right: 14px; background: var(--cbs-accent); }

/* Scheidingslijn + knop */
.cbs .cbs-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--cbs-pos);
  z-index: 3;
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 35, 64, .05), 0 0 16px rgba(15, 35, 64, .28);
  pointer-events: none;
}
.cbs .cbs-handle {
  -webkit-appearance: none;
          appearance: none;
  position: absolute;
  top: 50%;
  left: var(--cbs-pos);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  min-width: 0;
  min-height: 0;
  margin: -27px 0 0 -27px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--cbs-accent);
  box-shadow: 0 8px 22px rgba(15, 35, 64, .28), 0 0 0 1px rgba(15, 35, 64, .05);
  font-size: 0;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: grab;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cbs .cbs-handle svg { display: block; width: 24px; height: 24px; margin: 0; }
.cbs .cbs-handle:hover { transform: scale(1.06); }
.cbs .cbs-handle:focus-visible { outline: 3px solid rgba(46, 196, 182, .6); outline-offset: 3px; }
.cbs.is-dragging { cursor: grabbing; }
.cbs.is-dragging .cbs-handle { transform: scale(1.1); cursor: grabbing; box-shadow: 0 10px 28px rgba(15, 35, 64, .34); }

/* Pulserende ring zolang hij uit zichzelf beweegt */
.cbs.is-auto .cbs-handle::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: cbs-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes cbs-pulse {
  0%   { transform: scale(1);    opacity: .95; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Uitleg-pilletje onderin: verdwijnt na de eerste keer slepen */
.cbs .cbs-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 15px 9px 12px;
  border-radius: 999px;
  background: rgba(15, 35, 64, .74);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.cbs .cbs-hint svg { display: block; width: 18px; height: 18px; flex: none; }
.cbs.is-touched .cbs-hint { opacity: 0; transform: translate(-50%, 10px); }

@media (max-width: 480px) {
  .cbs { --cbs-radius: 18px; }
  .cbs .cbs-handle { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .cbs .cbs-label { top: 12px; padding: 6px 11px; font-size: 11px; }
  .cbs .cbs-label--before { left: 12px; }
  .cbs .cbs-label--after  { right: 12px; }
}

/* Zonder JavaScript: de twee foto's gewoon naast elkaar */
.cbs:not(.cbs-ready) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  aspect-ratio: auto;
  overflow: visible;
  background: none;
  box-shadow: none;
  cursor: auto;
}
.cbs:not(.cbs-ready) > p { display: contents; }
.cbs:not(.cbs-ready) br { display: none; }
.cbs:not(.cbs-ready) img { display: block; width: 100%; height: auto; margin: 0; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  .cbs.is-auto .cbs-handle::before { animation: none; }
}
/* ===== /Clogee vergelijk-slider ===== */
