/* ==========================================================================
   VISOR INMERSIVO 360° REAL (THREE.JS EQUIRECTANGULAR SPHERE - BASEMENT.STUDIO)
   ========================================================================== */
.kello-360-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 10000;
  background: #080706;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s;
  overflow: hidden;
}

.kello-360-container.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.kello-360-canvas-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.kello-360-canvas-wrap.dragging {
  cursor: grabbing;
}

.kello-360-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* HUD SUPERIOR */
.kello-360-topbar {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 120;
}

.kello-360-nav-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 14, 11, 0.93);
  border: 1px solid rgba(224, 149, 92, 0.35);
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.22s ease, opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, text-shadow 0.22s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-nav-btn:hover {
    background: rgba(224, 149, 92, 0.2);
    border-color: var(--amber-hot);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 16px rgba(224, 149, 92, 0.35);
  }
}

.kello-360-nav-btn svg {
  flex-shrink: 0;
  stroke: var(--amber-hot);
  transition: transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-nav-btn:hover svg {
    transform: scale(1.1);
  }
}

.kello-360-btn--info {
  border-color: rgba(224, 149, 92, 0.45);
  background: linear-gradient(135deg, rgba(224, 149, 92, 0.16) 0%, rgba(18, 14, 11, 0.9) 100%);
}

.kello-360-header-info {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  text-align: center;
  position: relative;
}

.kello-360-header-eyebrow,
.kello-360-live-dot {
  display: none;
}

.kello-360-header-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 16px);
  position: relative;
}

/* Alas arquitectónicas cinemáticas laterales fluidas */
.kello-360-header-title-wrap::before,
.kello-360-header-title-wrap::after {
  content: '';
  display: block;
  width: clamp(10px, 3.2vw, 48px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(224, 149, 92, 0.85));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(224, 149, 92, 0.4);
}

.kello-360-header-title-wrap::after {
  background: linear-gradient(90deg, rgba(224, 149, 92, 0.85), transparent);
}

.kello-360-header-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(1.25rem, 3.4vw, 1.85rem);
  letter-spacing: 0.1em;
  color: #fff;
  margin: 0;
  line-height: 1.1;
  font-weight: 400;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 15%, #fde4cf 65%, #e0955c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 20px rgba(224, 149, 92, 0.35));
}

/* TELEMETRÍA (BASEMENT.STUDIO AESTHETIC) */
.kello-360-telemetry {
  position: absolute;
  top: calc(82px + env(safe-area-inset-top, 0px));
  right: 24px;
  z-index: 110;
  pointer-events: none;
}

.kello-360-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 8, 7, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.64rem;
  color: rgba(245, 237, 226, 0.75);
  letter-spacing: 0.08em;
}

.kello-360-compass-icon {
  color: var(--amber-hot);
  font-size: 0.85rem;
  animation: kello360SpinCompass 10s linear infinite;
  display: inline-block;
}

@keyframes kello360SpinCompass {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.kello-360-separator {
  color: rgba(224, 149, 92, 0.4);
}

.kello-360-mode-tag {
  color: var(--amber-hot);
  font-weight: 700;
}

/* HINT FLOTANTE CENTRAL */
.kello-360-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 105;
  transition: opacity 0.6s ease;
}

.kello-360-hint.hidden {
  opacity: 0;
  visibility: hidden;
}

.kello-360-hint-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 10, 8, 0.93);
  border: 1px solid rgba(224, 149, 92, 0.45);
  border-radius: 999px;
  padding: 10px 22px;
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(224, 149, 92, 0.25);
  animation: kello360HintFloat 3s ease-in-out infinite alternate;
}

@keyframes kello360HintFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.kello-360-hint-icon svg {
  stroke: var(--amber-hot);
  display: block;
}


/* PANTALLA DE CARGA */
.kello-360-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 6, 0.92);
  z-index: 150;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.kello-360-loader.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.kello-360-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(18, 14, 11, 0.88);
  border: 1px solid rgba(224, 149, 92, 0.4);
  border-radius: 20px;
  padding: 36px 40px;
  max-width: 90vw;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(224, 149, 92, 0.2);
}

.kello-360-spinner {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 20px;
}

.kello-360-spinner-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(224, 149, 92, 0.18);
  border-top-color: var(--amber-hot);
  animation: kello360Spin 0.9s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.kello-360-spinner-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-hot);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--amber-hot);
}

@keyframes kello360Spin {
  to { transform: rotate(360deg); }
}

.kello-360-loader-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--amber-hot);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.kello-360-loader-title {
  font-family: 'Anton', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-bottom: 16px;
}

.kello-360-loader-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.kello-360-loader-progress {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #c97a45, #f59e0b);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.kello-360-loader-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--stone);
  text-transform: uppercase;
}

/* PANTALLA DE ERROR / FALLBACK */
.kello-360-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 6, 0.95);
  z-index: 160;
}

.kello-360-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(22, 14, 10, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 20px;
  padding: 32px 36px;
  max-width: 90vw;
  width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 25px rgba(239, 68, 68, 0.2);
}

.kello-360-error-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.kello-360-error-title {
  font-family: 'Anton', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: #f87171;
  margin: 0 0 10px 0;
}

.kello-360-error-desc {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--cream);
  opacity: 0.85;
  margin-bottom: 22px;
}

.kello-360-error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.kello-360-error-btn {
  padding: 10px 18px;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.kello-360-error-btn--retry {
  background: linear-gradient(135deg, #e0955c, #c97a45);
  color: #0c0a08;
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-error-btn--retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(224, 149, 92, 0.4);
  }
}

.kello-360-error-btn--info {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(224, 149, 92, 0.4);
  color: var(--cream);
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-error-btn--info:hover {
    background: rgba(224, 149, 92, 0.16);
    border-color: var(--amber-hot);
  }
}

.kello-360-error-btn--back {
  background: transparent;
  color: var(--stone);
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-error-btn--back:hover {
    color: var(--cream);
  }
}

/* BOTONES TRIGGERS DENTRO DE LOS MODALES DE HABITACIONES */
.kello-360-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(224, 149, 92, 0.14);
  border: 1px solid rgba(224, 149, 92, 0.45);
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.22s ease, opacity 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 12px rgba(224, 149, 92, 0.2);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .kello-360-pill-btn:hover {
    background: rgba(224, 149, 92, 0.3);
    border-color: var(--amber-hot);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 18px rgba(224, 149, 92, 0.5);
  }
}

.kello-360-pill-icon {
  color: var(--amber-hot);
  font-size: 0.9rem;
  display: inline-block;
  animation: kello360SpinCompass 8s linear infinite;
}

/* TARJETA TRIGGER INTEGRADORA 360 (ESTILO BASEMENT.STUDIO) */
.kello-room-360-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem auto;
  padding: 22px 28px;
  max-width: 980px;
  width: calc(100% - 32px);
  border-radius: 16px;
  background: #0f0a07;
  border: 1px solid rgba(224, 149, 92, 0.45);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(224, 149, 92, 0.2);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .kello-room-360-card:hover {
    border-color: var(--amber-hot);
    transform: translateY(-3px);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.9), 0 0 35px rgba(224, 149, 92, 0.4);
  }
}

.kello-room-360-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 42%;
  opacity: 0.72;
  filter: none;
  transform: scale(1.02);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .kello-room-360-card:hover .kello-room-360-card-bg {
    transform: scale(1.06);
    opacity: 0.85;
  }
}

.kello-room-360-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(14, 10, 8, 0.84) 0%,
    rgba(14, 10, 8, 0.62) 42%,
    rgba(14, 10, 8, 0.45) 70%,
    rgba(14, 10, 8, 0.68) 100%
  );
  pointer-events: none;
}

.kello-room-360-card-content {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  padding-right: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

/* Accent line above title */
.kello-room-360-card-content::before {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, #e0955c, rgba(224, 149, 92, 0.3));
  border-radius: 1px;
  margin-bottom: 2px;
}

.kello-room-360-card-title {
  font-family: 'Anton', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin: 0;
  line-height: 1.18;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.98), 0 0 3px rgba(0, 0, 0, 0.95);
}

.kello-room-360-card-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(252, 245, 237, 0.88);
  margin: 0;
  max-width: 640px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.kello-room-360-card-cta {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #df945b;
  background: linear-gradient(135deg, #e59a60 0%, #cb7b44 100%);
  color: #140d07;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(224, 149, 92, 0.35);
  border: 1px solid rgba(255, 235, 215, 0.4);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .kello-room-360-card:hover .kello-room-360-card-cta {
    transform: translateX(4px);
    background: linear-gradient(135deg, #f0a870 0%, #da864e 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 26px rgba(224, 149, 92, 0.6);
  }
}

.kello-room-360-cta-arrow {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .kello-room-360-card:hover .kello-room-360-cta-arrow {
    transform: translateX(4px);
  }
}

/* RESPONSIVIDAD MÓVIL DEL VISOR 360 */
@media (max-width: 768px) {
  .kello-360-topbar {
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    gap: 6px;
  }

  .kello-360-nav-btn {
    padding: 6px 12px;
    font-size: 0.64rem;
  }

  .kello-360-nav-btn span {
    display: none;
  }

  .kello-360-header-info {
    max-width: 68vw;
  }

  .kello-360-header-title {
    font-size: clamp(0.92rem, 3.8vw, 1.2rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .kello-360-telemetry {
    top: calc(70px + env(safe-area-inset-top, 0px));
    right: 12px;
  }

  .kello-360-telemetry-badge {
    padding: 3px 8px;
    font-size: 0.56rem;
    gap: 5px;
  }

  .kello-360-mode-tag {
    display: none;
  }

  .kello-360-hint-inner {
    padding: 8px 16px;
    font-size: 0.64rem;
    gap: 8px;
  }

  /* BOTÓN TRIGGER 360 EN TOPBARS EN MÓVIL (COMPACTO Y ELEGANTE) */
  .kello-360-pill-btn {
    padding: 6px 10px;
    font-size: 0.62rem;
    gap: 4px;
    flex-shrink: 0;
  }
  .kello-360-pill-btn span:not(.kello-360-pill-icon) {
    display: none;
  }
  .kello-360-pill-btn::after {
    content: '360°';
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.64rem;
  }

  /* CENTROS DE TOPBAR UNIFICADOS EN MODALES PARA QUE NO CHOQUEN */
  .disco-experience .disco-topbar-center,
  .tvt-experience .tvt-topbar-center,
  .room-modal-card--fullstory .hbtc-topbar-center {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100vw - 150px);
    text-align: center;
    overflow: hidden;
    padding: 0 4px;
  }

  .disco-experience .disco-topbar-title,
  .tvt-experience .tvt-topbar-title,
  .room-modal-card--fullstory .hbtc-topbar-title {
    font-size: clamp(0.68rem, 2.6vw, 0.8rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .disco-experience .disco-topbar-eyebrow-mini,
  .tvt-experience .tvt-topbar-eyebrow-mini,
  .room-modal-card--fullstory .hbtc-topbar-eyebrow-mini {
    font-size: 0.52rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* TARJETA 360 TOTALMENTE RESPONSIVA EN MÓVIL (ESTRUCTURAL) */
  .kello-room-360-card {
    flex-direction: column;
    align-items: stretch;
    max-width: 480px;
    width: min(calc(100% - clamp(12px, 3vw, 24px)), 480px);
    margin: clamp(0.65rem, 2vw, 0.85rem) auto clamp(1rem, 2.5vw, 1.25rem);
    padding: clamp(12px, 3vw, 18px);
    border-radius: clamp(14px, 2vw, 16px);
    gap: clamp(10px, 2vw, 12px);
    min-height: fit-content;
  }

  .kello-room-360-card-overlay {
    background: linear-gradient(
      180deg,
      rgba(12, 8, 6, 0.84) 0%,
      rgba(12, 8, 6, 0.52) 42%,
      rgba(12, 8, 6, 0.86) 100%
    );
  }

  .kello-room-360-card-content {
    padding-right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .kello-room-360-card-content::before {
    width: 24px;
    margin-bottom: 1px;
  }

  .kello-room-360-card-title {
    font-size: clamp(0.96rem, 3.8vw, 1.25rem);
    line-height: 1.18;
    margin: 0;
    white-space: normal;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
  }

  .kello-room-360-card-sub {
    font-size: clamp(0.7rem, 2.2vw, 0.75rem);
    line-height: 1.4;
    margin: 0;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
  }

  .kello-room-360-card-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: clamp(11px, 2.5vw, 12px) clamp(14px, 3vw, 18px);
    font-size: clamp(0.74rem, 2vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    border-radius: 999px;
    margin-top: 4px;
    background: linear-gradient(135deg, #e59a60 0%, #cb7b44 100%);
    color: #140d07;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(224, 149, 92, 0.4);
  }
}
