/* =========================================================
   Belle Ville – 3D Explorer
   ========================================================= */
:root {
  --navy: #21274c;
  --teal: #187999;
  --mint: #a2d9d0;
  --green: #1fd18e;
  --glass: rgba(17, 24, 48, .68);
  --glass-line: rgba(162, 217, 208, .22);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0f1530; }
body { font-family: "Manrope", "Segoe UI", sans-serif; color: #fff; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.x3d { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.x3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* glass panels */
.x3d-top, .x3d-panel, .x3d-tools, .x3d-hint, .x3d-tip {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .55);
}

/* top bar */
.x3d-top {
  position: absolute; top: 18px; left: 18px; right: 18px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 18px; z-index: 5;
}
.x3d-logo img { width: 128px; height: auto; display: block; }
.x3d-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.x3d-tabs button {
  border: 0; border-radius: 999px; padding: 9px 18px; background: transparent; color: rgba(255, 255, 255, .78);
  font-size: 14px; font-weight: 600; transition: background .25s, color .25s;
}
.x3d-tabs button:hover:not(:disabled) { color: #fff; }
.x3d-tabs button[aria-selected="true"] { background: var(--mint); color: var(--navy); }
.x3d-tabs button:disabled { cursor: default; opacity: .55; }
.x3d-top-right { display: flex; align-items: center; gap: 10px; }
.x3d-lang, .x3d-back {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, .08); transition: background .25s;
}
.x3d-lang:hover, .x3d-back:hover { background: rgba(255, 255, 255, .18); }

/* side panel */
.x3d-panel {
  position: absolute; top: 100px; left: 18px; width: 340px; max-height: calc(100% - 190px); overflow: auto;
  border-radius: 20px; padding: 24px 24px 18px; z-index: 4;
  animation: panelIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes panelIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.x3d-kicker { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--mint); }
.x3d-name { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; }
.x3d-sub { margin: 6px 0 16px; font-size: 14px; color: rgba(255, 255, 255, .75); }
.x3d-facts { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.x3d-facts li {
  position: relative; padding-left: 18px; font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, .88);
}
.x3d-facts li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.x3d-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 14px; padding: 14px 18px; font-size: 15px; font-weight: 600; color: var(--navy);
  background: linear-gradient(135deg, var(--mint), #d6f3ee); box-shadow: 0 10px 30px -10px rgba(162, 217, 208, .8);
  transition: transform .25s, box-shadow .25s;
}
.x3d-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(162, 217, 208, .9); }
.x3d-exit { background: linear-gradient(135deg, #f3b38c, #ffd9c2); box-shadow: 0 10px 30px -10px rgba(243, 179, 140, .8); }
.x3d-link { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--mint); }
.x3d-link:hover { color: #fff; }
.x3d-apt { margin: 0 0 14px; font-size: 21px; line-height: 1.25; }
.x3d-rooms { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.x3d-room {
  border: 1px solid var(--glass-line); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, .06); transition: background .2s, color .2s;
}
.x3d-room:hover { background: rgba(255, 255, 255, .16); }
.x3d-room.is-active { background: var(--mint); color: var(--navy); border-color: var(--mint); }
.x3d-plan { margin: 0 0 16px; background: #fff; border-radius: 14px; padding: 10px; }
.x3d-plan img { display: block; width: 100%; max-height: 170px; object-fit: contain; }
.x3d-plan figcaption { margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--teal); text-align: center; }
.x3d-note { margin: 16px 0 0; font-size: 11px; color: rgba(255, 255, 255, .5); }

/* tools */
.x3d-tools {
  position: absolute; right: 18px; bottom: 18px; display: flex; gap: 6px; padding: 6px; border-radius: 18px; z-index: 4;
}
.x3d-tool {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border: 0; border-radius: 13px;
  color: #fff; background: transparent; font-size: 13px; font-weight: 600; transition: background .2s;
}
.x3d-tool i { font-size: 14px; color: var(--mint); }
.x3d-tool:hover { background: rgba(255, 255, 255, .1); }
.x3d-tool[aria-pressed="true"] { background: rgba(162, 217, 208, .2); }
.x3d[data-mode="inside"] .x3d-tool[data-tool="rotate"] { display: none; }

/* hint */
.x3d-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; padding: 11px 18px;
  border-radius: 999px; font-size: 13px; color: rgba(255, 255, 255, .85); white-space: nowrap; z-index: 3; pointer-events: none;
}

/* floor tooltip */
.x3d-tip {
  position: absolute; z-index: 6; pointer-events: none; padding: 9px 13px; border-radius: 12px; display: grid; gap: 2px;
}
.x3d-tip strong { font-size: 14px; }
.x3d-tip span { font-size: 12px; color: var(--mint); }
.x3d-tip[hidden] { display: none; }

/* room labels */
.x3d-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.x3d-label {
  position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 9px; border: 0; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--navy);
  background: rgba(255, 255, 255, .92); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .25s; visibility: hidden;
}
.x3d-label span { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(24, 121, 153, .25); }
.x3d-label.is-visible { opacity: 1; visibility: visible; }
.x3d-label:hover { background: var(--mint); }

/* transitions + loading */
.x3d-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 7; }
.x3d-flash.on { animation: flash .55s ease-out; }
@keyframes flash { 0% { opacity: 0; } 30% { opacity: .75; } 100% { opacity: 0; } }
.x3d-loading {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #233166, #0f1530 70%); transition: opacity .8s ease, visibility .8s;
}
.x3d-loading p { margin: 0; font-size: 15px; color: rgba(255, 255, 255, .85); }
.x3d-loading.is-done { opacity: 0; visibility: hidden; }
.x3d-loading small { max-width: 90%; padding: 0 16px; font-size: 11.5px; line-height: 1.5; text-align: center; color: rgba(255, 255, 255, .6); overflow-wrap: anywhere; }
.x3d-spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(162, 217, 208, .25); border-top-color: var(--mint); animation: spin 1s linear infinite; }
.x3d-loading.is-error .x3d-spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* real tour / photos */
.x3d-real-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 14px;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 13.5px; font-weight: 600; transition: background .2s;
}
.x3d-real-btn i { color: var(--mint); }
.x3d-real-btn:hover { background: rgba(255, 255, 255, .16); }
.x3d-real {
  position: absolute; inset: 96px 18px 80px 376px; z-index: 8; border-radius: 20px; overflow: hidden;
  background: #0d1228; border: 1px solid var(--glass-line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
  display: flex; flex-direction: column; animation: panelIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
.x3d-real[hidden] { display: none; }
.x3d-real-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 20px; font-size: 14px; }
.x3d-real-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; }
.x3d-real-close:hover { background: rgba(255, 255, 255, .2); }
.x3d-real-body { position: relative; flex: 1; min-height: 0; }
.x3d-real-head strong { flex: 1; min-width: 0; line-height: 1.3; }
.x3d-real-ext { margin: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--mint); text-decoration: underline; white-space: nowrap; }
.x3d-real-ext[hidden] { display: none; }
.x3d-real-wait { position: absolute; inset: 0; z-index: 1; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 14px; background: #0d1228; }
.x3d-real-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.x3d-photos { height: 100%; display: flex; gap: 12px; overflow-x: auto; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
.x3d-photos img { height: 100%; width: auto; max-width: none; border-radius: 14px; scroll-snap-align: center; object-fit: cover; }
/* toast */
.x3d-toast {
  position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 6; margin: 0; padding: 10px 16px;
  border-radius: 999px; font-size: 13px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.x3d-toast[hidden] { display: none; }
.x3d-tool.is-loading i { animation: spin 1s linear infinite; }

.x3d-tool[hidden] { display: none; }
.x3d-loading.is-error { cursor: pointer; padding: 0 28px; text-align: center; }
.x3d-hint.is-faded { transition: opacity .8s; }

/* phones and upright tablets: compact bar on top, tools on the side, panel as a bottom sheet */
@media (max-width: 560px), (max-width: 820px) and (orientation: portrait) {
  .x3d-top {
    top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; height: auto;
    flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 16px;
  }
  .x3d-logo img { width: 96px; }
  .x3d-lang, .x3d-back { height: 36px; min-width: 36px; justify-content: center; padding: 0 12px; }
  .x3d-back span { display: none; }
  .x3d-tabs { order: 3; width: 100%; justify-content: center; }
  .x3d-tabs button { flex: 1; padding: 8px 10px; font-size: 13px; }

  .x3d-panel {
    top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px; right: 8px; width: auto;
    max-height: 46%; padding: 14px; border-radius: 18px; animation: none;
  }
  .x3d-kicker { margin-bottom: 4px; font-size: 11px; }
  .x3d-panel-out .x3d-kicker { display: none; }
  .x3d-name { font-size: 21px; }
  .x3d-sub { margin: 2px 0 10px; font-size: 13px; }
  .x3d-facts, .x3d-plan, .x3d-apt { display: none; }
  .x3d-btn { padding: 12px 14px; font-size: 14px; }
  .x3d-link { margin-top: 10px; font-size: 13px; }
  .x3d-note { margin-top: 8px; font-size: 10px; line-height: 1.4; }

  /* inside: one swipeable row of rooms, then two buttons side by side */
  .x3d-panel-in:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .x3d-panel-in .x3d-kicker, .x3d-rooms { grid-column: 1 / -1; }
  .x3d-panel-in .x3d-kicker { margin: 0; }
  .x3d-rooms { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-bottom: 2px; scrollbar-width: none; }
  .x3d-rooms::-webkit-scrollbar { display: none; }
  .x3d-room { flex: 0 0 auto; padding: 9px 14px; font-size: 13px; }
  .x3d-real-btn, .x3d-panel-in .x3d-btn { margin: 0; padding: 10px 8px; font-size: 12.5px; line-height: 1.25; border-radius: 12px; }
  .x3d[data-mode="inside"] .x3d-note { display: none; }

  .x3d-tools {
    top: calc(124px + env(safe-area-inset-top)); bottom: auto; right: 8px; flex-direction: column; gap: 4px; padding: 4px; border-radius: 16px;
  }
  .x3d-tool { width: 40px; height: 40px; justify-content: center; padding: 0; }
  .x3d-tool span { display: none; }

  .x3d-hint {
    top: calc(124px + env(safe-area-inset-top)); bottom: auto; left: 8px; right: 64px; transform: none; padding: 9px 12px;
    border-radius: 14px; font-size: 12px; line-height: 1.4; white-space: normal;
  }
  .x3d-hint.is-faded { opacity: 0; }
  .x3d-toast { top: calc(124px + env(safe-area-inset-top)); width: max-content; max-width: calc(100% - 32px); text-align: center; }
  .x3d-label { padding: 6px 11px 6px 8px; font-size: 12px; }

  .x3d-real { inset: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); }
  .x3d-photos { flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 0 12px 12px; scroll-snap-type: none; }
  .x3d-photos img { width: 100%; height: auto; max-width: 100%; }
}

/* phones held sideways: narrow panel on the left, small tools bottom right */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 561px) {
  .x3d-top {
    top: 8px; left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right));
    height: 50px; padding: 0 8px 0 12px; border-radius: 14px;
  }
  .x3d-logo img { width: 92px; }
  .x3d-tabs button { padding: 7px 14px; font-size: 12.5px; }
  .x3d-lang, .x3d-back { height: 34px; padding: 0 12px; }
  .x3d-back span { display: none; }
  .x3d-panel {
    top: 66px; bottom: 8px; left: calc(8px + env(safe-area-inset-left)); width: 250px; max-height: none;
    padding: 12px 14px; border-radius: 16px;
  }
  .x3d-panel-out .x3d-kicker, .x3d-facts, .x3d-plan, .x3d-note { display: none; }
  .x3d-name { font-size: 19px; }
  .x3d-sub { margin: 2px 0 10px; font-size: 12px; }
  .x3d-btn { padding: 10px 12px; font-size: 13px; }
  .x3d-link { margin-top: 10px; font-size: 12.5px; }
  /* inside: the room list scrolls, the two buttons stay on screen */
  .x3d[data-mode="inside"] .x3d-panel { display: flex; flex-direction: column; overflow: hidden; }
  .x3d-panel-in:not([hidden]) { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; }
  .x3d-panel-in .x3d-kicker { margin: 0; }
  .x3d-apt { display: none; }
  .x3d-rooms { flex: 1; min-height: 0; overflow-y: auto; align-content: flex-start; gap: 6px; margin: 0; scrollbar-width: none; }
  .x3d-rooms::-webkit-scrollbar { display: none; }
  .x3d-room { padding: 6px 10px; font-size: 12px; }
  .x3d-real-btn, .x3d-panel-in .x3d-btn { flex: 0 0 auto; margin: 0; padding: 8px 10px; font-size: 12px; line-height: 1.25; }
  .x3d-tools { right: calc(8px + env(safe-area-inset-right)); bottom: 8px; gap: 4px; padding: 4px; }
  .x3d-tool { width: 40px; height: 38px; justify-content: center; padding: 0; }
  .x3d-tool span { display: none; }
  .x3d-hint { display: none; }
  .x3d-toast { top: 66px; }
  .x3d-real { inset: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .x3d-panel, .x3d-flash.on, .x3d-spinner { animation: none; }
}

/* ---- same look as the redesigned site: serif headings, pill buttons, leaf corners ---- */
.x3d-name, .x3d-apt { font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 600; letter-spacing: 0; }
.x3d-name { font-size: 38px; line-height: 1.05; }
.x3d-apt { font-size: 26px; line-height: 1.15; }
.x3d-panel { border-radius: 40px 0; }
.x3d-btn, .x3d-real-btn { border-radius: 999px; }
.x3d-kicker { letter-spacing: .22em; font-size: 11px; font-weight: 800; }
@media (max-width: 560px), (max-width: 820px) and (orientation: portrait) {
  .x3d-panel { border-radius: 30px 0; }
  .x3d-name { font-size: 27px; }
  .x3d-real-btn, .x3d-panel-in .x3d-btn { border-radius: 999px; }
}
@media (orientation: landscape) and (max-height: 520px) and (min-width: 561px) {
  .x3d-panel { border-radius: 28px 0; }
  .x3d-name { font-size: 24px; }
}
