/* Builder — watch assembly canvas, steps, options */
.builder-page {
  margin-top: 20px;
}

.builder-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 22px 0;
}

.builder-hero h1 {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.055em;
  margin: 8px 0;
}

.builder-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 420px;
  gap: 20px;
  align-items: start;
}

.builder-canvas {
  border: 1px solid #ddd3c3;
  border-radius: 28px;
  background: linear-gradient(145deg, #ede4d7, #fbfaf7);
  padding: 22px;
  position: sticky;
  top: var(--header-sticky-top);
  min-height: 760px;
}

.builder-canvas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.builder-stage {
  position: relative;
  width: 760px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: radial-gradient(circle at center, #fff 0 35%, #f0ece5 36% 64%, #e0d3c1 65% 100%);
  border: 1px solid #d6cbbb;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.builder-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #766b5b;
  text-align: center;
  padding: 28px;
}

.builder-image-layer {
  position: absolute;
  transform: translate(-50%, -50%);
  object-fit: contain;
  background: transparent;
}

/* Canvas preview: never use storefront progressive placeholder (blocks dial background). */
.builder-stage .builder-image-layer,
.builder-stage .watch-hand-img {
  animation: none !important;
  filter: none !important;
}

.builder-hands-layer {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: hidden;
  border-radius: 50%;
}

.watch-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--angle, 0deg));
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.watch-hand.hour {
  width: 10px;
  height: 25%;
  background: var(--primary);
  z-index: 1;
}

.watch-hand.minute {
  width: 7px;
  height: 39%;
  background: #1f2937;
  z-index: 2;
}

.watch-hand.second {
  width: 3px;
  height: 43%;
  background: #b91c1c;
  z-index: 3;
}

.watch-hand-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(var(--angle, 0deg));
  transform-origin: 50% 50%;
}

.watch-hand-img.hour { z-index: 1; }
.watch-hand-img.minute { z-index: 2; }
.watch-hand-img.second { z-index: 3; }

.hand-calibration-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 2px solid #6b7280;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  z-index: 4;
  pointer-events: none;
}

.builder-panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  padding: 16px;
  position: sticky;
  top: var(--header-sticky-top);
  min-height: 760px;
  min-width: 0;
  overflow-x: hidden;
}

.builder-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
  gap: 6px;
  margin: 14px 0 16px;
}

.progress-dot {
  height: 16px;
  border-radius: var(--radius-pill);
  background: #ece7df;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 10px;
  padding: 0;
  border-color: #d8d0c4;
  color: #fff;
}

.progress-dot.done {
  background: var(--primary);
}

.progress-dot.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.progress-dot.compat-locked {
  opacity: 1;
  cursor: not-allowed;
  background: #4b5563;
  border-color: #374151;
  color: #fff;
}

.progress-dot.compat-locked::after {
  content: "🔒";
  font-size: 10px;
  transform: translateY(-0.5px);
}

#builderStepContainer {
  height: 460px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.builder-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  overflow: visible;
}

.step-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #eef2ff;
  color: #3730a3;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
}

.step-card.locked {
  opacity: 1;
  background: #4b5563;
  border-color: #374151;
  color: #fff;
}

.step-card.locked .muted {
  color: #d1d5db;
}

.step-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.option-grid {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.option-btn {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--primary);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.option-btn:hover {
  transform: translateY(-2px);
  border-color: #c8ad7f;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.option-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary) inset;
}

.option-btn > div {
  min-width: 0;
  overflow: hidden;
}

.option-btn-title {
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.option-thumb {
  width: 100%;
  max-width: 100%;
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.builder-shell .option-thumb.lazy-img:not(.lazy-loaded) {
  animation: none;
}

.builder-shell .option-thumb.lazy-loading {
  filter: blur(8px);
  opacity: 0.92;
}

.option-btn-text-only {
  align-items: center;
  justify-content: center;
  min-height: 96px;
  text-align: center;
}

.option-default-label {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
