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

:root {
    --blue: #2563eb;
}

html, body { height: 100%; overflow: hidden; background: #000; }

/* TOPBAR */
.viewer-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
    padding: 10px 16px 20px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: flex; align-items: flex-start; gap: 12px;
}
.topbar-back {
    color: #fff; text-decoration: none; font-size: 13px;
    opacity: .85; white-space: nowrap; padding-top: 2px;
    transition: opacity .15s; flex-shrink: 0;
}
.topbar-back:hover { opacity: 1; }
.topbar-texts { display: flex; flex-direction: column; gap: 2px; }
.topbar-title { font-size: 14px; font-weight: 600; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-scene { font-size: 12px; opacity: .6; white-space: nowrap; }

.pnlm-controls-container {
    top: 58px !important;
    left: 16px !important;
}

/* PANORAMA */
#pano-a, #pano-b {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    transition: opacity 0.5s ease;
}
#pano-b { opacity: 0; pointer-events: none; }

/* PANEL SCEN */
.scenes-panel {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
    background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
    padding: 24px 16px 12px;
}
.scenes-scroll {
    display: flex; gap: 10px; overflow-x: auto;
    scrollbar-width: none; padding-bottom: 4px;
}
.scenes-scroll::-webkit-scrollbar { display: none; }
.scene-thumb-btn {
    flex-shrink: 0; width: 90px;
    text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.scene-thumb-btn img,
.scene-thumb-placeholder {
    width: 90px; height: 50px;
    border-radius: 6px; object-fit: cover;
    border: 2px solid transparent;
    transition: border-color .2s;
    background: #333;
    display: flex; align-items: center; justify-content: center;
    color: #666; font-size: 10px; font-weight: 600;
}
.scene-thumb-btn.active img,
.scene-thumb-btn.active .scene-thumb-placeholder { border-color: var(--blue); }
.scene-thumb-btn span {
    color: #fff; font-size: 10px; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    width: 90px; font-family: -apple-system, sans-serif;
}

.pnlm-hotspot.hs-scene,
.pnlm-hotspot.hs-info {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 40px !important;
    height: 120px !important;
}

.hs-dot {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
    transition: transform .2s;
}
.pnlm-hotspot.hs-scene:hover .hs-dot,
.pnlm-hotspot.hs-info:hover .hs-dot { transform: scale(1.12); }

.hs-dot-scene {
    background: rgba(37,99,235,.9);
    border: 2px solid #fff;
    width: 56px !important; height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.hs-dot-scene img {
    width: 40px; height: 40px;
    object-fit: contain;
    filter: brightness(10);
    pointer-events: none;
    display: block;
}

.hs-dot-info {
    width: 28px !important; height: 28px !important;
    background: rgba(255,255,255,.92);
    border: 2px solid #2563eb;
    font-size: 14px; font-weight: 700;
    color: #2563eb;
    font-family: Georgia, serif; font-style: italic;
}

.hs-line {
    width: 1px;
    background: rgba(255,255,255,0.85);
    flex: 1;
    min-height: 40px;
}

.pnlm-hotspot span { display: none !important; }

/* MAPA */
#map-toggle-btn {
    position: fixed; right: 16px; top: 60px; z-index: 100;
    width: 44px; height: 44px;
    background: #fff; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3);
    color: var(--blue); transition: transform .2s;
}
#map-toggle-btn:hover { transform: scale(1.08); }

.map-panel {
    position: fixed; right: 16px; top: 114px; z-index: 99;
    width: 336px; height: 264px;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    opacity: 0; pointer-events: none;
    transform: scale(.95) translateY(-8px);
    transition: opacity .25s, transform .25s;
}
@media (max-width: 600px) {
    .map-panel { width: 280px; height: 220px; }
}
.map-panel.visible { opacity: 1; pointer-events: all; transform: scale(1) translateY(0); }
#map { width: 100%; height: 100%; }
#map-close {
    position: absolute; top: 6px; right: 6px; z-index: 10;
    background: #fff; border: none; border-radius: 50%;
    width: 24px; height: 24px; cursor: pointer;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.map-marker {
    width: 20px; height: 20px;
    background: var(--blue); border: 3px solid #fff;
    border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* INFO PANEL */
.info-panel {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; font-family: -apple-system, sans-serif;
}
.info-box {
    background: #fff; border-radius: 14px;
    padding: 28px; max-width: 400px; width: 100%;
    position: relative;
}
.info-close {
    position: absolute; top: 14px; right: 14px;
    background: none; border: none; font-size: 18px;
    cursor: pointer; color: #9ca3af;
}
#info-logo {
    width: 80px; height: 80px; object-fit: contain;
    border-radius: 8px; margin-bottom: 14px;
    border: 1px solid #e5e7eb;
}
.info-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #111; }
.info-desc { font-size: 14px; color: #4b5563; line-height: 1.6; }
.info-desc a { color: var(--blue); text-decoration: none; }
.info-desc a:hover { text-decoration: underline; }
.info-btn-see {
    display: inline-block; margin-top: 14px;
    background: #fff; color: #111;
    padding: 8px 20px; border-radius: 8px;
    text-decoration: none; font-size: 14px; font-weight: 600;
    border: 1px solid #d1d5db;
    transition: background .15s;
}
.info-btn-see:hover { background: #f3f4f6; }

/* SPINNER */
#loading-bar {
    position: fixed; top: 0; left: 0; height: 3px;
    background: var(--blue); width: 0%; transition: width 0.3s;
    z-index: 9999;
}
#spinner {
    position: fixed; inset: 0; background: #000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 9998; transition: opacity 0.4s ease;
}
#spinner svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#spinner span {
    margin-top: 16px; color: #fff;
    font-size: 15px; font-family: sans-serif;
    letter-spacing: 0.05em; opacity: 0.8;
}

/* STOPKA */
.site-footer {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; padding: 20px 24px;
    font-size: 13px; color: #6b7280; border-top: 1px solid #e5e7eb;
    font-family: -apple-system, sans-serif;
}
.footer-right { display: flex; align-items: center; gap: 8px; }
.footer-logo { height: 28px; width: auto; object-fit: contain; vertical-align: middle; transition: opacity .2s; }
.footer-logo:hover { opacity: .75; }

/* CTA BAR */
.cta-bar {
    position: fixed; bottom: 100px; left: 16px; z-index: 10000;
    display: flex; align-items: center; gap: 6px;
    pointer-events: none;
}
.cta-btn {
    pointer-events: all;
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff; text-decoration: none;
    font-size: 13px; font-weight: 600;
    padding: 10px 18px; border-radius: 50px;
    box-shadow: 0 4px 20px rgba(37,99,235,.5);
    transition: transform .2s, box-shadow .2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    cursor: pointer;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37,99,235,.6);
}
@media (max-width: 600px) {
    .cta-bar { bottom: 110px; left: 8px; }
    .cta-btn { font-size: 12px; padding: 9px 14px; gap: 6px; }
}

.viewer-topbar { display: none !important; }
