.aisthetix-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.aisthetix-result-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--aisthetix-text);
  margin: 0;
}

.aisthetix-view-toggle {
  display: flex;
  background: var(--aisthetix-secondary);
  border-radius: var(--aisthetix-radius);
  padding: 4px;
}

.aisthetix-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--aisthetix-text-muted);
  transition: all 0.2s;
}

.aisthetix-toggle-btn.active {
  background: white;
  color: var(--aisthetix-text);
  box-shadow: var(--aisthetix-shadow);
}

.aisthetix-result-content {
  margin-bottom: 20px;
}

.aisthetix-result-single {
  display: flex;
  justify-content: center;
}

.aisthetix-result-image {
  max-width: 100%;
  /* Viewport-relative so the result actions stay above
     the fold on short screens. A fixed height pushed the CTA out of view. */
  max-height: min(400px, 40vh);
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
  box-shadow: var(--aisthetix-shadow);
}

/* The shopper's photo and generated result share one frame. The native range
   input supplies touch, mouse and keyboard interaction without a drag library. */
.aisthetix-before-after {
  position: relative;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--aisthetix-radius);
  box-shadow: var(--aisthetix-shadow);
}

.aisthetix-before-after:focus-within {
  outline: 3px solid var(--aisthetix-primary);
  outline-offset: 3px;
}

.aisthetix-before-after-original {
  display: block;
  max-width: 100%;
  max-height: min(400px, 40vh);
  width: auto;
  height: auto;
  object-fit: contain;
}

.aisthetix-before-after-result {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  clip-path: inset(0 0 0 var(--aisthetix-split));
}

.aisthetix-before-after-label {
  position: absolute;
  top: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgb(0 0 0 / 65%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.aisthetix-before-after-label-left { left: 10px; }
.aisthetix-before-after-label-right { right: 10px; }

.aisthetix-before-after-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--aisthetix-split);
  width: 2px;
  background: white;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgb(0 0 0 / 65%));
}

.aisthetix-before-after-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--aisthetix-primary);
  color: white;
  font-size: 20px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.aisthetix-before-after-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}

.aisthetix-result-compare {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aisthetix-compare-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aisthetix-compare-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--aisthetix-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aisthetix-compare-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--aisthetix-radius);
}

.aisthetix-compare-divider {
  color: var(--aisthetix-text-muted);
}

.aisthetix-compare-divider svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .aisthetix-result-compare {
    flex-direction: column;
  }

  .aisthetix-compare-divider {
    transform: rotate(90deg);
  }
}
