/*
  Тур по комнатам: кнопка на кадре галереи и просмотр на весь экран.

  Подключается только у объявлений с туром — вместе с Pannellum, которому эти
  правила и рассказывают, как выглядеть по-нашему.
*/

/* Плашка на кадре, а не ссылка под описанием: тур — те же фотографии, только
   объёмные, и искать его будут там же, где смотрят снимки. Фирменного цвета:
   это главное, чем объявление с туром отличается от прочих. */
.gallery-tour {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px 7px 10px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 13px var(--font);
  box-shadow: var(--shadow-pop);
  cursor: pointer;
}
.gallery-tour:hover { background: var(--accent-strong); }
.gallery-tour .ic { width: 20px; height: 20px; }

/* Снимков нет — кадр занимает первая комната тура. */
.gallery-tour-cover {
  place-self: stretch;
  padding: 0;
  border: 0;
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

/* ---------- просмотр ---------- */

.tour {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  /* Шапка, сфера, полоса комнат. У тура из одной комнаты полосы нет, и
     третья строка схлопывается. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #000;
}
.tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: #fff;
}
.tour-title {
  min-width: 0;
  overflow: hidden;
  font: 700 16px var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-view { position: relative; min-height: 0; }

/* У Pannellum светлый клетчатый фон — пока грузится комната, он вспыхивает
   белым посреди чёрного окна. */
.tour .pnlm-container { background: #000; }

.tour-rooms {
  display: flex;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.tour-rooms::-webkit-scrollbar { display: none; }
.tour-rooms button {
  flex: 0 0 auto;
  width: 124px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: #151515;
  color: #fff;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  opacity: .7;
  transition: opacity .12s ease, border-color .12s ease;
}
.tour-rooms button:hover { opacity: 1; }
.tour-rooms button.is-on { border-color: var(--accent); opacity: 1; }
/* Превью — развёртка целиком, а в плитку попадает её середина: то, с чего
   начинали снимать и откуда тур и открывается. */
.tour-rooms img { display: block; width: 100%; height: 62px; object-fit: cover; }
.tour-rooms span {
  display: block;
  padding: 5px 8px 6px;
  overflow: hidden;
  font: 600 12.5px var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- стрелки переходов ---------- */

.tour-hotspot { width: 46px; height: 46px; cursor: pointer; }
.tour-hotspot-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #0B3B38;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.tour-hotspot:hover .tour-hotspot-arrow { transform: scale(1.1); }
/* Шеврон «вперёд» из общего набора смотрит вправо; переход — шаг вперёд,
   поэтому поворачиваем его вверх, как стрелки на уличных панорамах. */
.tour-hotspot-arrow .ic { width: 22px; height: 22px; transform: rotate(-90deg); }
.tour-hotspot-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font: 600 12.5px var(--font);
  white-space: nowrap;
  pointer-events: none;
}
