*, *::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;
    display: none;
}
.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;
}

/* =====================================================
   HOTSPOTY — linia w dół + ikonka u góry
   Cały hotspot to przezroczysty kontener
   Zawartość wstrzykiwana przez JS
   ===================================================== */

.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; /* zostanie nadpisane przez JS */
}

/* Kółko ikonki */
.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;
}

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

/* Ukryj domyślny tooltip */
.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: visible;
    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: 95;
    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; }
}

/* LOGO NAD SCENAMI */
.scenes-logo {
    position: fixed; bottom: 16px; right: 16px; z-index: 95;
    opacity: .7; transition: opacity .2s;
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: rgba(255,255,255,.7);
    font-family: -apple-system, sans-serif;
}
.scenes-logo:hover { opacity: 1; }
.scenes-logo img { height: 22px; width: auto; filter: brightness(0) invert(1); }

/* PRZYCISK REKLAMOWY — pionowy pasek */
#promo-btn {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 100;
    width: 28px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
    border: none; border-radius: 8px 0 0 8px;
    padding: 20px 0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: -2px 0 12px rgba(37,99,235,.4);
    color: #fff;
    animation: promo-pulse 2.5s infinite;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    line-height: 1;
    gap: 8px;
}
#promo-btn:hover { width: 32px; animation: none; box-shadow: -4px 0 18px rgba(37,99,235,.6); }
@keyframes promo-pulse {
    0%,100% { box-shadow: -2px 0 0 0 rgba(37,99,235,.6); }
    50%      { box-shadow: -8px 0 0 4px rgba(37,99,235,0); }
}

/* PANEL REKLAMOWY */
.promo-panel {
    position: fixed; right: 28px; top: 50%; transform: translateY(-50%) scale(.95);
    width: 300px; background: #1e293b;
    border-radius: 14px 0 0 14px; overflow: hidden;
    box-shadow: -8px 0 32px rgba(0,0,0,.5);
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
z-index: 1000;
}
.promo-panel.visible { opacity: 1; pointer-events: all; transform: translateY(-50%) scale(1); }
.promo-header {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
}
.promo-close {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 16px; opacity: .7; padding: 0 4px;
}
.promo-close:hover { opacity: 1; }
.promo-body { padding: 14px 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.promo-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.promo-item {
    display: flex; align-items: center; gap: 12px;
    color: #fff; text-decoration: none;
    background: #000; border-radius: 10px;
    padding: 10px 12px; transition: background .2s;
}
.promo-item:hover { background: rgba(255,255,255,.12); }
.promo-icon { font-size: 22px; flex-shrink: 0; }
.promo-item strong { font-size: 13px; display: block; }
.promo-item small { font-size: 11px; opacity: .6; }
.promo-cta {
    display: block; text-align: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff; text-decoration: none; font-weight: 700; font-size: 13px;
    padding: 10px; border-radius: 8px; transition: opacity .2s;
}
.promo-cta:hover { opacity: .85; }
@media (max-width: 600px) {
    .promo-panel { width: calc(100vw - 32px); right: 16px; }
    #promo-btn { top: 112px; }
}
/* MAPA FULLSCREEN */
#map { width: 100%; height: 100%; border-radius: 12px; overflow: hidden; }
#map-fullscreen-btn {
    position: fixed; top: 120px; right: 20px; z-index: 110;
    width: 36px; height: 36px;
    background: #fff; border: none; border-radius: 50%;
    align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.3); color: #333;
}
.map-panel.fullscreen {
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
    border-radius: 0 !important; transform: none !important;
}
.map-panel.fullscreen #map { border-radius: 0; }

.map-panel.fullscreen .leaflet-top.leaflet-left {
    top: 50px;
}
