/* =====================================================================
   WIDOK „NA POSESJI”: zdjęcie domu, na nim model, pod spodem suwak godziny
   i porównanie dwóch wersji. Spokojnie: zdjęcie gra główną rolę, przyciski
   są białe i ciche, jeden akcent (--miedz). Ładuj po wycena.css.
   (WS-DEMO · Wojciech Suszyński)
   ===================================================================== */

/* ---------- kafle wypełnień ze zdjęciem: zaznaczony ma ramkę w kolorze akcentu ---------- */
.kf-kafle .kf-kafel-foto { padding: 0 0 11px; overflow: hidden; }
.kf-kafel-foto .kf-foto { display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 9px; background: var(--papier-2); overflow: hidden; }
.kf-kafel-foto .kf-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.kf-kafel-foto:hover .kf-foto img { transform: scale(1.04); }
.kf-kafel-foto .kf-nazwa, .kf-kafel-foto .kf-opis { padding: 0 11px; }
.kf-kafel-foto .kf-opis { font-size: 12px; }
.kf-kafel-foto .kf-polecane, .kf-k3 .kf-kafel-foto .kf-polecane { position: absolute; order: 0; margin: 0; top: 8px; left: 8px; right: auto; z-index: 1; padding: 4px 8px 3px; border-radius: 999px; background: rgba(255,255,255,.88); color: var(--tekst); font-size: 8.5px; }
.kf-kafel-foto[aria-checked="true"] { border-color: var(--miedz); box-shadow: inset 0 0 0 2px var(--miedz), var(--cien); }
.kf-kafel-foto[aria-checked="true"] .kf-foto { box-shadow: inset 0 0 0 2px var(--miedz); }

/* krótkie i długie napisy przełącznika widoku */
.st-kr { display: none; }

/* ---------- scena: zdjęcie w proporcjach oryginału, model dokładnie nad nim ---------- */
.st-foto { position: absolute; inset: 0; z-index: 0; display: none; background: #1a2029; }
.st-foto img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.st-foto-w { opacity: 0; }
.st[data-tryb="posesja"] { height: auto; aspect-ratio: var(--foto-prop, 16 / 9); background: #1a2029; box-shadow: 0 1px 2px rgba(17,22,29,.08), 0 24px 50px -30px rgba(17,22,29,.45); }
.st[data-tryb="posesja"]::after { display: none; }
.st[data-tryb="posesja"] .st-foto { display: block; }
.st[data-tryb="posesja"] .st-dol, .st[data-tryb="posesja"] .st-kadr, .st[data-tryb="posesja"] .st-podpowiedz, .st[data-tryb="posesja"] .st-miejsce { display: none; }
.st[data-tryb="posesja"] .st-3d canvas { cursor: pointer; }
.st[data-tryb="posesja"] .st-tytul { display: none; }
.st[data-tryb="posesja"] .st-gora { justify-content: flex-end; }
.st[data-tryb="posesja"] .st-tryb { background: rgba(255,255,255,.86); }

/* podpis: zawsze „wizualizacja” */
.st-podpis { display: none; position: absolute; z-index: 4; right: 12px; bottom: 11px; padding: 5px 10px 4px; border-radius: 999px; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.92); background: rgba(12,16,22,.44); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); pointer-events: none; }
.st[data-tryb="posesja"] .st-podpis { display: block; }

/* pełny ekran */
.st-pelny { display: none; position: absolute; z-index: 4; left: 12px; bottom: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%; place-items: center; color: #fff; background: rgba(12,16,22,.44); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, transform .15s; }
.st-pelny:hover { background: rgba(12,16,22,.7); transform: scale(1.05); }
.st-pelny svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st[data-tryb="posesja"] .st-pelny { display: grid; }
/* pełny ekran: wyraźne wyjście z napisem w lewym górnym rogu ekranu */
.kf-scena.st-pelna .st-pelny { position: fixed; z-index: 70; left: 18px; top: 18px; bottom: auto; width: auto; height: 46px; padding: 0 18px 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; background: var(--miedz); color: var(--grafit-950); font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); }
.kf-scena.st-pelna .st-pelny:hover { background: var(--miedz-jasna, #F2B98A); transform: none; }
.kf-scena.st-pelna .st-pelny::after { content: "Wróć do projektu"; }

/* wieczorem: jedno kliknięcie zapala lampki (i dolicza je do ceny) */
.st-led { position: absolute; z-index: 4; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--grafit-950); background: var(--miedz); box-shadow: 0 10px 26px -12px rgba(0,0,0,.7); animation: led-wejscie .45s cubic-bezier(.2,.8,.2,1); transition: transform .15s, background .2s; }
.st-led:hover { background: var(--miedz-jasna); transform: translateY(-1px); }
.st-led span { font-size: 17px; line-height: 1; }
@keyframes led-wejscie { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- pasek pod zdjęciem: brama, godzina, porównanie ---------- */
.st-pod { display: flex; align-items: center; gap: 10px; padding: 12px 0 0; }
.st-pod[hidden], .st-por[hidden] { display: none; }
.st-pod .st-btn { flex: none; background: var(--bialy); border: 1px solid var(--linia); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; min-height: 48px; padding: 10px 18px 10px 13px; }
.st-pod .st-btn:hover { border-color: var(--grafit-900); background: var(--bialy); }
.st-pod .st-otworz { background: var(--grafit-900); border-color: var(--grafit-900); color: #fff; }
.st-pod .st-otworz:hover { background: var(--grafit-800); }
.st-pod .st-por-btn[aria-pressed="true"] { background: var(--grafit-900); border-color: var(--grafit-900); color: #fff; }
.st-ik-por { background: var(--papier-2); }
.st-ik-por::before { width: 10px; height: 10px; border: 1.5px solid var(--tekst); border-radius: 2px; background: linear-gradient(90deg, var(--tekst) 0 50%, transparent 50%); border-top-width: 1.5px; border-bottom-width: 1.5px; }
.st-godzina { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: var(--bialy); border: 1px solid var(--linia); }
.st-g-n { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--szary); white-space: nowrap; }
.st-godzina input { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 30px; margin: 0; background: transparent; --p: 0%; cursor: pointer; }
.st-godzina input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #f1c27d 0%, #e8a56b 38%, #6f7ea6 70%, #26324d 100%); }
.st-godzina input::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #f1c27d 0%, #e8a56b 38%, #6f7ea6 70%, #26324d 100%); }
.st-godzina input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border-radius: 50%; background: var(--bialy); border: 2px solid var(--grafit-900); box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .15s; }
.st-godzina input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--bialy); border: 2px solid var(--grafit-900); }
.st-godzina input:active::-webkit-slider-thumb { transform: scale(1.12); }
.st-godzina input:focus-visible { outline: none; }
.st-godzina:focus-within { border-color: var(--grafit-900); }

/* ---------- porównanie: granica, druga wersja jako obraz przycięty z lewej ---------- */
.st { --granica: 50%; }
.st-wariant { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; max-width: none; pointer-events: none; clip-path: inset(0 0 0 var(--granica)); }
.st[data-por="1"] .st-3d { clip-path: inset(0 calc(100% - var(--granica)) 0 0); }
.st[data-por="1"] .st-3d canvas { cursor: ew-resize; }
.st[data-por="1"] { cursor: ew-resize; touch-action: pan-y; }
.st-dzielnik { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--granica); width: 2px; margin-left: -1px; background: rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(12,16,22,.18), 0 0 18px rgba(0,0,0,.35); cursor: ew-resize; }
.st-dzielnik[hidden], .st-wersja[hidden], .st-wariant[hidden], .st-led[hidden] { display: none; }
.st-dzielnik span { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--bialy); box-shadow: 0 6px 20px -6px rgba(0,0,0,.6), 0 0 0 1px rgba(12,16,22,.08); }
.st-dzielnik span::before, .st-dzielnik span::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border: solid var(--grafit-900); border-width: 0 0 2px 2px; }
.st-dzielnik span::before { left: 12px; transform: translateY(-50%) rotate(45deg); }
.st-dzielnik span::after { right: 12px; transform: translateY(-50%) rotate(-135deg); }
.st-dzielnik:focus-visible { outline: none; }
.st-dzielnik:focus-visible span { box-shadow: 0 0 0 3px var(--miedz), 0 6px 20px -6px rgba(0,0,0,.6); }
.st-wersja { position: absolute; z-index: 3; bottom: 12px; padding: 7px 12px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(12,16,22,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; white-space: nowrap; max-width: 44%; overflow: hidden; text-overflow: ellipsis; }
.st-wersja-a { left: 62px; }
.st-wersja-b { right: 12px; bottom: 44px; background: var(--miedz); color: var(--grafit-950); }
.st-por { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--bialy); border: 1px solid var(--linia); }
.st-por-e { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--miedz-ciemna); }
.st-por-wyp { display: flex; flex-wrap: wrap; gap: 4px; }
.st-por-wyp button { min-height: 36px; padding: 0 12px; border: 1px solid var(--linia); border-radius: 999px; background: var(--bialy); font-size: 13px; font-weight: 600; color: var(--szary); transition: border-color .2s, color .2s, background .2s; }
.st-por-wyp button:hover { border-color: #c9c3b8; color: var(--tekst); }
.st-por-wyp button[aria-checked="true"] { background: var(--grafit-900); border-color: var(--grafit-900); color: #fff; }
.st-por-kol { display: flex; gap: 7px; }
.st-por-kol button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--k); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); transition: transform .15s, box-shadow .2s; }
.st-por-kol button:hover { transform: translateY(-1px); }
.st-por-kol button[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), 0 0 0 2px var(--bialy), 0 0 0 4px var(--grafit-900); }
.st-por-wez { margin-left: auto; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--miedz); color: var(--grafit-950); font-size: 13.5px; font-weight: 650; white-space: nowrap; transition: background .2s, transform .15s; }
.st-por-wez:hover { background: var(--miedz-jasna); transform: translateY(-1px); }

/* ---------- pełny ekran: sama scena na ciemnym tle ---------- */
html.posesja-pelna { overflow: hidden; }
.kf-scena.st-pelna { position: fixed; inset: 0; z-index: 60; height: auto; min-height: 0; max-height: none; padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b0e13; }
.kf-scena.st-pelna .st { width: min(100%, calc((100dvh - 28px - 62px) * var(--foto-n, 1.7778))); border-radius: 14px; flex: none; }
.kf-scena.st-pelna .st-pod, .kf-scena.st-pelna .st-por { width: min(100%, calc((100dvh - 28px - 62px) * var(--foto-n, 1.7778))); }
.kf-scena.st-pelna .st-por { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); width: auto; max-width: calc(100% - 28px); box-shadow: 0 20px 50px -20px rgba(0,0,0,.7); }
.kf-scena.st-pelna .st-godzina, .kf-scena.st-pelna .st-pod .st-btn:not(.st-otworz):not([aria-pressed="true"]) { background: #171d26; border-color: #2a3340; color: #e8ecf1; }
.kf-scena.st-pelna .st-g-n { color: #9aa5b3; }
.kf-scena.st-pelna .st-ik-por { background: #2a3340; }
.kf-scena.st-pelna .st-ik-por::before { border-color: #e8ecf1; background: linear-gradient(90deg, #e8ecf1 0 50%, transparent 50%); }
.kf-scena.st-pelna .st-otworz { background: var(--miedz); border-color: var(--miedz); color: var(--grafit-950); }
.kf-scena.st-pelna .st-otworz .st-ik { background: var(--grafit-950); }
.kf-scena.st-pelna .st-otworz .st-ik::before { border-color: var(--miedz); background: linear-gradient(var(--miedz), var(--miedz)) center/100% 1.5px no-repeat; }

/* ---------- kalibracja kamery (?kalibracja=1) ---------- */
.st-kal { position: fixed; z-index: 70; right: 12px; top: 12px; bottom: 12px; width: 300px; overflow: auto; padding: 16px 16px 18px; border-radius: 16px; background: rgba(17,22,29,.94); color: #e8ecf1; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); font-size: 12.5px; }
.st-kal strong { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--miedz-jasna); }
.st-kal p { margin: 8px 0 12px; line-height: 1.5; color: #aab4c0; }
.st-kal label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 9px; }
.st-kal label span { color: #cfd6de; }
.st-kal output { font-family: var(--f-mono); color: #fff; }
.st-kal input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--miedz); }
.st-kal .kf-btn { width: 100%; justify-content: center; margin-top: 4px; background: var(--miedz); border-color: var(--miedz); color: var(--grafit-950); }
.st-kal textarea { background: #0c1016; color: #e8ecf1; border-color: #2a3340; font-size: 11px; }

@media (max-width: 900px) {
  .st[data-tryb="posesja"] { box-shadow: none; }
  .kf-scena[data-widok="posesja"] { height: auto; min-height: 0; max-height: none; background: var(--papier); box-shadow: 0 8px 20px -16px rgba(17,22,29,.5); }
  .st-pod { padding: 8px 8px; gap: 6px; }
  .st-pod .st-btn { min-height: 44px; padding: 6px 12px 6px 8px; }
  .st-pod .st-otworz span:last-child { display: none; }
  .st-pod .st-otworz { padding: 6px; width: 44px; justify-content: center; }
  .st-godzina { min-height: 44px; padding: 0 12px; gap: 8px; }
  .st-g-n { font-size: 9px; letter-spacing: .1em; }
  .st-pelny { display: none !important; }
  .st-podpis { right: 8px; bottom: 7px; font-size: 8.5px; padding: 4px 8px 3px; }
  .st-led { left: 8px; top: 60px; min-height: 36px; font-size: 12.5px; padding: 0 12px 0 10px; }
  .st-wersja { font-size: 10.5px; padding: 5px 9px 4px; bottom: 7px; }
  .st-wersja-a { left: 8px; }
  .st-wersja-b { right: 8px; bottom: 30px; }
  .st-dzielnik span { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .st-dzielnik span::before { left: 9px; } .st-dzielnik span::after { right: 9px; }
  .st-por { margin: 0 8px 8px; padding: 8px 10px; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .st-por::-webkit-scrollbar { display: none; }
  .st-por-e { display: none; }
  .st-por-wyp { flex-wrap: nowrap; }
  .st-por-wyp button { min-height: 44px; white-space: nowrap; }
  .st-por-kol button { width: 36px; height: 36px; flex: none; }
  .st-por-wez { min-height: 44px; flex: none; }
}
@media (max-width: 560px) {
  .st-dl { display: none; }
  .st-kr { display: inline; }
}
@media print { .st-pod, .st-por, .st-kal, .st-pelny, .st-led { display: none !important; } }
