/* ==========================================================================
   Makieta Inwestycji - style frontu
   ========================================================================== */

.makieta-inw {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	font-family: inherit;

	/* Zmienne kolorow - mozna nadpisac w motywie/Elementorze, aby dopasowac
	   makiete do kolorystyki strony. Domyslnie neutralne. */
	--mi-primary: #1a7a46;
	--mi-primary-hover: #14633a;
	--mi-primary-text: #fff;
	--mi-text: #2a2a2a;
	--mi-muted: #8a8a8a;
	--mi-line: #ececec;
	--mi-radius: 8px;
}
/* Modale i lightboxy renderowane sa w body (poza .makieta-inw), wiec
   powielamy domyslne zmienne globalnie - i tak nadpisywalne przez motyw. */
.makieta-inw-modal,
.makieta-inw-formbox {
	--mi-primary: #1a7a46;
	--mi-primary-hover: #14633a;
	--mi-primary-text: #fff;
	--mi-text: #2a2a2a;
	--mi-muted: #8a8a8a;
	--mi-line: #ececec;
	--mi-radius: 8px;
}

/* Kontener obrazka + overlay SVG. position:relative jest kluczowe -
   SVG jest pozycjonowany absolutnie wzgledem tego elementu. */
.makieta-inw__stage {
	position: relative;
	display: block;
	width: 100%;
	line-height: 0;
}

.makieta-inw__img {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
}

/* Overlay SVG dokladnie pokrywa obrazek. preserveAspectRatio="none"
   w SVG sprawia, ze viewBox mapuje sie liniowo na te ramke. */
.makieta-inw__svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* ---- Przelacznik widokow (rotacja) ---- */

.makieta-inw__views {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.makieta-inw__view-btn {
	padding: 7px 14px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	color: #333;
}
.makieta-inw__view-btn:hover {
	background: #f3f3f3;
}
.makieta-inw__view-btn.is-active {
	background: var(--mi-primary);
	color: #fff;
	border-color: var(--mi-primary);
}

/* ---- Poligony i statusy ---- */

.makieta-inw__poly {
	stroke: rgba(255, 255, 255, 0.9);
	stroke-width: 1.5;
	cursor: pointer;
	/* A1: mocniejsze podbarwienie - status ma byc widoczny takze na tle zieleni renderu. */
	fill-opacity: 0.5;
	transition: fill-opacity 0.15s ease, stroke-width 0.15s ease, filter 0.15s ease;
	vector-effect: non-scaling-stroke;
}

/* 0.5.0: klient prosil o wyraznie mocniejsza roznice po najechaniu. */
.makieta-inw__poly:hover,
.makieta-inw__poly.is-hover {
	fill-opacity: 0.92;
	stroke: #fff;
	stroke-width: 3.5;
	filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
}

/* Lokal sprzedany - nieklikalny, kursor domyslny. */
.makieta-inw__poly.is-sprzedane {
	cursor: default;
	pointer-events: none;
}

/* Podswietlenie z tabeli/filtrow (faza 4). */
.makieta-inw__poly.is-highlight {
	fill-opacity: 0.8;
	stroke-width: 3;
}

/* Wyszarzenie niepasujacych do filtra. */
.makieta-inw__poly.is-dimmed {
	fill-opacity: 0.08;
}

/* A1: marker-kolko statusu w centroidzie poligonu - pelny kolor, biala obwodka,
   zawsze na wierzchu (rysowany po poligonach). Dziedziczy fill z klas status-*. */
.makieta-inw__marker {
	fill-opacity: 1;
	stroke: #fff;
	stroke-width: 2.5;
	vector-effect: non-scaling-stroke;
	cursor: pointer;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
	transition: stroke-width 0.15s ease;
}
.makieta-inw__marker:hover,
.makieta-inw__marker.is-hover {
	stroke-width: 4.5;
	filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
}
.makieta-inw__marker.is-sprzedane {
	cursor: default;
	pointer-events: none;
}
/* 0.5.0: dymek "Wybierz lokal" podazajacy za kursorem nad poligonem.
   Tylko urzadzenia z realnym hoverem (na dotyku nie ma sensu). */
.makieta-inw__cursor-tip {
	position: absolute;
	z-index: 5;
	pointer-events: none;
	background: rgba(20, 30, 25, 0.92);
	color: #fff;
	font-size: 13px;
	line-height: 1.2;
	font-weight: 600;
	padding: 6px 10px;
	border-radius: 6px;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.1s ease;
}
.makieta-inw__cursor-tip.is-visible {
	opacity: 1;
}
@media (hover: none) {
	.makieta-inw__cursor-tip {
		display: none;
	}
}

/* Filtry: marker niepasujacego lokalu przygasa razem z poligonem,
   ale nigdy nie znika calkiem - status ma byc czytelny zawsze. */
.makieta-inw__marker.is-dimmed {
	opacity: 0.3;
}
.makieta-inw__marker.is-highlight {
	stroke-width: 3.5;
}

/* Kolory statusow - definiowalne/nadpisywalne w motywie. */
.makieta-inw .status-dostepne {
	fill: #2e9e5b;
}
.makieta-inw .status-rezerwacja {
	fill: #e0a800;
}
.makieta-inw .status-sprzedane {
	fill: #c0392b;
}
.makieta-inw .status-wkrotce {
	fill: #2980b9;
}

/* ---- Loader ---- */

.makieta-inw__loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 200px;
	padding: 24px;
	color: #555;
	font-size: 15px;
}

.makieta-inw__spinner {
	width: 22px;
	height: 22px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	animation: makieta-spin 0.8s linear infinite;
}

@keyframes makieta-spin {
	to {
		transform: rotate(360deg);
	}
}

.makieta-inw__error {
	padding: 20px;
	background: #fdecea;
	color: #842029;
	border: 1px solid #f5c2c7;
	border-radius: 6px;
	font-size: 14px;
}

/* ---- Legenda statusow ---- */

.makieta-inw__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 12px 0;
	font-size: 13px;
}

.makieta-inw__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.makieta-inw__legend-dot {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	display: inline-block;
}
.makieta-inw__legend-dot.status-dostepne {
	background: #2e9e5b;
}
.makieta-inw__legend-dot.status-rezerwacja {
	background: #e0a800;
}
.makieta-inw__legend-dot.status-sprzedane {
	background: #c0392b;
}
.makieta-inw__legend-dot.status-wkrotce {
	background: #2980b9;
}

/* A6: czytelna klikalnosc wierszy tabeli. */
.makieta-inw__table tbody tr {
	cursor: pointer;
}
.makieta-inw__table tbody tr:hover {
	background: rgba(0, 0, 0, 0.06);
	box-shadow: inset 3px 0 0 var(--mi-primary);
}
.makieta-inw__row-pointer {
	display: inline-block;
	margin-right: 2px;
	font-size: 0.95em;
	line-height: 1;
}
.makieta-inw__cell-akcje {
	white-space: nowrap;
	text-align: right;
}
.makieta-inw__cell-akcje .makieta-inw-btn + .makieta-inw-btn {
	margin-left: 6px;
}

/* A7: pomniejszony wariant przycisku do uzycia w wierszu tabeli. */
.makieta-inw-btn--sm {
	padding: 4px 10px;
	font-size: 0.85em;
	line-height: 1.3;
}

/* A9: oramkowana sekcja "Pliki do pobrania" miedzy makieta a tabela. */
.makieta-inw__pliki {
	margin: 24px 0;
	padding: 16px 20px;
	border: 2px solid var(--mi-primary);
	border-radius: var(--mi-radius);
	background: rgba(0, 0, 0, 0.02);
}
.makieta-inw__pliki-title {
	margin: 0 0 10px;
	font-size: 1.05em;
	color: var(--mi-text);
}
.makieta-inw__pliki-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}
.makieta-inw__pliki-list a {
	color: var(--mi-primary);
	font-weight: 600;
	text-decoration: underline;
}
.makieta-inw__pliki-list a::before {
	content: "\2B07\FE0F ";
}
.makieta-inw__pliki-list a:hover {
	color: var(--mi-primary-hover);
}

/* ==========================================================================
   Modal lokalu
   ========================================================================== */

.makieta-inw-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.makieta-inw-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.makieta-inw-modal__box {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	transform: translateY(12px);
	transition: transform 0.2s ease;
	padding: 24px;
}

.makieta-inw-modal.is-open .makieta-inw-modal__box {
	transform: translateY(0);
}

/* Modal z osadzonym podgladem karty PDF - szersze okno. */
.makieta-inw-modal__box.has-pdf {
	max-width: 860px;
}

/* Osadzony podglad karty lokalu (PDF) + przycisk pelnego ekranu. */
.makieta-inw-modal__pdf-wrap {
	position: relative;
	margin-top: 14px;
}

.makieta-inw-modal__pdf {
	display: block;
	width: 100%;
	height: 62vh;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #f6f6f6;
}

.makieta-inw-modal__expand {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 7px 14px;
	border: none;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}
.makieta-inw-modal__expand:hover {
	background: rgba(0, 0, 0, 0.9);
}

@media ( max-width: 600px ) {
	.makieta-inw-modal__pdf {
		height: 48vh;
	}
}

/* Blokada przewijania tla, gdy otwarty lightbox/formularz. */
body.makieta-inw-noscroll {
	overflow: hidden;
}

/* ---- Lightbox PDF (pelny ekran) ---- */
.makieta-inw-pdfbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.85);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.makieta-inw-pdfbox.is-open {
	opacity: 1;
	visibility: visible;
}
.makieta-inw-pdfbox__inner {
	position: relative;
	width: 100%;
	max-width: 1100px;
	height: 100%;
}
.makieta-inw-pdfbox__frame {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 6px;
	background: #fff;
}
.makieta-inw-pdfbox__close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #222;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.makieta-inw-pdfbox__close:hover {
	background: #f0f0f0;
}

/* ---- Formularz zapytania (nakladka) ---- */
.makieta-inw-formbox {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.makieta-inw-formbox.is-open {
	opacity: 1;
	visibility: visible;
}
.makieta-inw-formbox__box {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 92vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	padding: 28px 24px 24px;
}
.makieta-inw-formbox__close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: none;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: #888;
	cursor: pointer;
}
.makieta-inw-formbox__close:hover {
	color: #222;
}
.makieta-inw-formbox__title {
	margin: 0 0 4px;
	font-size: 22px;
	color: var(--mi-text);
}
.makieta-inw-formbox__sub {
	margin: 0 0 16px;
	font-size: 14px;
	color: #666;
}
.makieta-inw-form__field {
	display: block;
	margin-bottom: 12px;
}
.makieta-inw-form__label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}
.makieta-inw-form__field input,
.makieta-inw-form__field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
}
.makieta-inw-form__field textarea {
	resize: vertical;
}
/* Honeypot - ukryty wizualnie, ale dostepny dla botow. */
.makieta-inw-form__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.makieta-inw-form__consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 6px 0 14px;
	font-size: 12.5px;
	line-height: 1.4;
	color: #555;
}
.makieta-inw-form__consent input {
	margin-top: 2px;
	flex: 0 0 auto;
}
.makieta-inw-form__submit {
	width: 100%;
}
.makieta-inw-form__msg {
	margin: 0 0 12px;
	font-size: 14px;
}
.makieta-inw-form__msg.is-error {
	color: #c0392b;
}
.makieta-inw-form__msg.is-success {
	color: #2e7d32;
	font-weight: 600;
	margin: 8px 0 0;
}

.makieta-inw-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px;
	height: 34px;
	border: none;
	background: #f0f0f0;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: #333;
}
.makieta-inw-modal__close:hover {
	background: #e0e0e0;
}

.makieta-inw-modal__title {
	margin: 0 34px 12px 0;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--mi-text);
}

.makieta-inw-modal__badge {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	margin-bottom: 18px;
}
.makieta-inw-modal__badge.status-dostepne {
	background: #2e9e5b;
}
.makieta-inw-modal__badge.status-rezerwacja {
	background: #e0a800;
}
.makieta-inw-modal__badge.status-sprzedane {
	background: #c0392b;
}
.makieta-inw-modal__badge.status-wkrotce {
	background: #2980b9;
}

/* Tabela parametrow - nowoczesny uklad "label / wartosc" z wyroznieniem ceny. */
.makieta-inw-modal__rows {
	width: 100%;
	border-collapse: collapse;
	margin: 4px 0 20px;
}
.makieta-inw-modal__rows tr {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--mi-line);
}
.makieta-inw-modal__rows tr:last-child {
	border-bottom: none;
}
.makieta-inw-modal__rows th {
	text-align: left;
	color: var(--mi-muted);
	font-weight: 600;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
}
.makieta-inw-modal__rows td {
	text-align: right;
	font-weight: 700;
	font-size: 16px;
	color: var(--mi-text);
}
/* Ostatni wiersz = cena: wyrozniona kolorem i rozmiarem. */
.makieta-inw-modal__rows tr:last-child td {
	font-size: 22px;
	color: var(--mi-primary);
}

.makieta-inw-modal__desc {
	font-size: 14px;
	color: #555;
	margin: 0 0 18px;
	line-height: 1.5;
}

/* Akcje (CTA) - wyrazne, na gorze modala. */
.makieta-inw-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.makieta-inw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 22px;
	border-radius: var(--mi-radius);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	text-align: center;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
/* W modalu przyciski rosna na cala szerokosc (po rowno). */
.makieta-inw-modal__actions .makieta-inw-btn {
	flex: 1 1 auto;
	min-width: 160px;
}
.makieta-inw-btn--primary {
	background: var(--mi-primary);
	color: var(--mi-primary-text);
	border-color: var(--mi-primary);
}
.makieta-inw-btn--primary:hover {
	background: var(--mi-primary-hover);
	border-color: var(--mi-primary-hover);
	color: var(--mi-primary-text);
}
/* Drugorzedny - obrys w kolorze glownym, wypelnienie na hover. */
.makieta-inw-btn--secondary {
	background: transparent;
	color: var(--mi-primary);
	border-color: var(--mi-primary);
}
.makieta-inw-btn--secondary:hover {
	background: var(--mi-primary);
	color: var(--mi-primary-text);
}
/* Ghost - uzywany m.in. przy filtrach tabeli. */
.makieta-inw-btn--ghost {
	background: #f0f0f0;
	color: #1a1a1a;
}
.makieta-inw-btn--ghost:hover {
	background: #e2e2e2;
}

/* ==========================================================================
   Tabela lokali (faza 4 - bazowe style juz tu sa)
   ========================================================================== */

.makieta-inw__table-wrap {
	margin-top: 24px;
	overflow-x: auto;
}

.makieta-inw__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: 14px;
}

.makieta-inw__filter label {
	display: block;
	font-size: 12px;
	color: #666;
	margin-bottom: 3px;
}

.makieta-inw__filter input,
.makieta-inw__filter select {
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}

.makieta-inw__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.makieta-inw__table th,
.makieta-inw__table td {
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
	text-align: left;
}
.makieta-inw__table th {
	background: #f7f7f7;
	font-weight: 600;
	cursor: pointer;
}
.makieta-inw__table tbody tr {
	cursor: pointer;
}
.makieta-inw__table tr.is-row-hidden {
	display: none;
}
.makieta-inw__table tbody tr:hover td,
.makieta-inw__table tbody tr.is-row-hover td {
	background: #eef6fb;
}

/* Tryb 3D (integracja z M16 Makieta 3D): viewer 360 w miejscu sceny 2D. */
.makieta-inw__makieta3d {
	margin-bottom: 16px;
}

.makieta-inw__status-pill {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
}
.makieta-inw__status-pill.status-dostepne {
	background: #2e9e5b;
}
.makieta-inw__status-pill.status-rezerwacja {
	background: #e0a800;
}
.makieta-inw__status-pill.status-sprzedane {
	background: #c0392b;
}
.makieta-inw__status-pill.status-wkrotce {
	background: #2980b9;
}

/* Placeholder bloku/renderu bez wybranej inwestycji. */
.makieta-inw-placeholder {
	padding: 20px;
	border: 1px dashed #bbb;
	border-radius: 6px;
	color: #777;
	text-align: center;
	font-size: 14px;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
	.makieta-inw-modal__box {
		max-width: 100%;
	}
	.makieta-inw__filters {
		flex-direction: column;
		align-items: stretch;
	}
	.makieta-inw__filter input,
	.makieta-inw__filter select {
		width: 100%;
	}
	.makieta-inw__legend {
		font-size: 12px;
		gap: 10px;
	}
	.makieta-inw-modal__actions {
		flex-direction: column;
	}
}
