.erba-widget,
.erba-widget * {
  box-sizing: border-box;
}

.erba-widget {
  --erba-position: 50%;
  --erba-height: 600px;
  --erba-height-tablet: 500px;
  --erba-height-mobile: 420px;
  --erba-gap: 20px;
  width: 100%;
}

.erba-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: var(--erba-gap);
  width: 100%;
}

.erba-media {
  position: relative;
  width: 100%;
  min-width: 0;
  height: var(--erba-height);
  overflow: hidden;
  background: #e9e9e9;
}

.erba-image,
.erba-after-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.erba-image {
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.erba-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e7e7e7, #f7f7f7);
}

.erba-after-layer {
  z-index: 1;
  clip-path: inset(0 0 0 var(--erba-position));
}

.erba-label {
  position: absolute;
  z-index: 4;
  bottom: 20px;
  padding: 8px 12px;
  color: #111;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .08em;
  pointer-events: none;
}

.erba-label-render,
.erba-label-before {
  left: 20px;
}

.erba-label-after {
  right: 20px;
}

.erba-divider {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: var(--erba-position);
  width: 2px;
  color: #fff;
  background: currentColor;
  transform: translateX(-50%);
  pointer-events: none;
}

.erba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 52px;
  height: 52px;
  color: #111;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgb(0 0 0 / 20%);
  transform: translate(-50%, -50%);
}

.erba-chevron {
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.erba-chevron-left { transform: rotate(-45deg); }
.erba-chevron-right { transform: rotate(135deg); }

.erba-range {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}

.erba-comparison:focus-within {
  outline: 3px solid #1769ff;
  outline-offset: 3px;
}

.erba-comparison-column {
  min-width: 0;
}

.erba-endpoints {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding-top: 18px;
}

.erba-endpoint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 42px;
  padding: 0;
  color: #111;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.erba-endpoint:hover {
  color: #fff;
  background: #111;
}

.erba-endpoint:focus-visible {
  outline: 3px solid #1769ff;
  outline-offset: 3px;
}

.erba-is-animating .erba-after-layer,
.erba-is-animating .erba-divider {
  transition: left 240ms ease, clip-path 240ms ease;
}

@media (max-width: 1024px) {
  .erba-media { height: var(--erba-height-tablet); }
}

@media (max-width: 767px) {
  .erba-media { height: var(--erba-height-mobile); }
}

@media (prefers-reduced-motion: reduce) {
  .erba-is-animating .erba-after-layer,
  .erba-is-animating .erba-divider { transition: none; }
}
