/* ==========================================================================
   Aranya Living — Immersive 360° VR viewport
   ========================================================================== */

.vr-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0d0805;
  color: #f4e8d4;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s var(--ease), visibility 0.55s;
  overflow: hidden;
  overscroll-behavior: contain;
}

.vr-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.vr-overlay.is-open .vr-dock {
  transform: none;
}

.vr-overlay.is-open .vr-topbar {
  transform: none;
}

.vr-stage {
  position: absolute;
  inset: 0;
  cursor: grab;
  touch-action: none;
}

.vr-stage:active {
  cursor: grabbing;
}

.vr-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Warm vignette + film grain over the WebGL canvas */
.vr-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(130% 105% at 50% 42%, transparent 55%, rgba(12, 7, 4, 0.55) 100%);
}

.vr-vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: radial-gradient(circle at 50% 50%, #fff 0.5px, transparent 0.6px);
  background-size: 3px 3px;
}

/* ---------------- Top bar ---------------- */
.vr-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(13, 8, 5, 0.82), transparent);
  transform: translateY(-18px);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}

.vr-topbar > * {
  pointer-events: auto;
}

.vr-topbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vr-topbar__brand .brand__mark {
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
}

.vr-room-title {
  display: grid;
  gap: 2px;
}

.vr-room-title b {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: #fbf3e4;
  line-height: 1.15;
}

.vr-room-title span {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass-hi);
}

.vr-topbar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vr-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  min-width: 44px;
  padding: 0 15px;
  border-radius: var(--r-full);
  border: 1px solid rgba(220, 187, 121, 0.35);
  background: rgba(20, 12, 6, 0.55);
  backdrop-filter: blur(12px);
  color: rgba(246, 234, 214, 0.85);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s;
}

.vr-tool:hover {
  border-color: var(--brass-hi);
  color: #fbf3e4;
  transform: translateY(-1px);
}

.vr-tool.is-on {
  background: linear-gradient(135deg, var(--brass), var(--brass-hi));
  color: #241505;
  border-color: transparent;
}

.vr-tool svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.vr-tool--label span {
  display: inline;
}

/* ---------------- Hotspot layers ---------------- */
.vr-hotspots {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.vr-hotspots.is-off {
  opacity: 0;
  pointer-events: none !important;
}

.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s var(--ease);
  will-change: transform;
}

.hotspot__dot {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 236, 200, 0.95);
  background: rgba(20, 12, 6, 0.45);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.hotspot__dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass-hi);
  box-shadow: 0 0 12px var(--brass-hi);
}

.hotspot__dot::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(220, 187, 121, 0.7);
  animation: hotspotPing 2.4s var(--ease) infinite;
}

@keyframes hotspotPing {
  0% {
    transform: scale(0.62);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.hotspot__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(6px);
  padding: 9px 15px;
  border-radius: 12px;
  background: rgba(20, 12, 6, 0.92);
  border: 1px solid rgba(220, 187, 121, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.hotspot__label b {
  display: block;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fbf3e4;
  line-height: 1.25;
}

.hotspot__label span {
  font-size: 0.72rem;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot:hover .hotspot__dot,
.hotspot.is-active .hotspot__dot {
  transform: scale(1.22);
  background: rgba(185, 138, 60, 0.7);
}

.hotspot.is-active .hotspot__dot {
  border-color: #fff3dd;
  box-shadow: 0 0 0 4px rgba(185, 138, 60, 0.28), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.hotspot.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------------- Info panel ---------------- */
.vr-panel {
  position: absolute;
  z-index: 9;
  top: 84px;
  right: clamp(14px, 2.6vw, 30px);
  width: min(400px, calc(100vw - 28px));
  max-height: calc(100% - 190px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(253, 250, 243, 0.98);
  color: var(--ink);
  border: 1px solid rgba(185, 138, 60, 0.4);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  transform: translateX(26px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}

.vr-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.vr-panel__head {
  position: relative;
  padding: 22px 24px 18px;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(185, 138, 60, 0.2), transparent 60%),
    linear-gradient(150deg, var(--espresso), #2a1c11);
  color: #f4e8d4;
}

.vr-panel__head .cat {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass-hi);
  margin-bottom: 8px;
}

.vr-panel__head h3 {
  margin: 0 0 2px;
  font-size: 1.42rem;
  color: #fbf3e4;
  line-height: 1.2;
}

.vr-panel__head .tamil {
  font-size: 0.86rem;
  color: rgba(246, 234, 214, 0.7);
}

.vr-panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(246, 234, 214, 0.25);
  color: rgba(246, 234, 214, 0.85);
  display: grid;
  place-items: center;
  transition: border-color 0.3s, transform 0.3s;
}

.vr-panel__close:hover {
  border-color: var(--brass-hi);
  transform: rotate(90deg);
}

.vr-panel__body {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  align-content: start;
}

.vr-panel__price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line-strong);
}

.vr-panel__price b {
  font-family: var(--serif);
  font-size: 1.72rem;
  font-weight: 600;
  color: var(--brass-deep);
  font-variant-numeric: tabular-nums;
}

.vr-panel__price span {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.vr-panel__desc {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-soft);
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.spec {
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--ivory);
  border: 1px solid var(--line);
}

.spec dt {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
}

.spec dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mat-chips .chip {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.74rem;
}

.vr-panel__foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper), var(--ivory));
}

.vr-panel__foot .btn {
  padding: 13px 20px;
  font-size: 0.72rem;
}

/* ---------------- Dock ---------------- */
.vr-dock {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: clamp(14px, 2.6vh, 26px);
  transform: translateX(-50%) translateY(24px);
  width: min(1080px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-radius: 24px;
  background: rgba(16, 10, 6, 0.72);
  border: 1px solid rgba(220, 187, 121, 0.26);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  transition: transform 0.65s var(--ease);
}

.vr-dock__rooms {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.vr-dock__rooms::-webkit-scrollbar {
  display: none;
}

.room-chip {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 11px;
  padding: 7px 16px 7px 7px;
  border-radius: 16px;
  border: 1px solid rgba(246, 234, 214, 0.14);
  background: rgba(255, 250, 240, 0.04);
  color: rgba(246, 234, 214, 0.75);
  transition: border-color 0.35s, background 0.35s, color 0.35s, transform 0.35s;
  text-align: left;
}

.room-chip img {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid rgba(220, 187, 121, 0.3);
}

.room-chip b {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.2;
  color: #f6ead6;
  white-space: nowrap;
}

.room-chip span {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 234, 214, 0.5);
}

.room-chip:hover {
  border-color: rgba(220, 187, 121, 0.55);
  transform: translateY(-2px);
}

.room-chip.is-active {
  background: linear-gradient(135deg, rgba(185, 138, 60, 0.24), rgba(185, 138, 60, 0.08));
  border-color: var(--brass-hi);
}

.room-chip.is-active b {
  color: #fff5e0;
}

.vr-dock__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vr-dock__group {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.vr-dock__hint {
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 234, 214, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.vr-dock__hint::before {
  content: '';
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--brass), transparent);
}

/* ---------------- Hint / loading ---------------- */
.vr-hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 20px 28px;
  border-radius: 20px;
  background: rgba(16, 10, 6, 0.78);
  border: 1px solid rgba(220, 187, 121, 0.35);
  backdrop-filter: blur(14px);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.vr-hint.is-off {
  opacity: 0;
  visibility: hidden;
}

.vr-hint b {
  display: block;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: #fbf3e4;
  margin-bottom: 12px;
}

.vr-hint__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 234, 214, 0.7);
}

.vr-hint__row span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.vr-hint__row svg {
  width: 17px;
  height: 17px;
  color: var(--brass-hi);
}

.vr-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(13, 8, 5, 0.92);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.vr-loading.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.vr-loading__inner {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.vr-loading__ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(220, 187, 121, 0.22);
  border-top-color: var(--brass-hi);
  animation: spin 0.9s linear infinite;
}

.vr-loading__label {
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(246, 234, 214, 0.6);
}

/* While a headset session is live, desktop chrome fades out (mirror stays clean) */
.vr-overlay.is-xr .vr-hotspots,
.vr-overlay.is-xr .vr-hint,
.vr-overlay.is-xr .vr-panel {
  opacity: 0;
  pointer-events: none;
}

/* ---------------- Mobile ---------------- */
@media (max-width: 840px) {
  .vr-topbar {
    padding: 12px 14px;
  }

  .vr-tool--label span {
    display: none;
  }

  .vr-tool {
    padding: 0;
    width: 44px;
  }

  .vr-room-title span {
    display: none;
  }

  .vr-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 66%;
    border-radius: 24px 24px 0 0;
    transform: translateY(30px);
  }

  .vr-panel.is-open {
    transform: none;
  }

  .vr-dock {
    border-radius: 20px;
    padding: 12px 12px 14px;
  }

  .vr-dock__hint {
    display: none;
  }

  .room-chip {
    grid-template-columns: 40px 1fr;
    padding: 6px 13px 6px 6px;
  }

  .room-chip img {
    width: 40px;
    height: 40px;
  }

  .vr-panel__foot {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .vr-panel__head h3 {
    font-size: 1.2rem;
  }

  .spec-grid {
    grid-template-columns: 1fr 1fr;
  }
}
