/*
  COMPARISON SLIDER SECTION STYLES
  =================================
  "Find the perfect fit" -- text + buttons on one side, a draggable
  before/after image slider on the other.
*/

.compare-section {
  background-color: #fff4ff; /* confirmed real color from settings_data.json */
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 46px;
  padding: 40px;
}

.compare-section__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  flex: 1;
}

.compare-section__text h2 {
  font-family: var(--font-primary);
  font-size: var(--font-size-h3);
  margin: 0;
  background-color: #584664;
  color: #ffffff;
  padding: 4px 15px;
  display: inline-block;
}

.compare-section__text p {
  font-family: var(--font-body);
  margin: 0;
  background-color: #584664;
  color: #ffffff;
  padding: 4px 8px;
  display: inline-block;
}

.compare-section__buttons {
  display: flex;
  gap: 12px;
}

.compare-section__buttons a {
  font-family: var(--font-body);
  text-decoration: none;
  padding: 10px 28px;
  background-color: #a97cae; /* light purple fill */
  color: #ffffff;
  border: none;
  border-radius: 999px; /* a value this high, relative to the button's small
                            height, makes the corners fully round -- this is
                            the standard trick for a "pill" shaped button */
}

.compare-section__buttons a:hover {
  background-color: #94688f; /* slightly darker on hover, for feedback */
}

/* ===== THE ACTUAL COMPARISON SLIDER WIDGET ===== */

.comparison-slider {
  position: relative;
  width: 65%;
  aspect-ratio: 16 / 10; /* "landscape" ratio, matches your settings */
  overflow: hidden;
  border-radius: 8px;
  cursor: ew-resize; /* shows a left-right resize cursor, hinting it's draggable */
  user-select: none; /* stops the browser from highlighting text while dragging */
}

.comparison-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* prevents images themselves from interfering with drag events */
}

/* The "after" image sits on top, but we clip it so only part of it shows --
   revealing the "before" image underneath on the other side of the handle. */
.comparison-slider__after {
  clip-path: inset(0 0 0 50%); /* starts clipped to show only the right 50% */
}

.comparison-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%; /* starting position: dead center */
  width: 4px;
  background-color: #ffffff;
  transform: translateX(-50%);
}

.comparison-slider__handle::after {
  content: '⟷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  color: #584664;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

@media (max-width: 749px) {
  .compare-section {
    flex-direction: column;
    padding: 32px 20px;
  }

  .comparison-slider {
    width: 100%;
  }
}
