/* =============================================================================
   REMORA MEDICAL — 3D Instrument Stage & Architecture Viewer
   Style: Precision dark graphite instrument surface set within editorial paper
   ============================================================================= */

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.product-stage {
  border: 1px solid var(--instrument-border, #22262d);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--instrument-bg, #0e1116);
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.08), 0 16px 36px -12px rgba(10, 10, 10, 0.16);
  position: relative;
}

.product-viewer {
  position: relative;
  width: 100%;
  height: 540px;
}

.product-viewer canvas,
.product-viewer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-viewer canvas {
  opacity: 0;
  touch-action: pan-y;
  transition: opacity 0.3s ease;
}

.product-viewer.model-loaded canvas {
  opacity: 1;
  touch-action: none;
}

.product-viewer.model-loaded img {
  display: none;
}

.product-viewer canvas:focus-visible {
  outline: 2px solid var(--signal-600, #008a93);
  outline-offset: -4px;
}

.model-status {
  margin: 0;
  padding: 10px 18px;
  color: var(--ink-400, #949490);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--instrument-border, #22262d);
  background: rgba(14, 17, 22, 0.95);
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-controls {
  border: 0;
  margin: 0;
  padding: 14px 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--instrument-surface, #161a22);
  border-top: 1px solid var(--instrument-border, #22262d);
  align-items: center;
}

.model-controls legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.model-controls button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xs, 4px);
  color: #efefea;
  background: rgba(255, 255, 255, 0.05);
  padding: 7px 14px;
  min-height: 36px;
  font: inherit;
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.model-controls button:hover,
.model-controls button[aria-pressed="true"] {
  background: rgba(0, 138, 147, 0.25);
  border-color: var(--signal-600, #008a93);
  color: #ffffff;
}

.model-controls button:focus-visible,
.model-controls input:focus-visible {
  outline: 2px solid var(--signal-500, #00a8b0);
  outline-offset: 2px;
}

.model-controls:disabled {
  opacity: 0.45;
}

.model-scrub {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: var(--ink-400, #949490);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

.model-scrub input {
  flex: 1;
  min-width: 0;
  accent-color: var(--signal-600, #008a93);
  height: 28px;
  cursor: pointer;
}

.model-notes h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink, #0a0a0a);
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.model-legend {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

.model-legend li {
  background: var(--paper-white, #ffffff);
  border: 1px solid var(--paper-200, #e3e3de);
  border-left: 3px solid var(--signal-700, #006c75);
  border-radius: var(--radius-sm, 8px);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(10, 10, 10, 0.04));
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.model-legend li:hover {
  transform: translateX(2px);
  border-color: var(--paper-300, #cfcfc8);
}

.model-legend li:nth-child(2) { border-left-color: var(--signal-500, #00a8b0); }
.model-legend li:nth-child(3) { border-left-color: #d97706; }

.model-legend b {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink, #0a0a0a);
  letter-spacing: -0.015em;
  margin-bottom: 0.2rem;
}

.model-legend p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-600, #585853);
}

.model-note {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-500, #70706b);
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-200, #e3e3de);
}

@media (max-width: 1024px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .product-viewer {
    height: 440px;
  }
}

@media (max-width: 640px) {
  .product-viewer {
    height: 340px;
  }
  .model-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .model-controls button {
    width: 100%;
  }
}
