.pc3d {
  --pc3d-accent: #1e4a8a;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #eef1f5 70%, #e3e7ee 100%);
  font-family: "Roboto", Arial, sans-serif;
  color: #1f2937;
  user-select: none;
  container-type: inline-size;
}
.pc3d-stage, .pc3d-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.pc3d-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-size: 14px; color: #4b5563; pointer-events: none;
}
.pc3d-loading[hidden], .pc3d-hint[hidden], .pc3d-qr[hidden], .pc3d [hidden] { display: none !important; }
.pc3d-spinner { width: 36px; height: 36px; border: 3px solid #cbd5e1; border-top-color: var(--pc3d-accent); border-radius: 50%; animation: pc3d-spin 0.9s linear infinite; }
@keyframes pc3d-spin { to { transform: rotate(360deg); } }
.pc3d-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: 90%;
  padding: 8px 14px; border-radius: 18px; background: rgba(17, 24, 39, 0.75); color: #fff; font-size: 13px; text-align: center;
}
.pc3d-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.86); box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12); backdrop-filter: blur(6px);
}
/* Cùng dòng: thanh trượt lấy gần hết chỗ dư (999 : 1). Nút xuống dòng riêng (khung hẹp): nút AR / VR giãn lấp chỗ trống. */
.pc3d-explode { display: flex; align-items: center; gap: 8px; flex: 999 1 200px; min-width: 160px; }
.pc3d-explode svg { width: 20px; height: 20px; fill: var(--pc3d-accent); flex: none; }
.pc3d-explode input { flex: 1; accent-color: var(--pc3d-accent); }
.pc3d-explode-label { font-size: 12px; white-space: nowrap; color: #374151; }
.pc3d-buttons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; }
.pc3d-buttons button, .pc3d-buttons a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; color: #1f2937; font-size: 13px; cursor: pointer; text-decoration: none;
}
.pc3d-buttons button:hover, .pc3d-buttons a:hover { background: rgba(30, 74, 138, 0.1); color: #1f2937; text-decoration: none; }
.pc3d-buttons svg { width: 20px; height: 20px; fill: currentColor; }
.pc3d-buttons .is-on { color: var(--pc3d-accent); background: rgba(30, 74, 138, 0.12); }
.pc3d-buttons .pc3d-btn-text { background: var(--pc3d-accent); color: #fff; padding: 0 12px; flex: 1 1 auto; justify-content: center; }
.pc3d-buttons .pc3d-btn-text:hover { background: #163a6e; color: #fff; }
.pc3d-qr { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.45); }
.pc3d-qr-box { background: #fff; padding: 16px; border-radius: 12px; text-align: center; max-width: 260px; }
.pc3d-qr-box img { width: 200px; height: 200px; }
.pc3d-qr-box p { margin: 8px 0; font-size: 13px; color: #374151; }
.pc3d-qr-box button { border: 0; border-radius: 6px; padding: 6px 14px; background: var(--pc3d-accent); color: #fff; cursor: pointer; }
.pc3d-in-xr { background: transparent; }
/* Chế độ kính VR kiểu Cardboard: toàn màn hình, nền tối, vạch giữa hai mắt, ẩn thanh công cụ */
.pc3d-cardboard { position: fixed !important; inset: 0; z-index: 2147483000; height: 100% !important; min-height: 0; background: #20262e; }
.pc3d-cardboard .pc3d-bar { display: none; }
.pc3d-cardboard::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.25); pointer-events: none; }
.pc3d-vr-exit {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; border: 0; border-radius: 16px;
  padding: 6px 14px; background: rgba(17, 24, 39, 0.75); color: #fff; font-size: 13px; cursor: pointer;
}
.pc3d-cardboard .pc3d-hint { top: auto; bottom: 16px; }
.pc3d-in-xr .pc3d-stage { visibility: hidden; }
@container (max-width: 620px) {
  .pc3d-explode-label { display: none; }
}
@container (max-width: 420px) {
  .pc3d-btn-text span { display: none; }
}
.pc3d-vr-ready { animation: pc3d-pulse 1.2s ease-in-out infinite; }
@keyframes pc3d-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); } 50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); } }
