/* Hero 3D viewer */
.hero-canvas {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: clamp(280px, 52vw, 420px);
  margin: 0 auto 48px;
  background: transparent;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  contain: layout paint size;
}

.hero-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: pan-y;
  outline: none;
}

.hero-canvas__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hero-canvas__placeholder::after {
  content: "";
  width: 36px;
  height: 36px;
  border: 3px solid rgba(2, 161, 58, 0.2);
  border-top-color: #02a13a;
  border-radius: 50%;
  animation: hero-3d-spin 0.9s linear infinite;
}

.hero-canvas.is-loaded .hero-canvas__placeholder {
  opacity: 0;
}

.hero-canvas.is-error .hero-canvas__placeholder::after {
  display: none;
}

.hero-canvas__error {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted, #475569);
}

.hero-canvas.is-error .hero-canvas__error {
  display: flex;
}

@keyframes hero-3d-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 767px) {
  .hero-canvas {
    max-width: 100%;
    height: clamp(240px, 68vw, 340px);
    margin-bottom: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-canvas__placeholder::after {
    animation: none;
    border-top-color: rgba(2, 161, 58, 0.35);
  }
}
