/* ============================================================
   HOTEL PRÍNCIPE — Museografía Virtual 360°
   Estilos de la página del recorrido.
   ============================================================ */

:root {
    --roble-oscuro:  #3E2B23;
    --vinotinto:     #6E3B3B;
    --beige:         #EFE6D7;
    --crema:         #FBF7EE;
    --dorado:        #B08D57;
    --dorado-claro:  #C9AC7C;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.tour-body {
    font-family: var(--font-sans);
    background: #221711;
    color: var(--crema);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ================= BARRA SUPERIOR ================= */
.tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: .8rem 1.6rem;
    background: rgba(42, 29, 22, .97);
    border-bottom: 1px solid rgba(201, 172, 124, .25);
    z-index: 20;
}

.tour-header__back {
    color: var(--dorado-claro);
    text-decoration: none;
    font-size: .8rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .3s ease;
}
.tour-header__back:hover { color: var(--crema); }

.tour-header__title { text-align: center; flex: 1; min-width: 0; }
.tour-header__label {
    display: block;
    font-size: .62rem;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--dorado);
}
.tour-header__title h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2.6vw, 1.5rem);
    font-weight: 600;
    color: var(--crema);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tour-header__info-toggle {
    font-family: var(--font-sans);
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--dorado-claro);
    background: transparent;
    border: 1px solid rgba(201, 172, 124, .45);
    padding: .5rem 1.1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all .3s ease;
}
.tour-header__info-toggle:hover,
.tour-header__info-toggle[aria-expanded="true"] {
    background: var(--dorado);
    color: var(--crema);
    border-color: var(--dorado);
}

/* ================= VISOR ================= */
.tour-main { position: relative; flex: 1; min-height: 0; }

#panorama { width: 100%; height: 100%; }

/* Personalización de Pannellum */
#panorama .pnlm-load-box {
    background: rgba(42, 29, 22, .9);
    border: 1px solid var(--dorado);
    border-radius: 0;
    font-family: var(--font-serif);
    color: var(--crema);
}
#panorama .pnlm-compass { display: none; }

/* Hotspot personalizado: flecha dorada para "caminar" */
.hotspot-caminar {
    width: 58px !important;
    height: 58px !important;
    background: rgba(42, 29, 22, .75) !important;
    border: 2px solid var(--dorado);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: hotspotPulse 2.4s ease-in-out infinite;
    transition: transform .3s ease, background .3s ease;
}
.hotspot-caminar::before {
    content: '➤';
    font-size: 1.3rem;
    color: var(--dorado-claro);
    transform: rotate(-90deg);
}
.hotspot-caminar:hover {
    transform: scale(1.18);
    background: rgba(176, 141, 87, .85) !important;
}
.hotspot-caminar:hover::before { color: var(--crema); }

@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 172, 124, .55); }
    50%      { box-shadow: 0 0 0 16px rgba(201, 172, 124, 0); }
}

/* Tooltip del hotspot */
div.pnlm-tooltip span {
    font-family: var(--font-sans);
    font-size: .78rem;
    letter-spacing: .1em;
    background: rgba(42, 29, 22, .95);
    border: 1px solid rgba(201, 172, 124, .5);
    border-radius: 0;
    color: var(--crema);
    padding: .45rem .9rem;
}

/* Transición al "caminar" (fundido) */
.tour-fade {
    position: absolute;
    inset: 0;
    background: #221711;
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease;
    z-index: 5;
}
.tour-fade.active { opacity: 1; }

/* Hotspot de obra: marcador ✦ sobre cada cuadro */
.hotspot-obra {
    width: 34px !important;
    height: 34px !important;
    background: rgba(42, 29, 22, .8) !important;
    border: 1px solid var(--dorado-claro);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .3s ease, background .3s ease;
    animation: obraGlow 3s ease-in-out infinite;
}
.hotspot-obra::before {
    content: '✦';
    font-size: .95rem;
    color: var(--dorado-claro);
}
.hotspot-obra:hover {
    transform: scale(1.3);
    background: var(--dorado) !important;
}
.hotspot-obra:hover::before { color: var(--crema); }

@keyframes obraGlow {
    0%, 100% { box-shadow: 0 0 6px 1px rgba(201, 172, 124, .5); }
    50%      { box-shadow: 0 0 14px 4px rgba(201, 172, 124, .25); }
}

/* ================= FICHA DE OBRA (MODAL) ================= */
.obra-modal {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity .3s ease;
}
/* CLAVE: cuando está oculto NO debe cubrir la pantalla
   (display:flex anularía el atributo hidden y bloquearía
   el arrastre 360 y todos los clics del visor) */
.obra-modal[hidden] { display: none; }
.obra-modal.open { opacity: 1; }

.obra-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 12, 8, .78);
    backdrop-filter: blur(4px);
}

.obra-modal__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 0;
    width: min(820px, 100%);
    max-height: 88%;
    background: #2E2018;
    border: 1px solid rgba(201, 172, 124, .45);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
    overflow: hidden;
    transform: translateY(16px);
    transition: transform .3s ease;
}
.obra-modal.open .obra-modal__card { transform: translateY(0); }

.obra-modal__close {
    position: absolute;
    top: .6rem; right: .8rem;
    z-index: 2;
    width: 38px; height: 38px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--dorado-claro);
    background: rgba(42, 29, 22, .8);
    border: 1px solid rgba(201, 172, 124, .4);
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s ease;
}
.obra-modal__close:hover { background: var(--dorado); color: var(--crema); }

.obra-modal__media {
    margin: 0;
    background: #241811;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.6rem;
}
.obra-modal__media img {
    max-width: 100%;
    max-height: 60vh;
    box-shadow: 0 20px 45px -18px rgba(0, 0, 0, .8);
}

.obra-modal__info {
    padding: 2.2rem 2rem;
    overflow-y: auto;
}
.obra-modal__label {
    font-size: .64rem;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--dorado);
    margin-bottom: .7rem;
}
.obra-modal__titulo {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--crema);
    line-height: 1.2;
    margin-bottom: .5rem;
}
.obra-modal__meta {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    color: var(--dorado-claro);
    margin-bottom: .3rem;
}
.obra-modal__tecnica {
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(251, 247, 238, .55);
}
.obra-modal__sep {
    width: 40px; height: 1px;
    background: var(--dorado);
    margin: 1.2rem 0;
}
.obra-modal__descripcion {
    font-size: .92rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(251, 247, 238, .85);
    margin-bottom: 1.2rem;
}
.obra-modal__sala {
    font-size: .74rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dorado);
}

@media (max-width: 640px) {
    .obra-modal__card { grid-template-columns: 1fr; overflow-y: auto; }
    .obra-modal__media { padding: 1.2rem; }
    .obra-modal__media img { max-height: 34vh; }
    .obra-modal__info { padding: 1.4rem 1.4rem 1.8rem; }
}

/* ================= PANEL DE INFORMACIÓN ================= */
.tour-info {
    position: absolute;
    top: 1.4rem;
    left: 1.4rem;
    width: min(340px, calc(100% - 2.8rem));
    background: rgba(42, 29, 22, .92);
    border: 1px solid rgba(201, 172, 124, .35);
    backdrop-filter: blur(8px);
    padding: 1.6rem 1.7rem;
    z-index: 10;
    transition: transform .45s ease, opacity .45s ease;
}
.tour-info.hidden {
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

.tour-info__ornament {
    width: 36px; height: 1px;
    background: var(--dorado);
    margin-bottom: 1rem;
}
.tour-info__nombre {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dorado-claro);
    margin-bottom: .6rem;
}
.tour-info__descripcion {
    font-size: .87rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(251, 247, 238, .85);
    margin-bottom: 1.2rem;
}
.tour-info__obras-titulo {
    font-size: .66rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--dorado);
    margin-bottom: .6rem;
}
.tour-info__obras { list-style: none; }
.tour-info__obras li {
    font-size: .84rem;
    color: rgba(251, 247, 238, .78);
    padding: .35rem 0 .35rem 1.1rem;
    position: relative;
}
.tour-info__obras li::before {
    content: '◆';
    position: absolute;
    left: 0;
    font-size: .5rem;
    color: var(--dorado);
    top: .65rem;
}

/* ================= NAVEGACIÓN INFERIOR ================= */
.tour-nav {
    position: absolute;
    bottom: 3.6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: rgba(42, 29, 22, .92);
    border: 1px solid rgba(201, 172, 124, .35);
    backdrop-filter: blur(8px);
    padding: .7rem 1.2rem;
    z-index: 10;
}

.tour-nav__arrow {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--dorado-claro);
    background: transparent;
    border: 1px solid rgba(201, 172, 124, .45);
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s ease;
}
.tour-nav__arrow:hover {
    background: var(--dorado);
    color: var(--crema);
    transform: scale(1.08);
}

.tour-nav__salas { display: flex; gap: .55rem; }

.sala-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 1px solid var(--dorado);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all .3s ease;
    position: relative;
}
.sala-dot:hover { transform: scale(1.3); }
.sala-dot.active {
    background: var(--dorado);
    box-shadow: 0 0 10px rgba(201, 172, 124, .8);
}

/* Nombre de sala al pasar el ratón por el punto */
.sala-dot::after {
    content: attr(data-nombre);
    position: absolute;
    bottom: 165%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: .68rem;
    letter-spacing: .1em;
    color: var(--crema);
    background: rgba(42, 29, 22, .95);
    border: 1px solid rgba(201, 172, 124, .4);
    padding: .3rem .7rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.sala-dot:hover::after { opacity: 1; }

/* ================= PISTA INFERIOR ================= */
.tour-hint {
    position: absolute;
    bottom: .9rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 92%;
    text-align: center;
    font-size: .68rem;
    letter-spacing: .12em;
    color: rgba(251, 247, 238, .55);
    z-index: 10;
    transition: opacity 1s ease;
}
.tour-hint.faded { opacity: 0; }

/* ================= RESPONSIVE ================= */
@media (max-width: 700px) {
    .tour-header { flex-wrap: wrap; gap: .6rem; padding: .7rem 1rem; }
    .tour-header__title { order: 3; flex-basis: 100%; }

    .tour-info {
        top: auto;
        bottom: 8.8rem;
        left: 1rem;
        width: calc(100% - 2rem);
        max-height: 30vh;
        overflow-y: auto;
        padding: 1.1rem 1.2rem;
    }
    .tour-info.hidden { transform: translateY(130%); }

    /* Barra de navegación al fondo, con aire respecto a los botones */
    .tour-nav { bottom: 1rem; padding: .5rem .8rem; gap: .7rem; }
    .tour-nav__arrow { width: 40px; height: 40px; font-size: 1.4rem; }

    /* La pista larga se amontonaba sobre la barra: se oculta en móvil
       (las flechas, marcadores ✦ y el arrastre son autoexplicativos). */
    .tour-hint { display: none; }
}

/* ============================================================
   RECORRIDO REAL — Escenario de fotos reales
   ============================================================ */
.stage-host { position: relative; overflow: hidden; background: #0e0b09; }
.stage { position: absolute; inset: 0; }

.stage__img {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity .9s ease;
    will-change: opacity, transform;
}
.stage__img.is-visible { opacity: 1; }

/* Ken Burns muy sutil (solo fotos normales) */
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.09); } }
.stage__img--kb.is-visible { animation: kenburns 26s ease-out both; }

/* Panorámica ancha: se arrastra horizontalmente */
.stage__img--pan { background-size: auto 100%; cursor: grab; animation: none !important; transform: none !important; }
.stage-host.is-dragging .stage__img--pan { cursor: grabbing; }

/* Velo para legibilidad de textos/controles */
.stage__scrim {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(14,10,8,.42) 0%, transparent 22%, transparent 62%, rgba(14,10,8,.62) 100%),
        radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(14,10,8,.35) 100%);
}
/* Oscurecimiento breve al "caminar" */
.stage-host.is-walking .stage__scrim { background: rgba(10,7,5,.7); transition: background .18s ease; }

/* Marcadores ✦ sobre los cuadros */
.stage__markers { position: absolute; inset: 0; z-index: 4; }
.obra-marker {
    position: absolute; transform: translate(-50%, -50%);
    width: 30px; height: 30px; border-radius: 50%;
    border: 0; cursor: pointer; padding: 0;
    background: radial-gradient(circle, var(--dorado-claro) 0%, var(--dorado) 60%, rgba(176,141,87,.2) 72%, transparent 74%);
    display: flex; align-items: center; justify-content: center;
}
.obra-marker::after { content: '✦'; color: #fff; font-size: .9rem; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.obra-marker__pulse {
    position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid var(--dorado-claro); opacity: .8;
    animation: markerPulse 2.4s ease-out infinite;
}
@keyframes markerPulse { 0% { transform: scale(.7); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }
.obra-marker__tip {
    position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
    background: rgba(46,32,25,.96); color: var(--crema);
    font-family: var(--font-sans); font-size: .72rem; letter-spacing: .04em;
    padding: .35rem .7rem; border-radius: 4px; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
    border-top: 2px solid var(--dorado);
}
.obra-marker:hover .obra-marker__tip, .obra-marker:focus .obra-marker__tip { opacity: 1; }

/* Botones "caminar a" (según el mapa real) */
.stage__go {
    position: absolute; z-index: 5;
    /* Deben flotar POR ENCIMA de la barra .tour-nav (que sube hasta
       ~124px desde abajo): 150px deja aire y evita que se tapen. */
    left: 50%; bottom: 150px; transform: translateX(-50%);
    display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center;
    max-width: min(92%, 760px);
}
.go-btn {
    font-family: var(--font-sans); font-size: .74rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--crema); cursor: pointer;
    background: rgba(30,20,15,.55); backdrop-filter: blur(6px);
    border: 1px solid rgba(201,172,124,.55);
    padding: .6rem 1.1rem; border-radius: 40px;
    transition: all .25s ease;
}
.go-btn:hover { background: var(--dorado); border-color: var(--dorado); color: #fff; transform: translateY(-2px); }
.go-btn__ico { color: var(--dorado-claro); margin-right: .15rem; }
.go-btn:hover .go-btn__ico { color: #fff; }

/* Obras en el panel lateral: ahora clicables con miniatura */
.tour-info__obras { display: flex; flex-direction: column; gap: .6rem; }
.tour-info__obras li.obra-item {
    display: flex; align-items: center; gap: .7rem;
    padding: .45rem; border-radius: 6px; cursor: pointer;
    background: rgba(255,255,255,.03); border: 1px solid rgba(201,172,124,.15);
    transition: all .2s ease;
}
.tour-info__obras li.obra-item::before { display: none; }
.tour-info__obras li.obra-item:hover { background: rgba(201,172,124,.14); border-color: rgba(201,172,124,.45); }
.obra-item__thumb {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 4px;
    background-size: cover; background-position: center;
    box-shadow: 0 2px 8px -3px rgba(0,0,0,.6);
}
.obra-item__txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.obra-item__txt strong { font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; color: var(--crema); }
.obra-item__txt small { font-size: .72rem; color: var(--dorado-claro); }
.obra-item--vacia { display: block !important; cursor: default; opacity: .8; font-size: .86rem; }
.obra-item--vacia:hover { background: rgba(255,255,255,.03); }

@media (max-width: 700px) {
    /* Botones "caminar a": una sola fila deslizable (no se apilan ni
       chocan con la barra de navegación aunque la sala tenga 3-4 salidas). */
    .stage__go {
        left: 0; right: 0; bottom: 4.7rem;
        transform: none;
        max-width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: .5rem;
        padding: 0 1rem;
    }
    .stage__go::-webkit-scrollbar { display: none; }
    .go-btn {
        font-size: .66rem;
        padding: .5rem .8rem;
        white-space: nowrap;
        flex: 0 0 auto;
    }
    .stage__img--pan { background-size: auto 100%; }
}
