/* ============================================================
   Topic Woningen v3
   ============================================================ */
.tw-woningen { --tw-accent: #4a9c2d; --tw-grijs: #6b6b6b; margin: 0 auto; }

/* --- Toggle --- */
.tw-toggle { display: flex; gap: 8px; margin-bottom: 18px; padding: 0 58px; box-sizing: border-box; }
.tw-toggle-knop {
	border: 0; cursor: pointer; padding: 12px 22px; font-size: 15px; font-weight: 600;
	background: #7a7a7a; color: #fff; border-radius: 3px; transition: background .15s;
}
.tw-toggle-knop:hover { background: #666; }
.tw-toggle-knop.is-active { background: var(--tw-accent); }

/* --- Paneel (per fase) --- */
.tw-paneel { display: none; }
.tw-paneel.is-active { display: block; }

/* --- Kaart + flip-pijltjes --- */
.tw-kaart { position: relative; margin-bottom: 26px; padding: 0 58px; }
.tw-kaart-imp { width: 100%; }
.tw-flip {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
	width: 46px; height: 46px; padding: 0; border: 0; border-radius: 7px; cursor: pointer;
	background: #6a6a6a; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 1px 5px rgba(0,0,0,.25); transition: opacity .25s ease, background .15s, transform .15s;
}
.tw-flip img { width: 24px; height: 24px; max-width: none; display: block; }
.tw-flip:hover { background: #4a4a4a; transform: translateY(-50%) scale(1.06); }
.tw-flip-links { left: 4px; }
.tw-flip-rechts { right: 4px; }

/* Mobiele open-/sluitknop: alleen op mobiel zichtbaar (zie media query). */
.tw-kaart-open, .tw-kaart-sluit { display: none; }

/* Laad-placeholder (skeleton) */
.tw-skeleton {
	width: 100%; border-radius: 4px; background: #ececec;
	background-image: linear-gradient(90deg, #e9e9e9 0, #f6f6f6 60px, #e9e9e9 120px);
	background-size: 300px 100%; background-repeat: no-repeat;
	animation: tw-shimmer 1.3s infinite linear;
}
@keyframes tw-shimmer { 0% { background-position: -150px 0; } 100% { background-position: calc(100% + 150px) 0; } }

/* Tijdens laden: skeleton tonen, kaart + pijlen verbergen. Daarna omgekeerd. */
.tw-kaart.is-laden .tw-imp-holder { visibility: hidden; height: 0; overflow: hidden; }
.tw-kaart.is-laden .tw-flip { opacity: 0; pointer-events: none; }
.tw-kaart:not(.is-laden) .tw-skeleton { display: none; }

/* --- Lijst (rijen) --- */
.tw-lijst { display: flex; flex-direction: column; gap: 14px; padding: 0 58px; box-sizing: border-box; }
.tw-kaart-rij {
	display: flex; align-items: flex-start; gap: 18px; border: 1px solid #e3e3e3;
	border-radius: 4px; overflow: hidden; background: #fff;
}
.tw-kaart-afb { position: relative; flex: 0 0 200px; max-width: 200px; aspect-ratio: var(--tw-afb-ratio, 3 / 2); overflow: hidden; }
.tw-kaart-afb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-balk-verkocht {
	position: absolute; top: 14px; left: -32px; transform: rotate(-45deg);
	background: #b03030; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px;
	padding: 4px 40px;
}
.tw-kaart-specs { flex: 1; padding: 16px 8px; }
.tw-kaart-specs h3 { margin: 0 0 8px; font-size: 22px; }
.tw-kaart-specs ul { list-style: none; margin: 0; padding: 0; }
.tw-kaart-specs li { font-size: 13px; color: var(--tw-grijs); line-height: 1.6; }
.tw-kaart-specs li.tw-prijs { font-weight: 700; color: #222; margin-top: 4px; }
.tw-kaart-actie { display: flex; align-items: center; align-self: center; padding: 16px 20px; }
.tw-meer-info {
	border: 1px solid #cfcfcf; background: #fff; cursor: pointer; padding: 17px 34px;
	border-radius: 3px; font-size: 15px; white-space: nowrap; transition: border-color .15s;
}
.tw-meer-info:hover { border-color: var(--tw-accent); color: var(--tw-accent); }
.tw-leeg { color: var(--tw-grijs); font-style: italic; }

/* --- Popup --- */
body.tw-popup-open { overflow: hidden; }
.tw-popup-overlay {
	position: fixed; inset: 0; z-index: 99999; background: rgba(25,28,31,.5);
	display: flex; align-items: center; justify-content: center; padding: 50px; box-sizing: border-box;
}
.tw-popup-overlay[hidden] { display: none; }
.tw-popup {
	position: relative; background: #fff; border-radius: 5px; width: 100%; max-width: 90vw;
	max-height: 95vh; overflow-y: auto; padding: 30px; padding-bottom: 72px;
	box-shadow: 0 5px 20px rgba(0,0,0,.4);
}
.tw-popup-sluiten {
	position: absolute; top: 12px; right: 12px; z-index: 10; width: 38px; height: 38px;
	border: 0; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 26px;
	line-height: 36px; text-align: center; cursor: pointer; color: #555;
	box-shadow: 0 1px 4px rgba(0,0,0,.2); padding: 0;
}
.tw-popup-sluiten:hover { color: #111; background: #fff; }
.tw-laden { padding: 60px; text-align: center; color: var(--tw-grijs); }

.tw-popup-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: start; }
.tw-slideshow.splide { aspect-ratio: var(--tw-afb-ratio, 3 / 2); max-height: 70vh; border-radius: 4px; overflow: hidden; }
.tw-slideshow .splide__track, .tw-slideshow .splide__list { height: 100%; }
.tw-slideshow .splide__slide, .tw-slideshow .splide__slide a { height: 100%; display: block; }
.tw-slideshow .splide__slide img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }

.tw-popup-info h2 { margin: 0 0 4px; font-size: 28px; }
.tw-status { margin: 0 0 6px; font-weight: 600; text-transform: lowercase; }
.tw-status.status-te-koop { color: var(--tw-te-koop, #4a9c2d); }
.tw-status.status-onder-optie { color: var(--tw-onder-optie, #e0a500); }
.tw-status.status-verkocht { color: var(--tw-verkocht, #b03030); }
.tw-popup-prijs { font-size: 18px; font-weight: 700; margin: 0 0 16px; }

/* Tabs */
.tw-tab-nav { display: flex; gap: 4px; border-bottom: 2px solid #ececec; margin-bottom: 14px; }
.tw-tab-knop {
	border: 0; background: none; cursor: pointer; padding: 8px 14px; font-size: 14px; color: var(--tw-grijs);
	border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tw-tab-knop.is-active { color: #222; border-bottom-color: var(--tw-accent); font-weight: 600; }
.tw-tab-paneel { display: none; }
.tw-tab-paneel.is-active { display: block; }

.tw-specs { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.tw-specs th, .tw-specs td { text-align: left; padding: 0 10px; border: 1px solid #dcdcdc; vertical-align: top; }
.tw-specs th { color: #333; font-weight: 400; width: 45%; }
.tw-omschrijving { font-size: 14px; line-height: 1.6; }

.tw-grid-afb { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 10px; }
.tw-grid-afb img { width: 100%; height: 120px; object-fit: cover; border-radius: 3px; display: block; }

.tw-contact-knop {
	position: absolute; bottom: 16px; right: 20px; background: var(--tw-accent); color: #fff;
	text-decoration: none; padding: 11px 22px; border-radius: 4px; font-weight: 600; font-size: 14px;
}
.tw-contact-knop:hover { filter: brightness(.92); }

/* --- Responsive --- */
@media (max-width: 860px) {
	.tw-popup-overlay { padding: 16px; }
	.tw-popup-grid { grid-template-columns: 1fr; gap: 18px; }
	.tw-popup { padding: 22px; padding-bottom: 70px; max-width: 96vw; }
	.tw-slideshow.splide { max-height: 50vh; }
}
@media (max-width: 640px) {
	.tw-kaart-rij { flex-direction: column; align-items: stretch; }
	.tw-kaart-afb { flex-basis: auto; max-width: none; align-self: stretch; }
	.tw-kaart-actie { align-self: auto; padding: 0 16px 16px; }
	.tw-meer-info { width: 100%; }
}

/* --- Mobiel: kaart niet inline (scroll-trap), maar via knop fullscreen openen --- */
@media (max-width: 782px) {
	.tw-kaart { display: none; }
	.tw-toggle, .tw-lijst { padding: 0 16px; }
	.tw-kaart-open {
		display: flex; align-items: center; justify-content: center; gap: 8px;
		width: auto; box-sizing: border-box; margin: 0 16px 18px;
		padding: 15px 18px; border: 0; border-radius: 4px; cursor: pointer;
		background: var(--tw-accent); color: #fff; font-size: 15px; font-weight: 600;
	}
	.tw-kaart-open:hover { filter: brightness(.95); }

	.tw-kaart.is-open {
		display: flex; align-items: center; justify-content: center;
		position: fixed; inset: 0; z-index: 99990; margin: 0; padding: 0; background: #fff;
	}
	.tw-kaart.is-open .tw-kaart-imp {
		width: min(100vw, calc(100svh * var(--tw-ratio, 1.7778)));
		max-width: 100vw; max-height: 100svh;
		aspect-ratio: var(--tw-ratio, 1.7778); overflow: hidden;
	}
	.tw-kaart.is-open .tw-imp-holder { width: 100%; height: 100%; }
	.tw-kaart.is-open .tw-flip-links { left: 10px; }
	.tw-kaart.is-open .tw-flip-rechts { right: 10px; }

	.tw-kaart-sluit {
		display: flex; align-items: center; justify-content: center;
		position: fixed; top: 12px; right: 12px; z-index: 99991;
		width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
		background: rgba(20,20,20,.6); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
	}
	body.tw-kaart-fs { overflow: hidden; }

	/* IMP's eigen artboard-dropdown verbergen op mobiel; onze pijlen sturen 'm aan. */
	.tw-kaart .imp-ui-layers-select { display: none !important; }
}

/* --- Lightbox boven de popup (popup-overlay = 99999) --- */
.fancybox__container { z-index: 2147483000 !important; }
