/* tour.css — Tour virtual 360 auto-alojado de tarraula.us
   Estética premium on-brand sobre Photo Sphere Viewer v5.
   Tokens de marca heredados de css/styles.css (:root): --color-bg #2d292a,
   --color-accent #3d6f7d / hover #4e8898, --color-text-muted #8fa0a4,
   --font-display Playfair Display, --font-body DM Sans. */

.tour-360 {
  position: relative; width: 100%; overflow: hidden;
  border: 1px solid var(--color-border, #3d3a3b);
  background: #16191b;
  box-shadow: 0 28px 70px -45px rgba(0, 0, 0, .85);
}

/* Altura del contenedor (misma escala que tenía el iframe) */
.tour-360 { height: 600px; }
@media (max-width: 1024px) { .tour-360 { height: 460px; } }
@media (max-width: 768px)  { .tour-360 { height: 380px; } }
@media (max-width: 480px)  { .tour-360 { height: 320px; } }
/* Visor y póster SUPERPUESTOS (para poder fundir el póster sobre la escena al cargar) */
.tour-360__stage,
.tour-360__launch { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tour-360__launch { z-index: 5; }

/* ---------- Póster de inicio (carga diferida) ---------- */
.tour-360__launch {
  border: none; cursor: pointer; padding: 0; margin: 0;
  background-color: #14191b; background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  color: #fff; isolation: isolate; overflow: hidden;
  transition: opacity .55s cubic-bezier(.22, 1, .36, 1);
}
/* fundido del póster sobre la escena al terminar de cargar (sin corte seco) */
.tour-360__launch.is-hiding { opacity: 0; pointer-events: none; }
/* scrim en degradado (legibilidad, no plano) */
.tour-360__launch::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 90% at 50% 38%, rgba(20, 23, 25, .25) 0%, rgba(15, 17, 19, .62) 70%, rgba(13, 15, 16, .82) 100%);
  transition: opacity .5s cubic-bezier(.22, 1, .36, 1);
}
.tour-360__launch:hover::before { opacity: .82; }
/* badge 360 arriba-derecha */
.tour-360__badge {
  position: absolute; top: 18px; right: 20px;
  font-family: var(--font-body, sans-serif); font-size: 10px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .85);
  padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  backdrop-filter: blur(2px);
}
.tour-360__play {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(61, 111, 125, .14); color: #fff; font-size: 24px; padding-left: 5px;
  border: 1.5px solid rgba(255, 255, 255, .55);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), background .35s ease, border-color .35s ease;
}
.tour-360__play::after { /* halo respirando, sin bounce */
  content: ""; position: absolute; inset: -1.5px; border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .28); animation: tour-halo 3.4s cubic-bezier(.22, 1, .36, 1) infinite;
}
.tour-360__launch:hover .tour-360__play {
  transform: scale(1.07); background: var(--color-accent, #3d6f7d); border-color: var(--color-accent-hover, #4e8898);
}
@keyframes tour-halo {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .30); }
  70% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.tour-360__label {
  position: relative; text-align: center; display: flex; flex-direction: column; gap: 6px;
}
.tour-360__label b {
  font-family: var(--font-display, Georgia), serif; font-weight: 500; font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: .01em; line-height: 1.1;
}
.tour-360__label span {
  font-family: var(--font-body, sans-serif); font-size: 11px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .7);
}
.tour-360__launch.is-loading .tour-360__play { animation: none; opacity: .55; }
.tour-360__launch.is-loading .tour-360__play::after { animation: none; }

/* Hint efímero "arrastra para mirar" al abrir el visor */
.tour-360__hint {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%);
  z-index: 60; pointer-events: none;
  font-family: var(--font-body, sans-serif); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: #fff;
  background: rgba(20, 23, 25, .58); backdrop-filter: blur(6px);
  padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  display: flex; align-items: center; gap: 9px;
  opacity: 0; animation: tour-hint 4.6s ease forwards;
}
.tour-360__hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
@keyframes tour-hint {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  14%, 70% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

/* ---------- Hotspots / marcadores ---------- */
/* Área táctil cómoda (≥44px) con el anillo centrado dentro */
.tour-hotspot {
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-sizing: border-box;
  width: 46px; height: 46px;
}

/* Enlace de navegación: anillo doble elegante */
.tour-hotspot--link { position: relative; }
.tour-hotspot--link::before { /* anillo exterior fino */
  content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .45);
  transition: width .35s cubic-bezier(.22, 1, .36, 1), height .35s cubic-bezier(.22, 1, .36, 1), border-color .25s ease;
}
.tour-hotspot--link::after { /* punto interior + halo respirando */
  content: ""; width: 11px; height: 11px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .4); animation: tour-dot 3s cubic-bezier(.22, 1, .36, 1) infinite;
  transition: background .25s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
}
.tour-hotspot--link:hover::before { width: 46px; height: 46px; border-color: var(--color-accent-hover, #4e8898); }
.tour-hotspot--link:hover::after { background: var(--color-accent-hover, #4e8898); transform: scale(1.15); animation: none; }
@keyframes tour-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); }
  70% { box-shadow: 0 0 0 13px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Hotspot de información */
.tour-hotspot--info {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-accent, #3d6f7d); border: 1.5px solid rgba(255, 255, 255, .9); color: #fff;
  font-family: var(--font-display, Georgia), serif; font-style: italic; font-weight: 600; font-size: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4); transition: transform .3s cubic-bezier(.22, 1, .36, 1), background .25s ease;
}
.tour-hotspot--info:hover { transform: scale(1.12); background: var(--color-accent-hover, #4e8898); }

/* ---------- Controles PSV on-brand ---------- */
.psv-container { background: #16191b; }

/* Barra de controles: scrim que se funde con la imagen (sin caja dura),
   controles a la derecha, auto-oculta en reposo (estilo reproductor premium) */
.tour-360 .psv-navbar {
  height: 60px; justify-content: flex-end; padding: 0 12px 0 0; gap: 4px;
  background: linear-gradient(to top, rgba(15, 13, 14, .7) 0%, rgba(15, 13, 14, .18) 58%, transparent 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none; border-top: none;
  font-family: var(--font-body, sans-serif);
  transition: opacity .45s cubic-bezier(.22, 1, .36, 1);
}
.tour-360 .psv-button { height: 22px; width: 22px; padding: 12px; border-radius: 10px; align-self: center; transition: background .2s ease; }
/* el icono es un SVG: se recolorea con fill, no con color */
.tour-360 .psv-button-svg { fill: rgba(255, 255, 255, .85); transition: fill .2s ease; }
.tour-360 .psv-button:hover { background: rgba(61, 111, 125, .42) !important; }
.tour-360 .psv-button:hover .psv-button-svg { fill: #fff; }
.tour-360 .psv-button--active { background: rgba(61, 111, 125, .55) !important; }
.tour-360 .psv-button--active .psv-button-svg { fill: #fff; }
/* botón de pantalla completa custom (icono via color/currentColor) */
.tour-360 .tour-fs-btn svg { width: 18px; height: 18px; color: rgba(255, 255, 255, .85); transition: color .2s ease; }
.tour-360 .tour-fs-btn:hover svg { color: #fff; }
.tour-360--fs .tour-fs-btn svg { color: var(--color-accent-hover, #4e8898); }

/* Pantalla completa simulada por CSS (iPhone Safari no soporta fullscreen de div/canvas) */
.tour-360--fs {
  position: fixed !important; inset: 0 !important; z-index: 9999 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  margin: 0 !important; border: none !important; box-shadow: none !important;
}
.tour-360--fs .tour-360__stage { height: 100% !important; }
body.tour-360-fs-lock { overflow: hidden !important; }

/* Caption editorial flotante (nombre del proyecto), arriba-izquierda */
.tour-360__caption {
  position: absolute; top: 18px; left: 22px; z-index: 60; pointer-events: none;
  font-family: var(--font-body, sans-serif); font-size: 11px; font-weight: 600;
  letter-spacing: .24em; text-transform: uppercase; color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 18px rgba(0, 0, 0, .6);
  transition: opacity .45s cubic-bezier(.22, 1, .36, 1), transform .45s cubic-bezier(.22, 1, .36, 1);
}

/* Auto-ocultar los controles cuando no hay interacción */
.tour-360.is-idle .psv-navbar { opacity: 0; }
.tour-360.is-idle .tour-360__caption { opacity: 0; transform: translateY(-6px); }

/* Tooltips (nombre de destino al pasar por un anillo) */
.tour-360 .psv-tooltip { background: rgba(20, 23, 25, .92); border: 1px solid rgba(255, 255, 255, .1); border-radius: 3px; box-shadow: 0 8px 30px -10px rgba(0, 0, 0, .7); }
.tour-360 .psv-tooltip-content {
  font-family: var(--font-body, sans-serif); font-size: 10.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: #fff; text-shadow: none; padding: .55em 1em;
}
.tour-360 .psv-tooltip-arrow { display: none; }

/* Loader on-brand */
.tour-360 .psv-loader { --psv-loader-color: var(--color-accent, #3d6f7d); border-color: rgba(255, 255, 255, .12); }
.tour-360 .psv-loader-text { font-family: var(--font-body, sans-serif); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

/* Galería de miniaturas: tarjetas refinadas */
.tour-360 .psv-gallery {
  background: linear-gradient(to top, rgba(18, 16, 17, .92), rgba(18, 16, 17, .7));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, .08); border-bottom: none; padding: 4px 0;
}
.tour-360 .psv-gallery-item { border-radius: 2px; outline: 1px solid rgba(255, 255, 255, .14); outline-offset: -1px; }
.tour-360 .psv-gallery-item--active { outline: 2px solid var(--color-accent-hover, #4e8898); outline-offset: -2px; }
.tour-360 .psv-gallery-item--active::after {
  content: ""; position: absolute; inset: 0; z-index: 2; box-shadow: inset 0 0 0 9999px rgba(61, 111, 125, .12);
}
.tour-360 .psv-gallery-item:hover .psv-gallery-item-thumb { transform: scale3d(1.06, 1.06, 1); }
.tour-360 .psv-gallery-item-title {
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  font-family: var(--font-body, sans-serif); font-size: 10px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; align-items: flex-end; height: 100%; padding: 8px;
}

/* Toque cómodo en móvil */
@media (max-width: 768px) {
  .tour-360 .psv-button { padding: 13px; }
  .tour-hotspot { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-360__play::after, .tour-hotspot--link::after, .tour-360__hint { animation: none; }
}
