/* =========================================================
   ВИРТУАЛЬНЫЙ ТУР — секция на главной + сам просмотрщик фото
   Просмотрщик самостоятелен: подхватывает панораму/зум/хотспоты,
   его можно раскрыть на весь экран кнопкой в правом верхнем углу.
   ========================================================= */

.tour-section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) var(--pad);
  background: linear-gradient(180deg, #0c0c0e 0%, #050506 60%, #0a0a0c 100%);
  color: #fff;
  overflow: hidden;
}

/* Верхний акцент + тонкая точечная текстура — оживляют плоский чёрный фон */
.tour-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 55% at 12% 8%, rgba(200, 16, 46, 0.22), transparent 68%),
    radial-gradient(50% 60% at 92% 88%, rgba(245, 197, 24, 0.14), transparent 70%),
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: auto, auto, 26px 26px;
  background-position: 0 0, 0 0, 0 0;
  pointer-events: none;
}

/* Мягкое сияние прямо за фото-карточкой */
.tour-section::after {
  content: "";
  position: absolute;
  right: 6%;
  top: 50%;
  width: min(46vw, 620px);
  height: min(46vw, 620px);
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(200, 16, 46, 0.32), rgba(245, 197, 24, 0.08) 55%, transparent 72%);
  filter: blur(20px);
  pointer-events: none;
}

@media (max-width: 980px) {
  .tour-section::after {
    right: 50%;
    transform: translate(50%, -50%);
  }
}

.tour-inner {
  position: relative;
  width: min(100%, 1280px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: center;
}

.tour-copy {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

.tour-copy.reveal.is-in {
  opacity: 1;
  transform: none;
}

.tour-copy .eyebrow {
  color: var(--gold);
}

.tour-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tour-copy h2 span {
  color: var(--red-hot);
}

.tour-lead {
  margin: 1rem 0 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* Точки маршрута — короткие чипы вместо пустого места под описанием */
.tour-stops {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tour-stops li {
  position: relative;
  padding: 0.5rem 0.9rem 0.5rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.78);
}

.tour-stops li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--gold);
}

.tour-stops li:nth-child(2)::before { background: var(--red-hot); }
.tour-stops li:nth-child(4)::before { background: var(--red-hot); }

.tour-actions {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tour-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.46);
}

.tour-cta-book {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-pill);
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.tour-cta-book:hover {
  background: var(--red-hot);
  transform: translateY(-2px);
}

.tour-cta-book em {
  font-style: normal;
}

.tour-stage {
  position: relative;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  transition-delay: 0.1s;
}

.tour-stage.reveal.is-in {
  opacity: 1;
  transform: none;
}

.tour-frame-wrap {
  position: relative;
  width: min(100%, 480px);
}

.tour-frame {
  /* Фото клуба сняты вертикально (реальные кадры — 3:4), показываем
     их близко к исходной пропорции, без сильной обрезки. */
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 1.75rem;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.tour-frame:fullscreen,
.tour-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  max-width: none;
}

/* Уголки-«визир» вокруг карточки — фото-декор в духе видоискателя */
.tv-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--gold);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
}

.tv-corner--tl { top: -11px; left: -11px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.tv-corner--tr { top: -11px; right: -11px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.tv-corner--bl { bottom: -11px; left: -11px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.tv-corner--br { bottom: -11px; right: -11px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

/* Бейдж-стикер поверх карточки */
.tour-badge {
  position: absolute;
  top: -16px;
  right: 26px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold), #e8a93f);
  color: #241600;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 26px -6px rgba(232, 195, 122, 0.6), 0 0 0 4px #0b0b0d;
}

.tour-badge svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 980px) {
  .tour-inner {
    grid-template-columns: 1fr;
  }

  .tour-copy {
    text-align: center;
  }

  .tour-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .tour-stops {
    justify-content: center;
  }

  .tour-actions {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .tour-frame-wrap {
    width: min(100%, 380px);
  }

  .tour-frame {
    border-radius: 1.25rem;
  }

  .tv-corner {
    width: 22px;
    height: 22px;
  }

  .tour-badge {
    top: -14px;
    right: 18px;
    font-size: 0.72rem;
    padding: 0.42rem 0.75rem;
  }
}

/* ---------- Просмотрщик: свои переменные, не трогают остальной сайт ---------- */
.tour-viewer {
  --tv-accent: var(--red-hot);
  --tv-accent-2: var(--gold);
  --tv-line: rgba(255, 255, 255, 0.18);
  position: absolute;
  inset: 0;
  background: #000;
  touch-action: none;
  outline: none;
}

.tv-scenes { position: absolute; inset: 0; }

.tv-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s ease;
  z-index: 1;
}

.tv-scene.current { opacity: 1; visibility: visible; z-index: 2; }

.tv-panlayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

.tv-panlayer.dragging { cursor: grabbing; }

.tv-panlayer img,
.tv-panlayer picture {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 124%;
  height: 124%;
}

.tv-panlayer picture {
  display: block;
  transform: translate(-50%, -50%) translate(var(--px, 0px), var(--py, 0px)) scale(var(--pz, 1));
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.tv-panlayer img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.tv-panlayer.live picture { transition: none; }

@keyframes tvDrift {
  0% { --px: -12px; --py: -5px; }
  50% { --px: 12px; --py: 7px; }
  100% { --px: -12px; --py: -5px; }
}

.tv-panlayer.idle picture { animation: tvDrift 17s ease-in-out infinite; }

.tv-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.48) 100%),
    linear-gradient(to top, rgba(4, 3, 8, 0.68) 0%, rgba(4, 3, 8, 0) 26%),
    linear-gradient(to bottom, rgba(4, 3, 8, 0.55) 0%, rgba(4, 3, 8, 0) 22%);
}

/* Hotspot — метка «пройти дальше» */
.tv-hotspot {
  position: absolute;
  z-index: 6;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tv-hotspot .ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: tvRing 2.2s ease-out infinite;
}

.tv-hotspot .ring2 { animation-delay: 0.7s; }

@keyframes tvRing {
  0% { transform: scale(0.62); opacity: 0.9; }
  75% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.tv-hotspot .core {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9b0 30%, var(--tv-accent-2) 78%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55), 0 8px 24px -6px rgba(232, 195, 122, 0.75), 0 0 30px -4px rgba(232, 195, 122, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.tv-hotspot:hover .core { transform: scale(1.08); }
.tv-hotspot:active .core { transform: scale(0.94); }
.tv-hotspot svg { width: 19px; height: 19px; color: #2a1300; }

.tv-hotspot .tip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #fff;
  background: rgba(10, 8, 16, 0.6);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tv-hotspot:hover .tip { opacity: 1; }

.tv-backspot {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 8, 16, 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.35s ease, background 0.15s ease, transform 0.15s ease;
}

.tv-backspot:hover { background: rgba(200, 16, 46, 0.4); }
.tv-backspot:active { transform: scale(0.92); }
.tv-backspot svg { width: 18px; height: 18px; }

/* Верхняя панель — авто-скрытие при бездействии */
.tv-chrome {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.tour-viewer.idle-chrome .tv-chrome { opacity: 0; }
.tour-viewer.idle-chrome .tv-backspot { opacity: 0; pointer-events: none; }

.tv-segments {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 4px;
  padding: 14px 18px 0;
  pointer-events: auto;
}

.tv-segments i {
  flex: 1 1 0;
  height: 2.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  position: relative;
}

.tv-segments i em {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  display: block;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--tv-accent-2), var(--tv-accent));
}

.tv-segments i.done em { width: 100%; }

.tv-topbar {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
  pointer-events: auto;
}

.tv-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  background: rgba(10, 8, 16, 0.42);
  backdrop-filter: blur(6px);
  border: 1px solid var(--tv-line);
  border-radius: 14px;
  padding: 8px 14px;
}

.tv-caption strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tv-caption span {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--tv-accent-2);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tv-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-btn {
  appearance: none;
  border: 1px solid var(--tv-line);
  background: rgba(10, 8, 16, 0.42);
  backdrop-filter: blur(6px);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tv-btn:hover { background: rgba(200, 16, 46, 0.4); }
.tv-btn:active { transform: scale(0.92); }
.tv-btn.active { background: var(--tv-accent); border-color: var(--tv-accent); }
.tv-btn svg { width: 16px; height: 16px; }

.tv-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  pointer-events: none;
  font-size: 12px;
  color: #fff;
  text-align: center;
  background: rgba(10, 8, 16, 0.45);
  backdrop-filter: blur(6px);
  border: 1px solid var(--tv-line);
  padding: 10px 18px;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.6s ease 0.4s;
  max-width: 220px;
}

.tour-viewer.show-hint .tv-hint { opacity: 1; }

.tv-poster {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center 30%;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.tv-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 4, 8, 0.35), rgba(5, 4, 8, 0.75));
}

.tv-poster-play {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
}

.tv-poster-ring {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9b0 30%, var(--gold) 78%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 36px -8px rgba(232, 195, 122, 0.6);
  transition: transform 0.2s ease;
}

.tv-poster:hover .tv-poster-ring { transform: scale(1.06); }
.tv-poster-ring svg { width: 26px; height: 26px; color: #2a1300; margin-left: 3px; }

.tv-poster-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(10, 8, 16, 0.5);
  backdrop-filter: blur(6px);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--tv-line);
}

.tv-poster.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .tv-topbar { padding: 8px 12px 0; }
  .tv-caption strong { font-size: 0.82rem; }
  .tv-backspot { left: 14px; bottom: 18px; width: 40px; height: 40px; }
  .tv-hotspot { width: 54px; height: 54px; }
  .tv-hotspot .core { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-panlayer picture, .tv-scene, .tv-chrome, .tv-hotspot .ring { animation: none !important; transition: none !important; }
}
