/* ==========================================================================
   CHD Virtual Tour – front-end viewer
   ========================================================================== */

.chd-vtour {
  --chd-vtour-bar: rgba(52, 62, 80, 0.78);
  --chd-vtour-bar-solid: #343e50;
  --chd-vtour-text: #fff;
  --chd-vtour-accent: #fff;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0d0f12;
  color: var(--chd-vtour-text);
  font-family: inherit;
  line-height: 1.3;
  user-select: none;
  -webkit-user-select: none;
}

.chd-vtour[hidden] {
  display: none !important;
}

.chd-vtour--overlay,
.chd-vtour.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100000;
  width: 100%;
  height: 100% !important;
}

.chd-vtour.is-fullscreen {
  width: 100%;
  height: 100% !important;
}

html.chd-vtour-lock,
html.chd-vtour-lock body {
  overflow: hidden !important;
}

.chd-vtour__stage {
  position: absolute;
  inset: 0;
}

.chd-vtour .pnlm-container {
  background: #0d0f12;
  font-family: inherit;
}

.chd-vtour *,
.chd-vtour *::before,
.chd-vtour *::after {
  box-sizing: border-box;
}

/* Our own spinner, messages and scene title replace Pannellum's. */
.chd-vtour .pnlm-load-box,
.chd-vtour .pnlm-error-msg,
.chd-vtour .pnlm-panorama-info {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Buttons (reset theme button styles inside the viewer)
   -------------------------------------------------------------------------- */

.chd-vtour button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  line-height: inherit !important;
  min-width: 0 !important;
  height: auto !important;
  cursor: pointer;
  opacity: 1 !important;
}

.chd-vtour button:focus-visible,
.chd-vtour .chd-vtour-hs:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.chd-vtour .chd-vtour__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px !important;
  flex: 0 0 auto;
}

.chd-vtour-icon {
  display: block;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Top bar: room menu toggle + scene name | logo | close
   -------------------------------------------------------------------------- */

.chd-vtour__topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  height: 40px;
  background: var(--chd-vtour-bar);
}

.chd-vtour__menu-toggle .chd-vtour-icon {
  width: 24px;
  height: 24px;
}

.chd-vtour__scene-title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(30% - 44px); /* stays clear of the centered logo */
  overflow: hidden;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chd-vtour__logo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 40px;
  max-width: 40%;
  padding: 3px 8px;
  background: #fff;
}

.chd-vtour__logo img {
  display: block;
  max-width: 100%;
  max-height: 34px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.chd-vtour__logo span {
  color: #1d2b4f;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chd-vtour .chd-vtour__close {
  margin-left: auto !important;
}

.chd-vtour__close .chd-vtour-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.6;
}

/* --------------------------------------------------------------------------
   Room menu
   -------------------------------------------------------------------------- */

.chd-vtour__menu {
  position: absolute;
  top: 40px;
  left: 0;
  z-index: 3;
  width: 220px;
  max-height: calc(100% - 40px);
  overflow-y: auto;
  background: var(--chd-vtour-bar);
}

.chd-vtour__menu[hidden] {
  display: none;
}

.chd-vtour__menu ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.chd-vtour__menu li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.chd-vtour__menu li::before {
  display: none !important;
}

.chd-vtour .chd-vtour__menu button {
  display: block;
  width: 100%;
  padding: 6px 15px !important;
  font-size: 16px !important;
  text-align: left;
  transition: background-color 0.15s;
}

.chd-vtour .chd-vtour__menu button:hover,
.chd-vtour .chd-vtour__menu button.is-active {
  background: rgba(255, 255, 255, 0.14) !important;
}

.chd-vtour .chd-vtour__menu button.is-active {
  font-weight: 600 !important;
}

/* --------------------------------------------------------------------------
   Left toolbar
   -------------------------------------------------------------------------- */

/* Bottom-left, so a long room list can't cover it; moves up when the thumbnail strip opens. */
.chd-vtour__tools {
  position: absolute;
  left: 0;
  bottom: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: var(--chd-vtour-bar);
  transition: bottom 0.2s;
}

.chd-vtour.is-thumbs-open .chd-vtour__tools {
  bottom: 98px;
}

.chd-vtour .chd-vtour__tools .chd-vtour__btn {
  width: 36px;
  height: 36px !important;
  transition: background-color 0.15s;
}

.chd-vtour .chd-vtour__tools .chd-vtour__btn:hover,
.chd-vtour .chd-vtour__tools .chd-vtour__btn.is-on {
  background: rgba(255, 255, 255, 0.18) !important;
}

/* Play/pause and sound on/off swap icons. */
.chd-vtour__play .chd-vtour-icon--pause,
.chd-vtour__play.is-on .chd-vtour-icon--play,
.chd-vtour__sound .chd-vtour-icon--sound,
.chd-vtour__sound.is-on .chd-vtour-icon--mute {
  display: none;
}

.chd-vtour__play.is-on .chd-vtour-icon--pause,
.chd-vtour__sound.is-on .chd-vtour-icon--sound {
  display: block;
}

.chd-vtour__play .chd-vtour-icon--play {
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Thumbnail strip
   -------------------------------------------------------------------------- */

.chd-vtour__thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 8px;
  overflow-x: auto;
  background: var(--chd-vtour-bar);
  scrollbar-width: thin;
}

.chd-vtour__thumbs[hidden] {
  display: none;
}

.chd-vtour .chd-vtour__thumbs button {
  position: relative;
  flex: 0 0 auto;
  width: 120px;
  height: 66px !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08) !important;
  outline-offset: -2px;
}

.chd-vtour__thumbs img {
  display: block;
  width: 120px;
  height: 66px;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.chd-vtour__thumbs span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chd-vtour__thumbs button:hover img,
.chd-vtour__thumbs button.is-active img {
  opacity: 1;
}

.chd-vtour .chd-vtour__thumbs button.is-active {
  box-shadow: inset 0 0 0 2px #fff !important;
}

/* --------------------------------------------------------------------------
   Hotspots
   -------------------------------------------------------------------------- */

.chd-vtour .chd-vtour-hs {
  position: absolute;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.chd-vtour-hs__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  background: rgba(20, 24, 30, 0.45);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #fff;
  transition: transform 0.2s, background-color 0.2s;
}

.chd-vtour-hs:hover .chd-vtour-hs__icon,
.chd-vtour-hs:focus-visible .chd-vtour-hs__icon,
.chd-vtour-hs.is-open .chd-vtour-hs__icon {
  transform: scale(1.12);
  background: rgba(20, 24, 30, 0.7);
}

.chd-vtour-hs--scene .chd-vtour-hs__icon svg {
  margin-top: -2px;
}

/* Arrow label ("Kitchen") and info text appear above the circle. */
.chd-vtour-hs__label,
.chd-vtour-hs__text {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--chd-vtour-bar-solid);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}

.chd-vtour-hs__text {
  width: max-content;
  max-width: 260px;
  white-space: normal;
  text-align: left;
}

.chd-vtour-hs:hover .chd-vtour-hs__label,
.chd-vtour-hs:focus-visible .chd-vtour-hs__label,
.chd-vtour-hs.is-open .chd-vtour-hs__text {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   Loading and messages
   -------------------------------------------------------------------------- */

.chd-vtour__loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  margin: -22px 0 0 -22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  pointer-events: none;
}

.chd-vtour.is-loading .chd-vtour__loading {
  opacity: 1;
  visibility: visible;
}

.chd-vtour__loading span {
  display: block;
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: chd-vtour-spin 0.9s linear infinite;
}

@keyframes chd-vtour-spin {
  to { transform: rotate(360deg); }
}

.chd-vtour__message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  max-width: 80%;
  padding: 14px 18px;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: var(--chd-vtour-bar-solid);
  font-size: 15px;
  text-align: center;
}

.chd-vtour__message[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   "Virtual Tour" button (mode="button")
   -------------------------------------------------------------------------- */

.chd-vtour-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--charcoal-gray, #373737);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.chd-vtour-open:hover {
  opacity: 0.9;
}

.chd-vtour-missing {
  padding: 12px 16px;
  border: 1px dashed #c3c4c7;
  color: #646970;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .chd-vtour__scene-title {
    font-size: 15px;
  }

  .chd-vtour__logo {
    max-width: 38%;
    padding: 4px 6px;
  }

  .chd-vtour__logo img {
    max-height: 30px;
  }

  .chd-vtour__menu {
    width: 100%;
    max-height: 60%;
  }

  .chd-vtour.is-menu-open .chd-vtour__tools {
    display: none;
  }

  .chd-vtour .chd-vtour__thumbs button,
  .chd-vtour__thumbs img {
    width: 96px;
  }

  .chd-vtour .chd-vtour__thumbs button,
  .chd-vtour__thumbs img {
    height: 54px !important;
  }
}
