/* ─────────────────────────────────────────────────────────────────
      16. RECORRIDOS 360°
───────────────────────────────────────────────────────────────── */
#page-recorrido360 {
  background: #080808;
  overflow: clip;
}

.r360-iframe-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.r360-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.r360-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(8, 8, 8, .4) 0%, transparent 22%, transparent 75%, rgba(8, 8, 8, .28) 100%);
  pointer-events: none;
  transition: opacity .35s;
}

/* FAB — esquina superior derecha */
.r360-fab {
  position: fixed;
  top: calc(22px + env(safe-area-inset-top));
  right: calc(22px + 42px + 10px);
  bottom: auto;
  left: auto;
  z-index: 3100;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  height: 42px;
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
  transition: background .3s, border-color .3s;
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.r360-fab:hover {
  transform: scale(1.02);
}

.r360-fab:active {
  transform: scale(.96);
}

.r360-fab,
.r360-fab-icon,
.r360-fab-close,
.r360-fab-label {
  touch-action: manipulation;
}

.r360-fab-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: .8;
}

.r360-fab-close {
  display: none !important;
  align-items: center;
  flex-shrink: 0;
  opacity: .7;
}

.r360-fab-label {
  line-height: 1;
}

.r360-fab.is-open .r360-fab-icon {
  display: flex;
}

.r360-fab.is-open .r360-fab-close {
  display: none !important;
}

.r360-fab.is-open {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
}

/* Badge "viendo ahora" — abajo izquierda */
.r360-now-badge {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(8, 8, 8, .65);
  border: 0.5px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: 7px 13px;
  pointer-events: none;
  transition: opacity .3s;
}

.r360-now-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.r360-now-label {
  font-size: .52rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-dim);
  white-space: nowrap;
}

.r360-now-name {
  font-size: .75rem;
  color: rgba(245, 245, 243, .8);
  font-weight: 300;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Backdrop */
.r360-backdrop {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
  touch-action: manipulation;
}

.r360-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* Loading */
.r360-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s;
  pointer-events: all;
}

.r360-loading.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.r360-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.r360-loading-logo {
  width: 80px;
  max-width: 40vw;
  filter: brightness(0) invert(1) opacity(.65);
  animation: r360LogoPulse 2.2s ease-in-out infinite;
}

.r360-loading-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-faint);
  border-top-color: var(--accent-stroke);
  animation: r360Spin .9s linear infinite;
}

.r360-loading-text {
  font-size: .62rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent-border2);
  font-family: 'DM Sans', sans-serif;
}

/* Drawer — floating dropdown desde top-right */
.r360-handle {
  display: none;
  justify-content: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
}

.r360-handle span {
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .15);
  display: block;
}

.r360-drawer {
  position: fixed;
  top: calc(22px + 42px + 8px + env(safe-area-inset-top));
  right: 22px;
  bottom: auto;
  left: auto;
  width: 240px;
  z-index: var(--z-r360-drawer, 3380);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .12), 0 1px 0 rgba(0, 0, 0, .04) inset;
  transition: opacity .22s ease, transform .22s cubic-bezier(0.16, 1, 0.3, 1), visibility .22s;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.97);
  transform-origin: top right;
  pointer-events: none;
}

.r360-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Sin línea lateral */
.r360-drawer::before {
  display: none !important;
}

.r360-drawer-inner {
  display: flex;
  flex-direction: column;
  padding: 8px 6px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(70vh, 480px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .15) transparent;
}

.r360-drawer-inner::-webkit-scrollbar {
  width: 3px;
}

.r360-drawer-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .18);
  border-radius: 2px;
}

/* Header minimalista */
.r360-drawer-header {
  padding: 6px 10px 4px;
  flex-shrink: 0;
}

.r360-drawer-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}

.r360-drawer-head-text {
  flex: 1;
}

.r360-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(17, 17, 17, .45);
  cursor: pointer;
  transition: background .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.r360-drawer-close:hover {
  background: rgba(0, 0, 0, .07);
  color: #111111;
}

.r360-eyebrow {
  font-size: .54rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .38);
  font-family: 'DM Sans', sans-serif;
}

.r360-title {
  display: none;
}

.r360-subtitle {
  display: none;
}

.r360-divider {
  height: 0.5px;
  background: rgba(0, 0, 0, .08);
  margin: 6px 0;
  width: 100%;
}

/* Lista de items */
.r360-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 2px;
}

.r360-list::-webkit-scrollbar {
  display: none;
}

.r360-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .15s;
  color: rgba(17, 17, 17, .75);
  text-align: left;
  width: 100%;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.r360-item:hover {
  background: rgba(0, 0, 0, .05);
  color: #111111;
}

.r360-item.active {
  background: rgba(0, 0, 0, .06);
  color: #111111;
}

.r360-item-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(0, 0, 0, .18);
  transition: background .15s;
}

.r360-item.active .r360-item-dot {
  background: var(--accent-strong);
}

.r360-item-badge {
  display: none;
}

.r360-item-body {
  flex: 1;
  min-width: 0;
}

.r360-item-name {
  font-size: .78rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.r360-item.active .r360-item-name {
  font-weight: 500;
}

.r360-item-desc {
  display: none;
}

.r360-item-arr {
  display: none;
}

/* Iframes extra — ocultos */
/* ─────────────────────────────────────────────────────────────────
    BOTÓN FULLSCREEN — esquina superior derecha de cada sección
───────────────────────────────────────────────────────────────── */
.fs-btn {
  position: fixed;
  top: calc(22px + env(safe-area-inset-top));
  right: 22px;
  z-index: 3100;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 2px var(--accent-ui-border);
}

.fs-btn:hover {
  transform: scale(1.05);
}

.fs-btn:active {
  transform: scale(.96);
}

.fs-icon-expand {
  display: block;
}

.fs-icon-compress {
  display: none;
}

.fs-btn.is-fullscreen .fs-icon-expand {
  display: none;
}

.fs-btn.is-fullscreen .fs-icon-compress {
  display: block;
}

/* En page-recorrido360 y pisos, .fs-btn usa estilos base */

.r360-extra-frames {
  display: none !important;
}

.r360-toggle-panel,
.r360-drawer-toggle,
.r360-current-badge {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────────
    BOTÓN QR — mismo estilo que hamburguesa
───────────────────────────────────────────────────────────────── */
.qr-btn {
  position: fixed;
  top: calc(22px + env(safe-area-inset-top));
  right: calc(22px + 42px + 10px);
  z-index: 3100;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.qr-btn:hover {
  transform: scale(1.05);
}

.qr-btn:active {
  transform: scale(.96);
}

/* En r360: el r360-fab ya ocupa right:74px, qr-btn va más a la izquierda */
.qr-btn--r360 {
  right: calc(22px + 42px + 10px + 42px + 10px);
  z-index: 3200;
}

#page-recorrido360 .qr-btn--r360 {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}

/* ─────────────────────────────────────────────────────────────────
    MODAL QR
───────────────────────────────────────────────────────────────── */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.qr-modal-box {
  position: relative;
  z-index: 1;
  width: min(280px, calc(100vw - 40px));
  background: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 0 0 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25), 0 0 0 2px var(--accent-ui-border);
  animation: qrModalIn .22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes qrModalIn {
  from {
    opacity: 0;
    transform: scale(.94) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.qr-modal-logo {
  height: 28px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.qr-modal-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  filter: brightness(0);
}

.qr-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .06);
  border: 0.5px solid rgba(0, 0, 0, .10);
  color: rgba(17, 17, 17, .5);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.qr-modal-close:hover {
  background: rgba(0, 0, 0, .12);
  color: #111111;
}

.qr-modal-img-wrap {
  margin: 0 16px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #111111;
}

.qr-modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-modal-label {
  margin: 12px 16px 0;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: .56rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .4);
}

/* QR modal compacto en pantallas chicas (landscape móvil) */
@media (max-height:500px) {
  .qr-modal {
    padding: 10px;
  }

  .qr-modal-box {
    width: min(200px, calc(100vw - 20px));
    border-radius: 12px;
    padding: 0 0 12px;
  }

  .qr-modal-header {
    padding: 8px 10px 6px;
  }

  .qr-modal-logo {
    height: 22px;
  }

  .qr-modal-close {
    width: 22px;
    height: 22px;
  }

  .qr-modal-img-wrap {
    margin: 0 10px;
    border-radius: 7px;
    border: 1.5px solid #111111;
  }

  .qr-modal-label {
    margin: 8px 10px 0;
    font-size: .48rem;
    letter-spacing: .14em;
  }
}

/* ─────────────────────────────────────────────────────────────────
    17. ROTATE OVERLAY
───────────────────────────────────────────────────────────────── */
.rotate-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0, 0, 0, .52);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}

.rotate-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.rotate-coach-icon {
  animation: rotatePhoneAnim 2.5s ease-in-out infinite;
  transform-origin: center;
  margin-bottom: 4px;
}

@keyframes rotatePhoneAnim {

  0%,
  100% {
    transform: rotate(0deg);
    opacity: .4;
  }

  50% {
    transform: rotate(-90deg);
    opacity: 1;
  }
}

.rotate-coach-line1 {
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .9);
  background: rgba(10, 10, 10, .6);
  border-radius: 100px;
  padding: 7px 18px;
  white-space: nowrap;
}

.rotate-coach-line2 {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .8);
  background: rgba(10, 10, 10, .6);
  border-radius: 100px;
  padding: 6px 16px;
  white-space: nowrap;
}

.rotate-coach-dismiss {
  font-family: 'DM Sans', sans-serif;
  font-size: .58rem;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .3);
  padding-top: 2px;
}

@media (min-width: 600px) {
  .rotate-overlay {
    display: none !important;
  }
}

