/* Floor plan + apartment cards page. */

body.floor-plan-page {
	margin: 0;
	background-color: var(--kh-cream);
	color: var(--kh-navy-900);
	font-weight: 300;
	-webkit-font-smoothing: antialiased;
}

/* Page title/back-link now come from the shared page-hero band
   (assets/css/page-hero.css) instead of a fixed topbar+header here. */
.kh-floor {
	max-width: 1200px;
	margin: 0 auto;
	padding: 56px 24px 100px;
}

.kh-floor__facade-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 20px;
	padding: 10px 18px;
	background: rgba(10, 30, 61, 0.06);
	border: 1px solid rgba(10, 30, 61, 0.15);
	border-radius: 999px;
	font-size: 13px;
	color: var(--kh-navy-900);
}

.kh-floor__facade-filter a {
	color: var(--kh-navy-900);
	text-decoration: underline;
	white-space: nowrap;
}

.kh-floor__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 36px;
}

.kh-floor__filter {
	font-size: 13px;
	letter-spacing: 0.03em;
	color: var(--kh-navy-900);
	background: none;
	border: 1px solid rgba(10, 30, 61, 0.25);
	border-radius: 999px;
	padding: 9px 20px;
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.kh-floor__filter:hover {
	border-color: var(--kh-navy-900);
}

.kh-floor__filter.is-active {
	background-color: var(--kh-navy-900);
	border-color: var(--kh-navy-900);
	color: #fff;
}

/* Card grid */
.kh-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 24px;
}

.kh-card {
	position: relative;
	display: flex;
	gap: 18px;
	background: linear-gradient(165deg, #ffffff 0%, #f7f9fc 100%);
	border: 1px solid rgba(10, 30, 61, 0.1);
	border-radius: 10px;
	padding: 19px 18px 18px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.kh-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--kh-navy-900) 0%, var(--kh-navy-700) 45%, var(--kh-gold) 100%);
	opacity: 0.85;
}

.kh-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 20px 36px -16px rgba(10, 30, 61, 0.28);
	border-color: rgba(212, 168, 86, 0.45);
}

.kh-card__status {
	position: absolute;
	top: 14px;
	right: 14px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 5px 10px;
	border-radius: 999px;
	color: #fff;
}

.kh-card__status--dostupan {
	background-color: #2e9e5b;
}

.kh-card__status--rezervisan {
	background-color: var(--kh-gold-deep);
}

.kh-card__status--prodat {
	background-color: rgba(200, 60, 50, 0.75);
}

.kh-card__plan {
	position: relative;
	flex: 0 0 128px;
	width: 128px;
	height: 128px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--kh-navy-950);
	border: 1px solid rgba(10, 30, 61, 0.1);
}

.kh-card__plan::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(200deg, transparent 55%, rgba(10, 30, 61, 0.35) 100%);
	pointer-events: none;
}

.kh-card__plan img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.kh-card:hover .kh-card__plan img {
	transform: scale(1.06);
}

.kh-card__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.kh-card__number {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(10, 30, 61, 0.5);
}

.kh-card__type {
	font-size: 18px;
	font-weight: 500;
	margin: 4px 0 10px;
}

.kh-card__meta {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kh-card__meta li {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: rgba(10, 30, 61, 0.65);
}

.kh-card__meta svg {
	flex-shrink: 0;
	color: var(--kh-gold-deep);
}

.kh-card__footer {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.kh-card__price {
	font-size: 16px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.kh-card__cta {
	font-size: 12px;
	letter-spacing: 0.04em;
	color: #fff;
	background: linear-gradient(135deg, var(--kh-navy-800) 0%, var(--kh-navy-950) 100%);
	border-radius: 999px;
	padding: 9px 18px;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s ease, box-shadow 0.25s ease;
}

.kh-card__cta:hover,
.kh-card__cta:focus-visible {
	background: linear-gradient(135deg, var(--kh-gold-deep) 0%, var(--kh-gold) 100%);
	box-shadow: 0 6px 16px -6px rgba(212, 168, 86, 0.6);
}

@media (max-width: 480px) {
	.kh-card {
		flex-direction: column;
	}

	.kh-card__plan {
		width: 100%;
	}
}

/* Floor-plan preview, above the cards — opens the lightbox instead of
   dominating the top of the page with the full plan image. */
.kh-floor__plan-trigger {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	max-width: 400px;
	margin: 0 auto 36px;
	padding: 14px;
	background: #fff;
	border: 1px solid rgba(10, 30, 61, 0.12);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.kh-floor__plan-trigger:hover,
.kh-floor__plan-trigger:focus-visible {
	border-color: rgba(212, 168, 86, 0.5);
	box-shadow: 0 10px 24px -14px rgba(10, 30, 61, 0.3);
}

.kh-floor__plan-trigger-thumb {
	flex: 0 0 76px;
	width: 76px;
	height: 76px;
	border-radius: 5px;
	overflow: hidden;
	background: var(--kh-cream);
}

.kh-floor__plan-trigger-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kh-floor__plan-trigger-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 1;
	font-size: 14px;
	letter-spacing: 0.02em;
	color: var(--kh-navy-900);
	text-align: left;
}

.kh-floor__plan-trigger-label svg {
	flex-shrink: 0;
	color: var(--kh-gold-deep);
	margin-left: 10px;
}

.kh-lightbox {
	position: fixed;
	inset: 0;
	/* Above the site-nav (40) and sticky action bar (30) — both are
	   position:fixed and were sitting on top of the open lightbox,
	   visually slicing off part of the plan image underneath them. */
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Extra top padding — the site-nav bar's real height is 148px (its
	   blurred gradient reads further still), so the plan image needs more
	   headroom than a plain symmetric 40px or its top edge sits under the
	   nav's blur. */
	padding: 168px 40px 40px;
	overflow-y: auto;
	background: rgba(4, 16, 42, 0.92);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	box-sizing: border-box;
}

.kh-lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}

.kh-lightbox__image {
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

/* Overlay box — sized to exactly match the rendered plan image (same
   min(vw, vh*ratio) technique as .kh-plan__frame on the VR tour hub) so
   percent-based clip-path polygons line up with the real artwork. */
.kh-plan-overlay {
	position: relative;
	width: min(90vw, calc((100vh - 208px) * var(--kh-plan-ratio, 1.4)));
	height: min(calc(100vh - 208px), calc(90vw / var(--kh-plan-ratio, 1.4)));
}

.kh-plan-overlay__image {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 4px;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
	user-select: none;
	-webkit-user-drag: none;
}

.kh-plan-overlay__unit {
	position: absolute;
	inset: 0;
	cursor: pointer;
	background-color: rgba(212, 168, 86, 0);
	transition: background-color 0.3s ease;
}

.kh-plan-overlay__unit:hover,
.kh-plan-overlay__unit:focus-visible {
	background-color: rgba(212, 168, 86, 0.4);
}

/* No unit left under this polygon once the facade filter is applied —
   grayed out and inert rather than removed, so the plan's shape stays
   recognisable. */
.kh-plan-overlay__unit--dimmed {
	background-color: rgba(10, 30, 61, 0.55);
	cursor: default;
	pointer-events: none;
}

.kh-plan-overlay__unit--dimmed:hover {
	background-color: rgba(10, 30, 61, 0.55);
}

.kh-plan-overlay__unit-label {
	position: absolute;
	transform: translate(-50%, -50%);
	white-space: nowrap;
	font-size: 14px;
	letter-spacing: 0.03em;
	color: #0a0a0a;
	background: rgba(255, 255, 255, 0.95);
	padding: 5px 14px;
	border-radius: 3px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.kh-plan-overlay__unit:hover .kh-plan-overlay__unit-label,
.kh-plan-overlay__unit:focus-visible .kh-plan-overlay__unit-label {
	opacity: 1;
}

.kh-plan-overlay__edit-btn {
	position: absolute;
	right: 4%;
	bottom: 4%;
	z-index: 3;
	color: #fff;
	font-size: 12px;
	letter-spacing: 0.04em;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	padding: 8px 16px;
	background: rgba(10, 10, 10, 0.5);
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease;
}

.kh-plan-overlay__edit-btn:hover,
.kh-plan-overlay__edit-btn:focus-visible {
	border-color: #fff;
	background-color: rgba(255, 255, 255, 0.1);
}

.kh-plan-overlay.is-editing .kh-plan-overlay__unit {
	pointer-events: none;
}

.kh-plan-overlay.is-editing {
	cursor: crosshair;
}

/* Trace tool — same visual language as the VR tour's room-plan editor
   (assets/css/virtual-tour.css .kh-planedit) so the two tools feel like
   one consistent feature, not two different ad-hoc UIs. */
.kh-planedit {
	position: absolute;
	left: 50%;
	bottom: 4%;
	transform: translateX(-50%);
	z-index: 4;
	width: min(560px, 92vw);
	background: rgba(10, 10, 10, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	padding: 16px 18px;
	backdrop-filter: blur(6px);
}

.kh-planedit__title {
	font-size: 13px;
	letter-spacing: 0.02em;
	color: #fff;
	margin-bottom: 4px;
}

.kh-planedit__title strong {
	font-weight: 500;
}

.kh-planedit__hint {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 12px;
}

.kh-planedit__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kh-planedit__btn {
	color: #fff;
	font-size: 11px;
	letter-spacing: 0.03em;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	padding: 7px 14px;
	background: none;
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease;
}

.kh-planedit__btn:hover,
.kh-planedit__btn:focus-visible {
	border-color: #fff;
	background-color: rgba(255, 255, 255, 0.1);
}

.kh-planedit__btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.kh-planedit__btn--exit {
	margin-left: auto;
	color: rgba(255, 255, 255, 0.5);
	border-color: rgba(255, 255, 255, 0.2);
}

.kh-planedit__output {
	width: 100%;
	box-sizing: border-box;
	background: #050505;
	color: #9fe0a0;
	font-family: 'SF Mono', Menlo, Consolas, monospace;
	font-size: 11px;
	line-height: 1.5;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	padding: 10px;
	margin-bottom: 12px;
	resize: vertical;
}

.kh-planedit__markers {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
}

.kh-planedit__dot {
	position: absolute;
	width: 22px;
	height: 22px;
	margin-left: -11px;
	margin-top: -11px;
	border-radius: 50%;
	background: #d4a856;
	color: #0a0a0a;
	font-size: 11px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.kh-planedit__preview {
	position: absolute;
	inset: 0;
	background-color: rgba(212, 168, 86, 0.42);
}

.kh-planedit__done {
	position: absolute;
	inset: 0;
	background-color: rgba(120, 220, 140, 0.32);
}

.kh-lightbox__close {
	position: absolute;
	top: 24px;
	right: 28px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.25s ease, background-color 0.25s ease;
}

.kh-lightbox__close:hover {
	border-color: #fff;
	background-color: rgba(255, 255, 255, 0.1);
}

/* "Prošetaj hodnikom" — the corridor tour for this floor
   (page-hallway-tour.php). Sits between the plan trigger and the unit
   cards: you've seen the layout, now walk it. */
.kh-floor__walk {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: fit-content;
	margin: 0 auto 28px;
	padding: 13px 26px;
	border-radius: 999px;
	color: #fff;
	background: linear-gradient(135deg, var(--kh-navy-800) 0%, var(--kh-navy-950) 100%);
	text-decoration: none;
	font-size: 14px;
	letter-spacing: 0.03em;
	box-shadow: 0 10px 24px -12px rgba(10, 30, 61, 0.45);
	transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.kh-floor__walk svg {
	stroke: currentColor;
	flex: 0 0 auto;
}

.kh-floor__walk span {
	transition: transform 0.3s ease;
}

.kh-floor__walk:hover,
.kh-floor__walk:focus-visible {
	background: linear-gradient(135deg, var(--kh-gold-deep) 0%, var(--kh-gold) 100%);
	box-shadow: 0 12px 28px -12px rgba(212, 168, 86, 0.55);
	transform: translateY(-2px);
}

.kh-floor__walk:hover span {
	transform: translateX(3px);
}
