/* ==========================================================================
   Lazy Days – Raumprobe "In deinem Raum ansehen" (Dialog auf der Produktseite)
   Nur geladen, wenn das Stück einen Freisteller hat (produkt.php). Logik: raumprobe.js.
   ========================================================================== */
.roomtest {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--r-l);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
  overflow: auto;
  overscroll-behavior: contain;
}
.roomtest::backdrop { background: var(--overlay); }
.roomtest[open] { animation: roomtest-in 180ms var(--ease); }
@keyframes roomtest-in { from { opacity: 0; } to { opacity: 1; } }
.roomtest__inner { display: grid; gap: 14px; padding: clamp(18px, 3vw, 28px); }
.roomtest__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.roomtest__title { font-size: var(--fs-h4); margin: 0; }
.roomtest__close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.roomtest__close:hover { border-color: var(--ink); }
.roomtest__close .icon { width: 18px; height: 18px; }
.roomtest__privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--r-s);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
  font-size: var(--fs-s);
}
.roomtest__privacy .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--success-ink); }
.roomtest__privacy strong { color: var(--ink); }

.roomtest__pick { display: grid; gap: 14px; padding: 8px 0 4px; }
.roomtest__pick > p { margin: 0; }
.roomtest__pick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.roomtest__file { position: relative; cursor: pointer; }
.roomtest__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.roomtest__file:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.roomtest__tip { font-size: var(--fs-s); color: var(--muted); }
.roomtest__error { color: var(--danger-ink); font-size: var(--fs-s); }

.roomtest__work { display: grid; gap: 12px; }
.roomtest__stage {
  display: grid;
  place-items: center;
  border-radius: var(--r-m);
  background: var(--stage);
  overflow: hidden;
  touch-action: none;
}
.roomtest__canvas {
  display: block;
  max-width: 100%;
  max-height: min(62dvh, 620px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.roomtest__canvas.is-dragging { cursor: grabbing; }
.roomtest__canvas.is-measuring { cursor: crosshair; }
.roomtest__canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.roomtest__help { margin: 0; font-size: var(--fs-xs); color: var(--muted); }

.roomtest__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.roomtest__range { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.roomtest__range label { font-size: var(--fs-s); font-weight: 600; color: var(--ink); }
.roomtest__range input { flex: 1; min-width: 0; accent-color: var(--accent-strong); height: 28px; }
.roomtest__controls [aria-pressed="true"] { --btn-border: var(--ld-orange); color: var(--accent-ink); background: var(--accent-soft); }

.roomtest__scalebox {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--ld-orange);
  border-radius: var(--r-m);
  background: color-mix(in srgb, var(--ld-orange) 5%, var(--surface));
  font-size: var(--fs-s);
}
.roomtest__scalebox p { margin: 0; }
.roomtest__scale-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.roomtest__scale-row label { font-weight: 600; color: var(--ink); }
.roomtest__cm { display: inline-flex; align-items: center; gap: 6px; }
.roomtest__cm .input { width: 96px; }

.roomtest__note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: var(--fs-s);
  color: var(--text);
}
.roomtest__note .icon { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--muted); }
.roomtest__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.roomtest__small { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.roomtest__small a { color: var(--accent-ink); text-underline-offset: 3px; overflow-wrap: anywhere; }

body.is-roomtest { overflow: hidden; }

@media (max-width: 599px) {
  .roomtest { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .roomtest__inner { padding: 14px 16px 20px; }
  .roomtest__canvas { max-height: 52dvh; }
  .roomtest__controls .btn { flex: 1 1 auto; }
  .roomtest__actions .btn { flex: 1 1 100%; }
}
