/* ==========================================================================
   360 Virtual Tour Page
   ========================================================================== */

/* Give the tour section extra breathing room on large monitors, where the
   site's default 1360px container leaves a lot of unused white space */
@media (min-width: 1200px) {
  .tour-section .container {
    max-width: 1500px !important;
  }
}

@media (min-width: 1600px) {
  .tour-section .container {
    max-width: 1680px !important;
  }
}

/* --- Floor tabs --- */
.tour-floor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.tour-floor-tab {
  font-family: var(--myhome-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--myhome-black);
  background: var(--myhome-white);
  border: 1px solid var(--myhome-bdr-color);
  border-radius: 50px;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 152px;
  text-align: center;
}

.tour-floor-tab:hover {
  border-color: var(--myhome-base);
  color: var(--myhome-base);
}

.tour-floor-tab.active {
  background: var(--myhome-base);
  border-color: var(--myhome-base);
  color: var(--myhome-white);
}

.tour-floor-tab .count {
  opacity: 0.7;
  font-weight: 400;
  font-size: 12px;
}

/* --- Viewer --- */
.tour-viewer-wrap {
  position: relative;
  border-radius: var(--myhome-bdr-radius);
  overflow: hidden;
  background: #10110f;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

#tour-panorama {
  width: 100%;
  height: 62vh;
  min-height: 380px;
  max-height: 680px;
}

.tour-autorotate-toggle {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  background: rgba(16, 17, 15, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.25s ease;
}

.tour-autorotate-toggle:hover,
.tour-autorotate-toggle.active {
  background: var(--myhome-base);
}

.tour-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #fff;
  font-family: var(--myhome-font);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #10110f;
  z-index: 3;
  transition: opacity 0.4s ease;
}

.tour-viewer-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.tour-viewer-loading .spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--myhome-primary);
  animation: tour-spin 0.8s linear infinite;
}

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

/* Lightweight indicator for switching between an already-loaded floor's views --
   deliberately not a full opaque overlay, so Pannellum's own scene cross-fade stays visible */
.tour-viewer-loading-mini {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 17, 15, 0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--myhome-font);
  font-size: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: 30px;
  transition: opacity 0.25s ease;
}

.tour-viewer-loading-mini.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.tour-viewer-loading-mini .spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--myhome-primary);
  animation: tour-spin 0.8s linear infinite;
}

.tour-viewer-error {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding: 30px;
  color: #fff;
  background: rgba(16, 17, 15, 0.92);
  font-family: var(--myhome-font);
  transition: opacity 0.25s ease;
}

.tour-viewer-error.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.tour-viewer-error i {
  font-size: 26px;
  color: var(--myhome-base);
}

.tour-viewer-error span {
  font-size: 14px;
  max-width: 340px;
  line-height: 1.6;
  opacity: 0.85;
}

.tour-viewer-error button {
  background: var(--myhome-base);
  color: #fff;
  border: none;
  padding: 9px 26px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.tour-viewer-error button:hover {
  opacity: 0.85;
}

/* Pannellum control bar tint to match theme */
.pnlm-container {
  font-family: var(--myhome-font);
}

.pnlm-controls-container .pnlm-control:hover {
  background-color: var(--myhome-base);
}

.pnlm-compass.pnlm-controls.pnlm-control {
  display: none;
}

/* Shrink Pannellum's built-in scene title so it stays out of the way */
.pnlm-panorama-info {
  left: 14px !important;
  right: auto !important;
  bottom: 14px !important;
  max-width: calc(100% - 70px);
  background: rgba(16, 17, 15, 0.5);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 5px 12px !important;
}

.pnlm-title-box {
  font-size: 12px;
  font-family: var(--myhome-font);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pnlm-author-box {
  display: none;
}

/* --- Thumbnail strip --- */
.tour-thumbs-wrap {
  position: relative;
}

.tour-thumbs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 20px 4px 10px;
  scroll-behavior: smooth;
}

/* Hint that there are more views off-screen in either direction */
.tour-thumbs-fade {
  position: absolute;
  top: 20px;
  bottom: 10px;
  width: 36px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tour-thumbs-fade.is-visible {
  opacity: 1;
}

.tour-thumbs-fade--left {
  left: 0;
  background: linear-gradient(90deg, var(--myhome-white, #fff) 0%, rgba(255, 255, 255, 0) 100%);
}

.tour-thumbs-fade--right {
  right: 0;
  background: linear-gradient(270deg, var(--myhome-white, #fff) 0%, rgba(255, 255, 255, 0) 100%);
}

.tour-thumbs::-webkit-scrollbar {
  height: 6px;
}

.tour-thumbs::-webkit-scrollbar-thumb {
  background: var(--myhome-bdr-color);
  border-radius: 10px;
}

.tour-thumb {
  flex: 0 0 auto;
  width: 130px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.tour-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tour-thumb:hover {
  transform: translateY(-2px);
}

.tour-thumb.active {
  border-color: var(--myhome-primary);
}

.tour-thumb .label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65), transparent);
  color: #fff;
  font-size: 10px;
  padding: 4px 6px 3px;
  font-family: var(--myhome-font);
}

/* --- Instructions row --- */
.tour-instructions {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  margin-top: 22px;
  color: var(--myhome-gray);
  font-family: var(--myhome-font);
  font-size: 13px;
}

.tour-instructions span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tour-instructions i {
  color: var(--myhome-base);
}

/* --- Intro copy under viewer --- */
.tour-intro {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  #tour-panorama {
    height: 46vh;
    min-height: 300px;
  }

  .tour-floor-tab {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 0;
  }

  .tour-thumb {
    width: 100px;
    height: 56px;
  }
}
