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

body{
    font-family:Arial, sans-serif;
    background:#f7f2ea;
    color:#333;
    line-height:1.45;
}

.tour-header{
    position:static;
    z-index:100;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    padding:14px 6%;
    background:#fff;
    box-shadow:0 2px 12px rgba(0,0,0,.08);
}

.tour-logo{
    text-decoration:none;
    color:#0b6d3a;
    line-height:1.1;
}

.tour-logo span{
    display:block;
    font-weight:800;
    font-size:1.35rem;
}

.tour-logo small{
    color:#666;
    font-size:.9rem;
}

.tour-nav{
    display:flex;
    align-items:center;
    gap:18px;
}

.tour-nav a{
    color:#333;
    text-decoration:none;
    font-weight:bold;
}

.tour-nav .btn-prenota{
    background:#0b6d3a;
    color:#fff;
    padding:10px 18px;
    border-radius:999px;
}

.tour-nav a:focus-visible,
.start-tour-btn:focus-visible,
.viewer-actions button:focus-visible,
.help-btn:focus-visible,
.scene-menu button:focus-visible{
    outline:3px solid rgba(11,109,58,.35);
    outline-offset:3px;
}

.tour-intro{
    max-width:1000px;
    margin:auto;
    padding:34px 18px 22px;
    text-align:center;
}

.tour-label{
    color:#0b6d3a;
    font-weight:bold;
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:.78rem;
    margin-bottom:8px;
}

.tour-intro h1{
    color:#0b6d3a;
    font-size:clamp(1.8rem, 4vw, 3rem);
    margin-bottom:10px;
}

.tour-intro p{
    color:#555;
    font-size:1.05rem;
}

.tour-container{
    max-width:1440px;
    margin:auto;
    padding:0 18px 30px;
}

.viewer-box{
    position:relative;
    border-radius:20px;
    overflow:hidden;
    background:#ddd;
    box-shadow:0 18px 50px rgba(0,0,0,.22);
    isolation:isolate;
}

/* Avvio manuale: Pannellum viene inizializzato solo dopo il clic. */
.tour-launcher{
    width:100%;
    height:72vh;
    min-height:500px;
    padding:36px 24px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:20px;
    text-align:center;
    background:
        radial-gradient(circle at center, rgba(255,255,255,.95), rgba(247,242,234,.88)),
        #f7f2ea;
}

.tour-launcher p{
    max-width:680px;
    color:#4b4b4b;
    font-size:1.08rem;
    line-height:1.65;
}

.start-tour-btn{
    min-height:50px;
    padding:14px 26px;
    border:0;
    border-radius:999px;
    background:#0b6d3a;
    color:#fff;
    font-size:1rem;
    font-weight:800;
    cursor:pointer;
    box-shadow:0 8px 22px rgba(11,109,58,.24);
    transition:transform .2s ease, background .2s ease;
}

.start-tour-btn:hover{
    background:#09592f;
    transform:translateY(-2px);
}

.start-tour-btn:disabled{
    cursor:wait;
    opacity:.8;
    transform:none;
}

.tour-launcher[hidden],
#panorama[hidden],
.scene-badge[hidden],
.viewer-actions[hidden],
.help-btn[hidden],
.scene-menu[hidden]{
    display:none !important;
}

#panorama{
    width:100%;
    height:72vh;
    min-height:500px;
    background:#ddd;
}

#panorama .pnlm-panorama-info{
    display:none !important;
}

.viewer-box:fullscreen,
.viewer-box:-webkit-full-screen{
    width:100%;
    height:100%;
    border-radius:0;
    box-shadow:none;
}

.viewer-box:fullscreen #panorama,
.viewer-box:-webkit-full-screen #panorama{
    height:100vh;
    min-height:100vh;
}

.scene-badge{
    position:absolute;
    left:18px;
    bottom:18px;
    z-index:20;
    background:rgba(0,0,0,.62);
    color:#fff;
    padding:12px 18px;
    border-radius:999px;
    font-weight:bold;
    backdrop-filter:blur(4px);
}

.viewer-actions{
    position:absolute;
    right:18px;
    bottom:18px;
    z-index:20;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
    max-width:calc(100% - 280px);
}

.viewer-actions button,
.help-btn{
    border:none;
    background:#0b6d3a;
    color:#fff;
    padding:10px 14px;
    border-radius:999px;
    font-weight:bold;
    cursor:pointer;
    box-shadow:0 4px 14px rgba(0,0,0,.22);
    min-height:42px;
}

.help-btn{
    position:absolute;
    right:18px;
    top:18px;
    z-index:22;
    width:42px;
    height:42px;
    border-radius:50%;
    padding:0;
    font-size:1.2rem;
}

.help-panel{
    position:absolute;
    right:18px;
    top:70px;
    z-index:22;
    width:min(320px, calc(100% - 36px));
    background:rgba(255,255,255,.96);
    padding:16px;
    border-radius:14px;
    box-shadow:0 8px 24px rgba(0,0,0,.2);
}

.help-panel[hidden]{
    display:none;
}

.help-panel.show{
    display:block;
}

.help-panel p{
    color:#555;
    line-height:1.5;
    margin-top:6px;
}

.scene-menu{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:10px;
    margin-top:18px;
}

.scene-menu button{
    border:2px solid #0b6d3a;
    background:#fff;
    color:#0b6d3a;
    padding:12px 18px;
    border-radius:999px;
    cursor:pointer;
    font-weight:bold;
    font-size:.95rem;
    transition:.2s ease;
    min-height:48px;
}

.scene-menu button:hover,
.scene-menu button.active{
    background:#0b6d3a;
    color:#fff;
}

.hotspot-arrow{
    width:44px;
    height:44px;
    border-radius:50%;
    background:#0b6d3a;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 0 0 6px rgba(11,109,58,.25), 0 6px 18px rgba(0,0,0,.35);
    cursor:pointer;
    animation:pulse 1.6s infinite;
}

#panorama .pnlm-hotspot-base{
    z-index:5;
}

#panorama .pnlm-hotspot-base.pnlm-tooltip:hover{
    z-index:35;
}

#panorama .hotspot-arrow.pnlm-tooltip span{
    visibility:hidden !important;
    left:56px;
    right:auto;
    top:50%;
    width:max-content;
    max-width:min(260px, calc(100vw - 120px));
    margin:0;
    padding:8px 11px;
    transform:translateY(-50%);
    border-radius:8px;
    background:rgba(0,0,0,.78);
    box-shadow:0 6px 18px rgba(0,0,0,.3);
    color:#fff;
    line-height:1.35;
    text-align:left;
    white-space:normal;
    pointer-events:none;
}

#panorama .hotspot-arrow.tooltip-left span{
    left:auto;
    right:56px;
}

#panorama .pnlm-tooltip:hover span:after{
    display:none;
}

.hotspot-tooltip{
    position:absolute;
    z-index:45;
    display:none;
    max-width:min(260px, calc(100% - 36px));
    padding:8px 11px;
    border-radius:8px;
    background:rgba(0,0,0,.78);
    box-shadow:0 6px 18px rgba(0,0,0,.3);
    color:#fff;
    font-size:.9rem;
    font-weight:bold;
    line-height:1.35;
    pointer-events:none;
}

.hotspot-tooltip.show{
    display:block;
}

.hotspot-arrow::after{
    content:"➜";
    font-size:1.35rem;
    font-weight:bold;
}

.hotspot-info{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#fff;
    color:#0b6d3a;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 14px rgba(0,0,0,.35);
    cursor:pointer;
}

.hotspot-info::after{
    content:"i";
    font-weight:900;
    font-style:italic;
}

@keyframes pulse{
    0%{transform:scale(1);}
    50%{transform:scale(1.08);}
    100%{transform:scale(1);}
}

.tour-text{
    max-width:980px;
    margin:0 auto 42px;
    padding:0 18px;
    text-align:center;
}

.tour-text h2{
    color:#0b6d3a;
    margin-bottom:10px;
}

.tour-text p{
    color:#555;
    line-height:1.7;
}

.tour-error{
    min-height:500px;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:28px;
    background:#fff;
    color:#7a1f1f;
    font-weight:bold;
    text-align:center;
}

@media(max-width:800px){
    .tour-header{
        flex-direction:column;
        align-items:flex-start;
        padding:12px 18px;
    }

    .tour-nav{
        width:100%;
        justify-content:space-between;
        gap:10px;
        font-size:.9rem;
    }

    .tour-nav .btn-prenota{
        padding:8px 12px;
    }

    .tour-intro{
        padding:24px 14px 16px;
    }

    .tour-container{
        padding:0 10px 24px;
    }

    .viewer-box{
        border-radius:14px;
    }

    .tour-launcher,
    #panorama{
        height:68vh;
        min-height:380px;
    }

    .scene-badge{
        left:10px;
        bottom:10px;
        padding:10px 14px;
        font-size:.9rem;
    }

    .viewer-actions{
        left:auto;
        right:10px;
        top:auto;
        bottom:10px;
        flex-direction:column;
        align-items:flex-end;
        max-width:calc(100% - 210px);
    }

    .viewer-actions button{
        padding:8px 12px;
        font-size:.85rem;
    }

    .help-btn{
        right:10px;
        top:10px;
    }

    .scene-menu button{
        width:100%;
        max-width:360px;
    }

    .tour-error{
        min-height:380px;
    }
}

@media(max-width:480px){
    .tour-logo span{
        font-size:1.15rem;
    }

    .tour-nav{
        flex-wrap:wrap;
    }

    .tour-launcher,
    #panorama{
        height:62vh;
        min-height:320px;
    }

    .viewer-actions button{
        padding:8px 10px;
        font-size:.82rem;
    }

    .scene-badge{
        max-width:calc(100% - 20px);
        border-radius:8px;
    }

    .tour-error{
        min-height:320px;
    }
}
/* FULLSCREEN TOUR 360 */
.viewer-box:fullscreen{
    width:100vw;
    height:100vh;
    border-radius:0;
}

.viewer-box:fullscreen #panorama{
    width:100vw;
    height:100vh;
    min-height:100vh;
}

/* Safari / vecchi browser */
.viewer-box:-webkit-full-screen{
    width:100vw;
    height:100vh;
    border-radius:0;
}

.viewer-box:-webkit-full-screen #panorama{
    width:100vw;
    height:100vh;
    min-height:100vh;
}
.language-switcher{
    display:flex;
    align-items:center;
    gap:6px;
    margin-left:8px;
}

.language-switcher a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    padding:0;
    text-decoration:none;
    font-size:1.45rem;
    line-height:1;
    border-radius:8px;
}

.language-switcher a:hover,
.language-switcher a[aria-current="page"]{
    background:rgba(11,109,58,.10);
}

@media(max-width:800px){
    .language-switcher{
        gap:2px;
        margin-left:0;
    }

    .language-switcher a{
        width:38px;
        height:40px;
        font-size:1.35rem;
    }
}

@media(max-width:480px){
    .language-switcher{
        gap:0;
    }

    .language-switcher a{
        width:36px;
        height:40px;
        font-size:1.3rem;
    }
}
.tour-logo{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color:#0b6d3a;
    line-height:1.1;
}

.tour-logo img{
    width:110px;
    height:110px;
    object-fit:contain;
    flex-shrink:0;
}

.tour-logo span{
    display:block;
    font-weight:800;
    font-size:1.25rem;
}

.tour-logo small{
    display:block;
    color:#666;
    font-size:.9rem;
}

@media(max-width:800px){
    .tour-logo img{
        width:90px;
        height:90px;
    }
}