/* ── Visualizer: AI Window & Door Installation Preview ── */

/* Step visibility */
.viz-step { display: none; }
.viz-step--active { display: block; }

/* ── Showcase (hero preview) ── */
.viz-showcase {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
  background: #fff;
}
.viz-showcase__home {
  position: relative;
  line-height: 0;
  overflow: hidden;
  height: 100%;
}
.viz-showcase__home img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.viz-showcase__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.viz-showcase__badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,168,28,.85);
  padding: 4px 10px;
  border-radius: 4px;
}
/* Animated detection markers on the example image */
.viz-showcase__marker {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59,130,246,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: viz-marker-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(59,130,246,.4);
}
.viz-showcase__marker span {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.viz-showcase__marker--1 { top: 60%; left: 50%; }
.viz-showcase__marker--2 { top: 50%; left: 50%; }
.viz-showcase__marker--3 { top: 59%; left: 92%; animation-delay: .4s; background: rgba(249,115,22,.85); box-shadow: 0 0 0 0 rgba(249,115,22,.4); }
@keyframes viz-marker-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,.4); }
  50% { box-shadow: 0 0 0 10px rgba(59,130,246,0); }
}
.viz-showcase__marker--3 {
  animation-name: viz-marker-pulse-orange;
}
@keyframes viz-marker-pulse-orange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,.4); }
  50% { box-shadow: 0 0 0 10px rgba(249,115,22,0); }
}

.viz-showcase__products {
  padding: 18px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.viz-showcase__heading {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  color: #1a1e2e;
}
.viz-showcase__list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.viz-showcase__item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  transition: background .15s;
}
.viz-showcase__item:hover { background: #f8fafc; }
.viz-showcase__item img {
  width: 64px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.viz-showcase__item-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.viz-showcase__item-info strong {
  font-size: 13px;
  color: #1a1e2e;
}
.viz-showcase__item-info span {
  font-size: 11px;
  color: #64748b;
}
.viz-showcase__more {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
  margin: 10px 0 0;
}

/* How-it-works step row */
.viz-steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.viz-steps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  flex: 0 1 150px;
}
.viz-steps-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #00a81c;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.viz-steps-item strong {
  font-size: 13px;
  color: #1a1e2e;
}
.viz-steps-item span {
  font-size: 11px;
  color: #94a3b8;
}
.viz-steps-arrow {
  color: #cbd5e1;
  font-size: 14px;
}

@media (max-width: 575px) {
  .viz-showcase__item img { width: 48px; height: 32px; }
  .viz-steps-arrow { display: none; }
  .viz-steps-row { gap: 12px; }
  .viz-steps-item { flex: 0 1 45%; }
}

.viz-disclaimer-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #166534;
  line-height: 1.5;
  text-align: left;
}

.viz-dropzone {
  position: relative;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: #fafbfc;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viz-dropzone:hover,
.viz-dropzone--dragover {
  border-color: #00a81c;
  background: #f0fdf4;
}
.viz-dropzone__icon {
  font-size: 48px;
  color: #94a3b8;
  margin-bottom: 16px;
}
.viz-dropzone:hover .viz-dropzone__icon { color: #00a81c; }
.viz-dropzone__title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1e2e;
  margin-bottom: 4px;
}
.viz-dropzone__subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 8px;
}
.viz-browse-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #00a81c;
  text-decoration: underline;
  cursor: pointer;
}
.viz-dropzone__hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* Preview */
.viz-dropzone__preview {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
}
.viz-dropzone__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f172a;
}
.viz-dropzone__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.viz-dropzone__remove:hover { background: rgba(220,38,38,.8); }

/* Progress */
.viz-dropzone__progress {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.viz-dropzone__progress-bar {
  width: 60%;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}
.viz-dropzone__progress-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #00c926, #00a81c);
  border-radius: 2px;
  transition: width .3s;
}
.viz-dropzone__progress-text {
  margin-top: 12px;
  font-size: 14px;
  color: #64748b;
}

.viz-upload-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #991b1b;
  margin-top: 12px;
}

.viz-upload-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Editor Section ── */
.viz-editor-section { padding: 16px 0 32px; }

.viz-canvas-wrapper {
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}
.viz-canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #1e293b;
}
.viz-scene-badge {
  background: #334155;
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.viz-detection-count {
  color: #94a3b8;
  font-size: 13px;
  flex: 1;
}
.viz-canvas-container {
  position: relative;
  line-height: 0;
  cursor: crosshair;
}
.viz-canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
}
.viz-canvas-tooltip {
  position: absolute;
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  z-index: 10;
}
.viz-canvas-hint {
  padding: 8px 16px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

/* ── Product Panel ── */
.viz-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  max-height: 720px;
  position: sticky;
  top: 100px;
}
.viz-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.viz-panel__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.viz-panel__count {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}
.viz-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.viz-panel__empty {
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px 8px;
}
.viz-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
}

/* Selection list items */
.viz-sel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
  margin-bottom: 4px;
}
.viz-sel-item:hover { background: #f1f5f9; }
.viz-sel-item--active { background: #f0fdf4; border: 1px solid #bbf7d0; }
.viz-sel-item__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.viz-sel-item--configured .viz-sel-item__num { background: #00a81c; }
.viz-sel-item__label { flex: 1; }
.viz-sel-item__status {
  font-size: 11px;
  color: #94a3b8;
}
.viz-sel-item--configured .viz-sel-item__status {
  color: #00a81c;
}

/* Config panel */
.viz-panel__config {
  border-top: 1px solid #e2e8f0;
  padding: 14px 16px;
  overflow-y: auto;
  max-height: 55%;
}
.viz-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.viz-config-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.viz-config-close {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.viz-config-close:hover { color: #1a1e2e; }
.viz-config-detected {
  font-size: 13px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.viz-config-field { margin-bottom: 14px; }
.viz-config-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.viz-config-select {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* Radio-style option buttons */
.viz-config-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.viz-config-opt {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  color: #475569;
}
.viz-config-opt:hover { border-color: #94a3b8; }
.viz-config-opt--active {
  border-color: #00a81c;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

/* Color swatches */
.viz-config-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.viz-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  position: relative;
}
.viz-swatch:hover { transform: scale(1.12); }
.viz-swatch--active {
  border-color: #00a81c;
  box-shadow: 0 0 0 2px #00a81c;
}
.viz-swatch--white  { background: #ffffff; }
.viz-swatch--bronze { background: #6d4c2e; }
.viz-swatch--black  { background: #1a1a1a; }
.viz-swatch--ivory  { background: #fffff0; }
.viz-swatch--silver { background: #c0c0c0; }
.viz-swatch--anodized-silver { background: linear-gradient(135deg, #b8b8b8, #d4d4d4); }

.viz-config-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* ── Generating Section ── */
.viz-generating-section { min-height: 60vh; display: flex; align-items: center; }

.viz-generating-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}
.viz-generating-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #e2e8f0;
  border-top-color: #00a81c;
  border-radius: 50%;
  animation: viz-spin 1.2s linear infinite;
}
.viz-generating-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #00a81c;
}
@keyframes viz-spin { to { transform: rotate(360deg); } }

.viz-gen-progress {
  width: 200px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  margin: 16px auto 0;
  overflow: hidden;
}
.viz-gen-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00c926, #00a81c);
  width: 0%;
  transition: width .5s;
  border-radius: 2px;
}

/* ── Result Section ── */
.viz-comparison-container {
  max-width: 900px;
  margin: 0 auto;
}
.viz-comparison {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.viz-comparison__before,
.viz-comparison__after {
  position: relative;
}
.viz-comparison__before img,
.viz-comparison__after img {
  width: 100%;
  display: block;
}
.viz-comparison__after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
}
.viz-comparison__after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.viz-comparison__label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 4px;
}
.viz-comparison__label--after {
  left: auto;
  right: 12px;
  background: rgba(0,168,28,.8);
}

/* Drag handle */
.viz-comparison__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.viz-comparison__handle-line {
  flex: 1;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,.3);
}
.viz-comparison__handle-grip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #475569;
  flex-shrink: 0;
}

.viz-result-selections {
  max-width: 600px;
  margin: 20px auto 0;
  font-size: 13px;
  color: #64748b;
}
.viz-result-selections ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.viz-result-selections li {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
}

.viz-result-cta__inner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 24px 28px;
}

.viz-share-copied {
  display: none;
  font-size: 12px;
  color: #00a81c;
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .viz-panel {
    position: static;
    height: auto;
    max-height: none;
    margin-top: 16px;
  }
  .viz-editor-section .row { flex-direction: column; }
}

@media (max-width: 575px) {
  .viz-dropzone { padding: 32px 16px; min-height: 200px; }
  .viz-dropzone__icon { font-size: 36px; }
  .viz-dropzone__title { font-size: 15px; }
  .viz-comparison__handle-grip { width: 28px; height: 28px; font-size: 12px; }
  .viz-result-actions .btn { margin-bottom: 8px; }

  /* Config panel becomes a bottom sheet on mobile */
  .viz-panel__config {
    max-height: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.12);
    padding: 18px 16px 24px;
    max-height: 70vh;
    overflow-y: auto;
    animation: viz-sheet-up .25s ease-out;
  }
  @keyframes viz-sheet-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}
