/* ==========================================================================
   tour3d-project.css — Шаблон отдельного 3D-тура для страницы проекта
   Spec: docs/specs/tour3d-project-design.md
   - Bootstrap 3 compatible (no d-flex, no gap-*, no ms-* /me-*)
   - Accent color: var(--wd-primary-color, #23a6dd)
   - All classes prefixed: tour3d-project-
   ========================================================================== */

.tour3d-project-section {
  position: relative;
  margin: 35px 0 45px;
  clear: both;
  scroll-margin-top: 85px;
}

/* ===== Заголовок секции (стилистика Cyberstore) ===== */
.tour3d-project-heading {
  margin-bottom: 20px;
  position: relative;
}

.tour3d-project-heading h2 {
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0 0 6px;
  text-transform: none;
}

.tour3d-project-heading .sub-title-item {
  display: block;
  font-size: 14px;
  color: #777;
  font-weight: 400;
}

/* ===== Сцена (Stage + Ratio) ===== */
.tour3d-project-stage {
  position: relative;
  width: 100%;
}

.tour3d-project-ratio {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  /* 16:9 */
  background: #0d0e12;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

@supports (aspect-ratio: 16 / 9) {
  .tour3d-project-ratio {
    height: auto;
    aspect-ratio: 16 / 9;
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  .tour3d-project-ratio {
    padding-bottom: 68%;
    min-height: 290px;
  }

  @supports (aspect-ratio: 16 / 9) {
    .tour3d-project-ratio {
      aspect-ratio: auto;
      height: 0;
      padding-bottom: 68%;
      min-height: 290px;
    }
  }

  .tour3d-project-heading h2 {
    font-size: 20px;
  }
}

/* ===== Абсолютные слои сцены ===== */
.tour3d-project-poster,
.tour3d-project-frame,
.tour3d-project-loader {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
}

/* ===== Постер (кнопка запуска) ===== */
.tour3d-project-poster {
  display: block;
  cursor: pointer;
  background: #000;
  z-index: 3;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  text-align: left;
  outline: none;
}

.tour3d-project-poster:focus-visible {
  outline: 3px solid var(--wd-primary-color, #23a6dd);
  outline-offset: -3px;
}

.tour3d-project-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}

.tour3d-project-poster:hover img {
  transform: scale(1.02);
  filter: brightness(0.92);
}

.tour3d-project-poster.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Кнопка Play */
.tour3d-project-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  display: block;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.tour3d-project-play svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tour3d-project-poster:hover .tour3d-project-play {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Бейдж 360° */
.tour3d-project-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== Прелоадер ===== */
.tour3d-project-loader {
  z-index: 2;
  background: #0d0e12;
  color: #fff;
  display: table;
  text-align: center;
  pointer-events: none;
}

.tour3d-project-loader[hidden] {
  display: none !important;
}

.tour3d-project-loader-inner {
  display: table-cell;
  vertical-align: middle;
}

.tour3d-project-spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--wd-primary-color, #23a6dd);
  border-radius: 50%;
  animation: tour3dProjectSpin 0.9s linear infinite;
  margin-bottom: 12px;
}

@keyframes tour3dProjectSpin {
  to {
    transform: rotate(360deg);
  }
}

.tour3d-project-loader-text {
  display: block;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 14px;
  color: #ddd;
  letter-spacing: 0.3px;
}

/* ===== Iframe ===== */
.tour3d-project-frame {
  z-index: 1;
  background: #000;
}

.tour3d-project-frame[hidden] {
  display: none !important;
}

/* ===== Компактная плашка-«пилюля» метаданных и кнопки разворота (вверху-слева) ===== */
.tour3d-project-meta {
  position: absolute;
  top: 14px;
  left: 14px;
  bottom: auto;
  max-width: 440px;
  z-index: 4;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(13, 14, 18, 0.76);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  line-height: 1.35;
}

/* Контейнер элементов плашки (Bootstrap 3 float-based) */
.tour3d-project-info {
  float: left;
  max-width: 280px;
}

.tour3d-project-title {
  display: block;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.tour3d-project-city {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 2px;
}

.tour3d-project-city .fa {
  color: var(--wd-primary-color, #23a6dd);
  margin-right: 4px;
}

.tour3d-project-actions {
  float: right;
  margin-left: 14px;
  padding-top: 2px;
}

.tour3d-project-btn-fullscreen {
  display: inline-block;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 4px;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  outline: none;
}

.tour3d-project-btn-fullscreen .fa {
  font-size: 12px;
  margin-right: 5px;
}

.tour3d-project-fullscreen-text {
  display: inline;
}

.tour3d-project-btn-fullscreen:hover {
  background: var(--wd-primary-color, #23a6dd);
  border-color: var(--wd-primary-color, #23a6dd);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.tour3d-project-btn-fullscreen:active {
  transform: translateY(0);
}

.tour3d-project-btn-fullscreen:focus-visible {
  outline: 2px solid #ffffff;
}

/* Очистка float */
.tour3d-project-meta::after {
  content: "";
  display: table;
  clear: both;
}

/* Подсказка-кнопка запуска на постере */
.tour3d-project-play-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 14, 18, 0.78);
  color: #ffffff;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.tour3d-project-play-prompt .fa {
  color: var(--wd-primary-color, #23a6dd);
  margin-right: 6px;
}

.tour3d-project-poster:hover .tour3d-project-play-prompt {
  background: var(--wd-primary-color, #23a6dd);
  border-color: var(--wd-primary-color, #23a6dd);
  transform: translateX(-50%) translateY(-2px);
}

.tour3d-project-poster:hover .tour3d-project-play-prompt .fa {
  color: #ffffff;
}

/* Анимация подсветки сцены при переходе по якорю */
@keyframes tour3dProjectPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(35, 166, 221, 0.75);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(35, 166, 221, 0.35);
  }
  100% {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  }
}

.tour3d-project-stage.is-highlighted {
  animation: tour3dProjectPulse 1.4s ease-out;
}

/* ===== Плавающий бейдж перехода к 3D-туру в верхней галерее (Spatial VR Glass) ===== */
a.tour3d-gallery-badge,
.thumbnails a.tour3d-gallery-badge,
.general-image a.tour3d-gallery-badge {
  position: absolute !important;
  bottom: 16px !important;
  right: 16px !important;
  z-index: 25 !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: auto !important;
  height: auto !important;
  padding: 6px 14px 6px 8px !important;
  background: rgba(11, 15, 25, 0.9) !important;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 50px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(35, 166, 221, 0.3) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  line-height: normal !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.28s ease !important;
  user-select: none;
  -webkit-user-select: none;
}

/* Фоновое свечение */
.tour3d-gallery-badge-glow {
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle at 30% 30%, rgba(35, 166, 221, 0.22) 0%, transparent 65%);
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

/* Иконка сферы с пульсирующей точкой */
.tour3d-gallery-badge-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(35, 166, 221, 0.35) 0%, rgba(13, 20, 36, 0.6) 100%);
  border: 1px solid rgba(56, 189, 248, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  margin-right: 10px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  vertical-align: middle;
}

.tour3d-gallery-badge-icon svg {
  display: block;
}

/* Пульсирующий индикатор Live/360 */
.tour3d-gallery-badge-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  border: 1.5px solid #0b0f19;
  box-shadow: 0 0 6px #22c55e;
  animation: tour3dLivePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes tour3dLivePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Текстовый блок надписи */
.tour3d-gallery-badge-title {
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.25px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* Стрелка перехода вниз */
.tour3d-gallery-badge-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.8);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

/* Состояния Hover и Focus */
a.tour3d-gallery-badge:hover,
.thumbnails a.tour3d-gallery-badge:hover,
.general-image a.tour3d-gallery-badge:hover {
  transform: translateY(-3px) scale(1.02) !important;
  background: rgba(8, 12, 22, 0.96) !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 20px rgba(35, 166, 221, 0.35) !important;
  color: #ffffff !important;
}

.tour3d-gallery-badge:hover .tour3d-gallery-badge-icon {
  transform: translateY(-1px) scale(1.08);
  border-color: #38bdf8;
  color: #ffffff;
}

.tour3d-gallery-badge:hover .tour3d-gallery-badge-arrow {
  background: var(--wd-primary-color, #23a6dd);
  color: #ffffff;
  transform: translateY(2px);
}

a.tour3d-gallery-badge:active {
  transform: translateY(-1px) scale(0.98) !important;
}

@media (max-width: 767px) {
  .tour3d-project-section {
    scroll-margin-top: 70px;
  }

  .tour3d-gallery-badge {
    bottom: 10px;
    right: 10px;
    padding: 5px 11px 5px 7px;
  }

  .tour3d-gallery-badge-icon {
    width: 28px;
    height: 28px;
    margin-right: 7px;
  }

  .tour3d-gallery-badge-icon svg {
    width: 15px;
    height: 15px;
  }

  .tour3d-gallery-badge-title {
    font-size: 12px;
  }

  .tour3d-gallery-badge-arrow {
    width: 18px;
    height: 18px;
    margin-left: 7px;
  }

  .tour3d-project-meta {
    top: 10px;
    left: 10px;
    bottom: auto;
    right: auto;
    max-width: calc(100% - 20px);
    padding: 8px 10px;
  }

  .tour3d-project-info {
    max-width: calc(100% - 130px);
  }

  .tour3d-project-title {
    font-size: 13px;
  }

  .tour3d-project-city {
    font-size: 11px;
  }

  /* Акцентная кнопка Fullscreen на мобильных: крупная, с текстом, touch target >= 44px */
  .tour3d-project-btn-fullscreen {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    min-height: 40px;
    background: var(--wd-primary-color, #23a6dd);
    border-color: var(--wd-primary-color, #23a6dd);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(35, 166, 221, 0.4);
  }

  .tour3d-project-btn-fullscreen .fa {
    font-size: 13px;
    margin-right: 5px;
  }

  .tour3d-project-fullscreen-text {
    display: inline !important;
  }

  .tour3d-project-play-prompt {
    bottom: 16px;
    font-size: 12px;
    padding: 6px 14px;
  }
}