/* BRAMA — «Наш простір»: інтерактивний вибір залу (js/space-rooms.js) */

.space-rooms {
  position: relative;
}

.sr-anchor {
  position: absolute;
  top: 0;
}

/* --- Панель ----------------------------------------------------------------- */

.rx {
  --rx-bg: #15110f;
  --rx-panel: #1d1815;
  --rx-line: rgba(246, 239, 228, 0.1);
  --rx-line-strong: rgba(246, 239, 228, 0.22);
  --rx-text: #f6efe4;
  --rx-muted: #a8988a;
  --rx-accent: #d9a57b;

  position: relative;
  margin-top: 8px;
  border-radius: 26px;
  overflow: hidden;
  color: var(--rx-text);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(217, 165, 123, 0.14), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(104, 72, 62, 0.35), transparent 60%),
    var(--rx-bg);
  box-shadow: 0 40px 80px -30px rgba(27, 22, 19, 0.55);
  isolation: isolate;
}

/* тонка «креслярська» сітка */
.rx::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--rx-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--rx-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 70%);
  pointer-events: none;
}

.rx[hidden] {
  display: none;
}

/* --- Вкладки ------------------------------------------------------------- */

.rx__bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rx-line);
}

.rx__hint {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rx-muted);
}

.rx__hint::before {
  content: "// ";
  color: var(--rx-accent);
}

.rx__tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.rx__tabs::-webkit-scrollbar {
  display: none;
}

.rx__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--rx-line);
  border-radius: 12px;
  background: rgba(246, 239, 228, 0.03);
  color: var(--rx-text);
  font: 600 0.95rem/1 var(--font-display);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}

.rx__tab:hover {
  border-color: var(--rx-line-strong);
  background: rgba(246, 239, 228, 0.07);
}

.rx__tab:focus-visible {
  outline: 2px solid var(--rx-accent);
  outline-offset: 2px;
}

.rx__tab-idx {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--rx-muted);
  transition: color 0.25s;
}

.rx__tab-video {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rx-accent);
  box-shadow: 0 0 0 3px rgba(217, 165, 123, 0.18);
}

.rx__tab.is-active {
  border-color: var(--rx-text);
  background: var(--rx-text);
  color: #1b1613;
}

.rx__tab.is-active .rx__tab-idx {
  color: #8a7264;
}

/* --- Обраний зал ---------------------------------------------------------- */

.rx__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "gallery info"
    "gallery meta";
  gap: 0 22px;
  padding: 22px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.rx__panel.has-video {
  grid-template-columns: minmax(230px, 0.5fr) minmax(0, 1fr) minmax(260px, 0.6fr);
  grid-template-areas:
    "video gallery info"
    "video gallery meta";
}

.rx__video { grid-area: video; }
.rx__gallery { grid-area: gallery; }
.rx__info { grid-area: info; }
.rx__meta { grid-area: meta; display: flex; flex-direction: column; min-width: 0; padding: 0 6px 6px; }

.rx__panel.is-in {
  opacity: 1;
  transform: none;
}

/* Відео в «телефонній» рамці (Shorts — вертикальні) */
.rx__video {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rx__phone {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 600px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 1px var(--rx-line-strong),
    0 0 0 6px #0c0a09,
    0 0 0 7px var(--rx-line),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
  margin: 7px;
}

.rx__phone.is-wide {
  aspect-ratio: 16 / 9;
}

.rx__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.78);
  transition: transform 0.8s var(--ease), filter 0.4s;
}

.rx__phone:hover .rx__poster {
  transform: scale(1.04);
  filter: saturate(1) brightness(0.85);
}

.rx__phone iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.rx__play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55));
  color: var(--rx-text);
  cursor: pointer;
}

.rx__play-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  padding-left: 3px;
  border-radius: 50%;
  background: rgba(246, 239, 228, 0.95);
  color: #1b1613;
  transition: transform 0.3s var(--ease);
}

/* «пульс» навколо кнопки */
.rx__play-ring::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(246, 239, 228, 0.6);
  border-radius: 50%;
  animation: rx-pulse 2.4s var(--ease) infinite;
}

@keyframes rx-pulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.rx__play:hover .rx__play-ring,
.rx__play:focus-visible .rx__play-ring {
  transform: scale(1.08);
}

.rx__play-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.rx__full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 7px;
  padding: 10px 12px;
  border: 1px solid var(--rx-line-strong);
  border-radius: 10px;
  background: rgba(246, 239, 228, 0.04);
  color: var(--rx-text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.rx__full:hover {
  background: var(--rx-text);
  border-color: var(--rx-text);
  color: #1b1613;
}

.rx__full:focus-visible {
  outline: 2px solid var(--rx-accent);
  outline-offset: 2px;
}

/* Фото */
.rx__gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rx__stage {
  position: relative;
  flex: 1;
  min-height: 300px;
  border-radius: 18px;
  overflow: hidden;
  background: #0c0a09;
  box-shadow: 0 0 0 1px var(--rx-line);
}

.rx__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s var(--ease), transform 1.2s var(--ease);
}

.rx__photo.is-in {
  opacity: 1;
  transform: none;
}

.rx__zoom {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.rx__counter {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 10, 9, 0.7);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.rx__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border: 1px solid rgba(246, 239, 228, 0.25);
  border-radius: 50%;
  background: rgba(12, 10, 9, 0.55);
  backdrop-filter: blur(6px);
  color: var(--rx-text);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s, background 0.25s;
}

.rx__arrow--prev { left: 12px; }
.rx__arrow--next { right: 12px; }

.rx__stage:hover .rx__arrow,
.rx__arrow:focus-visible {
  opacity: 1;
}

.rx__arrow:hover {
  background: rgba(246, 239, 228, 0.95);
  color: #1b1613;
}

.rx__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rx__thumbs::-webkit-scrollbar {
  display: none;
}

.rx__thumb {
  flex: 0 0 74px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #0c0a09;
  cursor: pointer;
  opacity: 0.45;
  box-shadow: 0 0 0 1px var(--rx-line);
  transition: opacity 0.25s, box-shadow 0.25s;
}

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

.rx__thumb:hover {
  opacity: 0.8;
}

.rx__thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--rx-accent);
}

.rx__gallery.is-empty {
  display: grid;
  place-items: center;
  min-height: 300px;
  border: 1px dashed var(--rx-line-strong);
  border-radius: 18px;
}

.rx__empty {
  color: var(--rx-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Опис */
.rx__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 6px 6px;
}

.rx__idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rx-accent);
}

.rx__name {
  margin: 12px 0 14px;
  color: var(--rx-text);
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.rx__desc {
  color: #d8cbbd;
  font-size: 1rem;
  line-height: 1.6;
}

.rx__specs {
  display: grid;
  margin: 20px 0 0;
  border: 1px solid var(--rx-line);
  border-radius: 14px;
  overflow: hidden;
}

.rx__spec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rx-line);
}

.rx__spec:last-child {
  border-bottom: 0;
}

.rx__spec dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rx-muted);
}

.rx__spec dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--rx-text);
}

.rx__spec dd {
  white-space: nowrap;
}

.rx__spec small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--rx-muted);
}

.rx__deal {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px dashed var(--rx-line-strong);
  border-radius: 12px;
  color: var(--rx-muted);
  font-size: 0.9rem;
}

.rx__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 26px;
}

.rx__book {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--rx-text);
  color: #1b1613;
  font: 700 1rem/1.2 var(--font-display);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.rx__book svg {
  flex: none;
  transition: transform 0.25s var(--ease);
}

.rx__book:hover {
  background: #fff;
  box-shadow: 0 12px 30px -10px rgba(246, 239, 228, 0.5);
}

.rx__book:hover svg {
  transform: translateX(4px);
}

.rx__book:focus-visible,
.rx__more:focus-visible {
  outline: 2px solid var(--rx-accent);
  outline-offset: 3px;
}

.rx__more {
  padding: 12px 20px;
  border: 1px solid var(--rx-line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--rx-text);
  font: 600 0.92rem/1.2 var(--font-body);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.rx__more:hover {
  background: rgba(246, 239, 228, 0.08);
  border-color: var(--rx-text);
}

.sg-foot {
  margin-top: 36px;
}

/* --- Планшет -------------------------------------------------------------- */

@media (max-width: 1100px) {
  .rx__panel.has-video {
    grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "video gallery"
      "info info"
      "meta meta";
  }

  .rx__panel.has-video .rx__info {
    padding-top: 22px;
  }

  .rx__panel.has-video .rx__specs {
    grid-template-columns: repeat(3, 1fr);
  }

  .rx__panel.has-video .rx__spec {
    flex-direction: column;
    gap: 4px;
    border-bottom: 0;
    border-right: 1px solid var(--rx-line);
  }

  .rx__panel.has-video .rx__spec:last-child {
    border-right: 0;
  }

  .rx__panel.has-video .rx__actions {
    flex-direction: row;
  }

  .rx__panel.has-video .rx__book {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .rx__bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 16px 14px;
  }

  .rx__panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "gallery"
      "info"
      "meta";
    padding: 16px;
  }

  .rx__stage {
    min-height: 0;
    aspect-ratio: 4 / 3;
    flex: none;
  }

  .rx__arrow {
    opacity: 1;
  }
}

/* --- Телефон: фото → (відео | назва й опис) → характеристики й кнопки ----- */

@media (max-width: 620px) {
  .rx {
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 20px;
  }

  .rx__panel.has-video {
    grid-template-columns: minmax(0, 0.44fr) minmax(0, 0.56fr);
    grid-template-areas:
      "gallery gallery"
      "video info"
      "meta meta";
    gap: 0 14px;
  }

  .rx__panel.has-video .rx__gallery {
    margin-bottom: 16px;
  }

  .rx__info,
  .rx__panel.has-video .rx__info {
    padding: 4px 0 0;
  }

  .rx__phone {
    margin: 4px;
    border-radius: 12px;
  }

  .rx__full {
    margin: 0 4px;
    padding: 9px 6px;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }

  .rx__name {
    font-size: 1.7rem;
    margin: 8px 0 10px;
  }

  .rx__desc {
    font-size: 0.92rem;
  }

  .rx__meta {
    padding: 0;
  }

  .rx__panel.has-video .rx__specs {
    grid-template-columns: repeat(3, 1fr);
  }

  .rx__panel.has-video .rx__spec {
    padding: 10px 10px;
  }

  .rx__panel.has-video .rx__spec dd {
    font-size: 0.98rem;
  }

  .rx__panel.has-video .rx__spec small {
    font-size: 0.7rem;
  }

  .rx__actions,
  .rx__panel.has-video .rx__actions {
    flex-direction: column;
    padding-top: 18px;
  }

  .rx__thumb {
    flex-basis: 64px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rx__panel,
  .rx__photo,
  .rx__poster,
  .rx__play-ring::after {
    transition: none;
    animation: none;
  }
}
