/* --- Styles for the "Rétroviseur" Image Comparison Component --- */
.retro-container {
  position: relative;
  /* MODIFIED: Let container fit its content and center it */
  width: fit-content;
  margin: 0 auto;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  cursor: default; /* The cursor is managed by JS for better precision */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  line-height: 0; /* Prevents phantom space under images */
}

/* The base image dictates the container's size */
.retro-image-before {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none; /* Prevents context menu and image dragging */
}

.retro-image-after-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Important for clip-path to work everywhere */
}

/* The top image must cover the base image's area without distortion */
.retro-image-after {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.retro-slider {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: rgba(255, 255, 255, 0.8);
  transform: translateX(-1.5px); /* Centers the line on the exact position */
  cursor: ew-resize;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retro-handle {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  color: #5f2f00;
  transition: transform 0.2s ease;
  position: relative; /* To position the arrows */
}

.retro-container:hover .retro-handle {
    transform: scale(1.1);
}

/* Creating arrows with borders */
.retro-handle::before,
.retro-handle::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.retro-handle::before {
    border-width: 6px 8px 6px 0;
    border-color: transparent #5f2f00 transparent transparent;
    left: 8px; /* Positions the left arrow */
}

.retro-handle::after {
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent #5f2f00;
    right: 8px; /* Positions the right arrow */
}