/* assets/css/tour.css — صفحه‌ی تور مجازی (/tour/) */

.tr-frame {
  position: relative; background: #0f1b25; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--vk-line);
}
.tr-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 340px; max-height: 78vh;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
}
.tr-stage.is-drag { cursor: grabbing; }
.tr-stage:focus-visible { outline: 3px solid var(--vk-gold); outline-offset: -3px; }
.tr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tr-frame.is-fs, .tr-frame.tr-pseudo-fs { border-radius: 0; border: 0; display: flex; flex-direction: column; }
.tr-frame.tr-pseudo-fs { position: fixed; inset: 0; z-index: 9999; }
.is-fs .tr-stage, .tr-pseudo-fs .tr-stage { flex: 1; aspect-ratio: auto; max-height: none; }

.tr-loading {
  position: absolute; inset: 0; z-index: 3; display: none; align-items: center; justify-content: center;
  background: rgba(15, 27, 37, .72); color: #fff; font-weight: 700; font-size: .95rem; text-align: center; padding: 20px;
}
.tr-loading.on { display: flex; }
.tr-loading::before {
  content: ""; width: 22px; height: 22px; margin-inline-end: 12px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: tr-spin .8s linear infinite;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }

.tr-bar {
  position: absolute; z-index: 2; inset-inline: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; background: linear-gradient(0deg, rgba(10, 18, 26, .78), rgba(10, 18, 26, 0)); pointer-events: none;
}
.tr-title { color: #fff; font-weight: 800; font-size: 1rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.tr-tools { display: flex; gap: 8px; pointer-events: auto; direction: ltr; }
.tr-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .28); cursor: pointer;
  background: rgba(15, 27, 37, .55); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .2s, transform .2s; padding: 0;
}
.tr-btn:hover { background: rgba(18, 159, 216, .85); transform: translateY(-1px); }
.tr-btn.on { background: rgba(18, 159, 216, .9); border-color: transparent; }
.tr-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tr-hint {
  position: absolute; z-index: 2; top: 14px; inset-inline-start: 14px; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(15, 27, 37, .6); color: #fff; font-size: .8rem; font-weight: 700; padding: 7px 14px; border-radius: 99px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; animation: tr-hint 1s 7s forwards;
}
.tr-hint svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes tr-hint { to { opacity: 0; visibility: hidden; } }

/* انتخاب صحنه */
.tr-scenes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
.tr-scene {
  display: flex; align-items: center; gap: 14px; text-align: start; font: inherit; cursor: pointer; padding: 10px;
  background: #fff; border: 2px solid var(--vk-line); border-radius: 16px; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tr-scene:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tr-scene.active { border-color: var(--vk-gold); box-shadow: 0 8px 24px rgba(18, 159, 216, .2); }
.tr-scene img { width: 128px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: var(--vk-cream-2); }
.tr-scene strong { display: block; color: var(--vk-navy); font-size: .98rem; font-weight: 800; }
.tr-scene span { display: block; color: var(--text3); font-size: .82rem; line-height: 1.8; margin-top: 2px; }

/* فال‌بک بدون WebGL */
.tr-flat { display: none; }
.no-gl .tr-stage { display: none; }
.no-gl .tr-bar .tr-tools, .no-gl .tr-hint { display: none; }
.no-gl .tr-flat { display: block; overflow-x: auto; background: #0f1b25; -webkit-overflow-scrolling: touch; }
.no-gl .tr-flat img { display: block; height: min(60vh, 420px); width: auto; max-width: none; }
.no-gl .tr-bar { position: static; background: #0f1b25; }

/* راهنما */
.tr-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tr-tip { background: #fff; border: 1px solid var(--vk-line); border-radius: var(--radius); padding: 24px; }
.tr-tip .vk-i { width: 28px; height: 28px; color: var(--vk-gold-d); margin-bottom: 10px; }
.tr-tip h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 6px; }
.tr-tip p { color: var(--text2); font-size: .92rem; line-height: 2; }

@media (max-width: 860px) {
  .tr-scenes { grid-template-columns: 1fr; }
  .tr-tips { grid-template-columns: 1fr; }
  .tr-stage { aspect-ratio: 4 / 5; max-height: 70vh; min-height: 320px; }
  .tr-scene img { width: 104px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-hint { animation: none; }
  .tr-loading::before { animation-duration: 2s; }
}
