/* ============================================================
   PROJECT CONFIG — change these values per project
   ============================================================ */
:root {
  /* Brand */
  --accent-color: #e74c3c;
  --accent-hover: #c0392b;
  --success-color: #27ae60;
  --warning-color: #f39c12;

  /* Typography */
  --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Lightbox */
  --lightbox-bg: #36482E; 
  --lightbox-img-radius: 0px;              
  --lightbox-icon-color: rgba(255,255,255,0.45); /* close icon */
  --lightbox-icon-hover: #ffffff;
  --lightbox-counter-bg: rgba(255,255,255,0.10);
  --lightbox-counter-color: rgba(255,255,255,0.70);
}
/* ============================================================ */

/* CSS Variables */
:root {
  --primary-color: #1a1a1a;
  --text-color: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --border-color: #e5e5e5;
  --bg-color: #ffffff;
  --bg-light: #fafafa;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --transition: all 0.2s ease;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Main Container */
.woningzoeker-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  /* Container queries: layout responds to embed width, not viewport */
  container-type: inline-size;
  container-name: wz;
}

/* =====================================================
   FILTER BAR - Top filter section
   ===================================================== */
.filter-bar {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
}

.filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
}

.filter-toggle:hover {
  border-color: var(--text-color);
}

.filter-toggle svg {
  opacity: 0.7;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-group {
  display: flex;
  align-items: center;
}

.filter-slider-group {
  min-width: 160px;
}

.slider-container {
  width: 100%;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

#prijsSlider,
#m2Slider {
  height: 4px;
}

/* =====================================================
   CUSTOM DROPDOWN
   ===================================================== */
.custom-dropdown {
  position: relative;
  min-width: 160px;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.dropdown-trigger:hover {
  border-color: var(--text-secondary);
}

.custom-dropdown.open .dropdown-trigger {
  border-color: var(--text-color);
}

.dropdown-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-arrow {
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
  max-height: 300px;
  overflow-y: auto;
}

.custom-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.1s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
}

.dropdown-item.active {
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--bg-light);
}

.dropdown-item:first-child {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* List header dropdown styling */
.list-header .custom-dropdown {
  flex: 1;
  max-width: 180px;
}

.filter-reset {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 10px 16px;
  text-decoration: underline;
  transition: var(--transition);
}

.filter-reset:hover {
  color: var(--text-color);
}

/* =====================================================
   MAIN CONTENT - 2 Column Layout
   ===================================================== */
.main-content {
  display: grid;
  grid-template-columns: 1fr 480px;
  grid-template-rows: min-content;
  position: relative;
}

/* Left Column - Map/Image */
.map-column {
  min-width: 320px;
  display: block;
}

.clickMap {
  width: 100%;
  display: block;
}

.img-overlay {
  width: 100%;
  display: block;
}

.clickMap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Right Column - List */
.list-column {
  background: var(--bg-color);
  border-left: 1px solid var(--border-color);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  position: relative;
}

.list-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

.list-sorteer {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.list-header select {
  flex: 1;
  max-width: 180px;
}

.sort-direction {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.sort-direction:hover {
  border-color: var(--text-color);
  color: var(--text-color);
}

#myGrid {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.ag-root-wrapper {
  border: none !important;
}

.ag-body-viewport {
  overflow-x: hidden !important;
}

.ag-center-cols-viewport {
  overflow-x: hidden !important;
}

.ag-header {
  display: none !important;
}

/* Scrollbar styling */
#myGrid::-webkit-scrollbar {
  width: 6px;
}

#myGrid::-webkit-scrollbar-track {
  background: transparent;
}

#myGrid::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

#myGrid::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* =====================================================
   LIST ITEMS - Clean card style
   ===================================================== */
.ag-full-width-row {
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ag-row {
  margin: 0 !important;
  border: none !important;
}

.ag-full-width-row .ag-cell-wrapper {
  padding: 0 !important;
  width: 100% !important;
}

.ag-full-width-row a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
}

.woning-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 36px 16px 24px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.woning-item:hover {
  background-color: var(--bg-light);
}

.woning-info {
  flex: 1;
  min-width: 0;
}

.woning-nummer {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  line-height: 1.3;
}

.woning-type {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.woning-kenmerken {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.woning-prijs-inline {
  font-weight: 600;
  color: var(--text-color);
}

.woning-kenmerk {
  display: flex;
  align-items: center;
  gap: 6px;
}

.woning-kenmerk svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.kenmerk-divider {
  color: var(--border-color);
}

.woning-status {
  flex-shrink: 0;
  margin-left: 20px;
  padding-right: 4px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-beschikbaar {
  background-color: rgba(39, 174, 96, 0.1);
  color: var(--success-color);
}

.status-optie {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
}

.status-verkocht {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--accent-color);
}

.status-gereserveerd,
.status-tekenafspraak {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--warning-color);
}

.status-onbeschikbaar {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-light);
}

/* =====================================================
   SVG STATUS COLORS
   ===================================================== */
.svgVlak {
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.svgVlak[status="beschikbaar"] {
  fill: rgba(39, 174, 96, 0.5);
  stroke: white;
  stroke-width: 2px;
}

.svgVlak[status="optie"] {
  fill: rgba(243, 156, 18, 0.5);
  stroke: white;
  stroke-width: 2px;
}

.svgVlak[status="verkocht"] {
  fill: rgba(231, 76, 60, 0.5);
  stroke: white;
  stroke-width: 2px;
}

.svgVlak[status="tekenafspraak"],
.svgVlak[status="gereserveerd"] {
  fill: rgba(243, 156, 18, 0.5);
  stroke: white;
  stroke-width: 2px;
}

.svgVlak[status="onbeschikbaar"] {
  fill: rgba(150, 150, 150, 0.5);
  stroke: white;
  stroke-width: 2px;
}

.svgVlak:hover {
  fill: rgba(0, 0, 0, 0.4);
}

/* Dim all other houses when one is selected */
.has-selected-woning .svgVlak:not(.svgVlak-selected) {
  fill: rgba(0, 0, 0, 0.4) !important;
  stroke: rgba(255, 255, 255, 0.2) !important;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

/* Clean static outline on selected house */
polygon.svgVlak.svgVlak-selected,
path.svgVlak.svgVlak-selected {
  fill: transparent;
  stroke: #ffffff;
  stroke-width: 3px;
}

/* Floating pin marker */
.selected-pin {
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.svgVlak[soortfilter="uit"],
.svgVlak[statusfilter="uit"],
.svgVlak[prijsfilter="uit"],
.svgVlak[m2filter="uit"] {
  fill: rgba(200, 200, 200, 0.3) !important;
  pointer-events: none;
}


/* =====================================================
   MODAL STYLES - Custom Modal (no external library)
   ===================================================== */

/* Custom Modal Overlay - Absolute within list-column */
.custom-modal-overlay {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.custom-modal-overlay.visible {
  transform: translateX(0);
  pointer-events: auto;
}

/* Modal Box - fills the list-column */
.custom-modal-box {
  background: white;
  width: 100%;
  height: 100%;
  min-height: 500px;
  margin: 0;
  border-radius: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.12);
}

/* Header bar with back button */
/* Close / Back Button */
.custom-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.custom-modal-close:hover {
  color: var(--text-color);
  background: var(--bg-light);
}

.modalBwnrTitelRij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

/* Modal Content */
.custom-modal-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modalBwnrKolom {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modalImpressies {
  padding: 0;
}

.modalBwnrAfbeelding {
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-light);
  overflow: hidden;
  margin-top: 0;
}

.modalBwnrAfbeelding img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Swiper — modal image slider */
.modalBwnrSwiper {
  position: relative;
  overflow: hidden;
}

/* Kill any Swiper default nav that might bleed through */
.modalBwnrSwiper .swiper-button-prev,
.modalBwnrSwiper .swiper-button-next {
  display: none !important;
}

.modalBwnrSwiper .swiper {
  width: 100%;
  height: 100%;
}

.modalBwnrSwiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Custom prev/next buttons — bare white arrows, visible on any image */
.modal-swiper-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
  transition: filter 0.15s ease, opacity 0.15s ease;
  opacity: 0.85;
  padding: 6px;
}

.modal-swiper-btn:hover {
  opacity: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.modal-swiper-prev { left: 4px; }
.modal-swiper-next { right: 4px; }

/* Custom dot pagination */
.modal-swiper-pagination {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 10;
  pointer-events: none;
}

.modal-swiper-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0.45;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.15s ease;
  display: inline-block;
}

.modal-swiper-dot-active {
  opacity: 1;
}

/* Non-scrolling header: title + status badge */
.modalBwnrMeta {
  flex: 0 0 auto;
  padding: 20px 24px 0;
}

.modalBwnr {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1;
  color: var(--text-color);
}

/* Modal Status Badges */
.modalStatusbeschikbaar,
.modalStatusoptie,
.modalStatusverkocht,
.modalStatusonbeschikbaar,
.modalStatusgereserveerd,
.modalStatustekenafspraak {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.modalStatusbeschikbaar { 
  color: var(--success-color); 
  background-color: rgba(39, 174, 96, 0.12);
}
.modalStatusoptie { 
  color: var(--warning-color); 
  background-color: rgba(243, 156, 18, 0.12);
}
.modalStatusverkocht { 
  color: var(--accent-color); 
  background-color: rgba(231, 76, 60, 0.12);
}
.modalStatusonbeschikbaar { 
  color: var(--text-light); 
  background-color: rgba(0, 0, 0, 0.06);
}
.modalStatusgereserveerd { 
  color: var(--warning-color); 
  background-color: rgba(243, 156, 18, 0.12);
}
.modalStatustekenafspraak { 
  color: var(--warning-color); 
  background-color: rgba(243, 156, 18, 0.12);
}

/* Modal Tabs — segmented pill control */
.modalTabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border-color);
}

.modalTab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 11px 10px;
  cursor: pointer;
  font-weight: 400;
  font-size: 13.5px;
  font-family: var(--font-family);
  color: var(--text-secondary);
  text-align: left;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.modalTab:hover:not(.active) {
  color: var(--text-color);
}

.modalTab.active {
  color: var(--text-color);
}

/* Scroll wrapper — holds the scrollable content + fade overlay */
.modal-scroll-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Fade gradient — visible when content overflows, hides at bottom */
.modal-scroll-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(to bottom, transparent 0%, white 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.modal-scroll-wrapper.scroll-has-overflow::after {
  opacity: 1;
}

.modal-scroll-wrapper.scroll-at-bottom::after {
  opacity: 0;
}

/* Bouncing chevron — communicates "scroll for more" */
.modal-scroll-wrapper::before {
  content: '';
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: translateX(-50%) translateY(0px) rotate(45deg);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-scroll-wrapper.scroll-has-overflow::before {
  opacity: 1;
  animation: scrollBounce 1.3s ease infinite;
}

.modal-scroll-wrapper.scroll-at-bottom::before {
  opacity: 0;
  animation: none;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0px) rotate(45deg); }
  50%       { transform: translateX(-50%) translateY(4px) rotate(45deg); }
}

/* Actual scrollable area */
.modalScrollContent {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.modalScrollContent::-webkit-scrollbar {
  width: 5px;
}

.modalScrollContent::-webkit-scrollbar-track {
  background: transparent;
}

.modalScrollContent::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.modalScrollContent::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.modalTabContent {
  display: none;
}

.modalTabContent.active {
  display: block;
}

.modalAlgemeenContent {
  overflow: visible;
}

.modalGroupTitel1 {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 28px;
  margin-bottom: 0;
  padding-bottom: 10px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-color);
}

.modalGroupTitel1:first-child {
  margin-top: 0;
}

.modalAlgemeenVak {
  margin-bottom: 8px;
  font-size: 14px;
}

.modalKenmerkenGroup {
  display: flex;
  align-items: baseline;
  padding: 9px 0;
  gap: 12px;
}

.modalKenmerkItem1,
.modalKenmerkItem1bvoKenmerk {
  flex: 0 0 160px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.modalKenmerkItem2 {
  flex: 1;
  font-size: 14px;
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.4;
}

/* Modal Documents */
.modalDocumenten {
  overflow: visible;
}

.modalEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-light);
  text-align: center;
}

.modalEmptyState p {
  font-size: 13.5px;
  color: var(--text-light);
  margin: 0;
}

.modalDocumentItem {
  padding: 13px 0;
  border-bottom: 1px solid var(--border-color);
}

.modalDocumentItem:first-child {
  border-top: 1px solid var(--border-color);
}

.modalDocumentItem a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  gap: 12px;
  font-size: 14px;
  transition: var(--transition);
}

.modalDocumentItem a:hover {
  color: var(--accent-color);
}

.modalDocumentItem img {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

/* =====================================================
   TOOLTIP STYLES
   ===================================================== */
/* Let .tippy-content own the card — strip all Tippy-box defaults */
.tippy-box {
  background-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.tippy-content {
  padding: 0;
  background-color: white;
  width: 216px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
}

.tooltipEigenschappen {
  font-family: var(--font-family);
  font-size: 13px;
  color: var(--text-color);
}

.thumbAfbeeling {
  margin: 0;
}

.thumbAfbeeling img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.thumbBouwnummer {
  padding: 12px;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.thumbWoonoppervlakte,
.thumbBuitenruimte,
.thumbLigging,
.thumbPrijs {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  font-size: 13px;
}

.thumbWoonoppervlakte img,
.thumbBuitenruimte img,
.thumbLigging img,
.thumbPrijs img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

@media (hover: none) {
  .tippy-box { display: none; }
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.lds-ellipsis {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lds-ellipsis div {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) { left: calc(50% - 24px); animation: lds-ellipsis1 0.6s infinite; }
.lds-ellipsis div:nth-child(2) { left: calc(50% - 24px); animation: lds-ellipsis2 0.6s infinite; }
.lds-ellipsis div:nth-child(3) { left: 50%; animation: lds-ellipsis2 0.6s infinite; }
.lds-ellipsis div:nth-child(4) { left: calc(50% + 24px); animation: lds-ellipsis3 0.6s infinite; }

@keyframes lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes lds-ellipsis2 { 0% { transform: translateX(0); } 100% { transform: translateX(24px); } }
@keyframes lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } }

/* =====================================================
   SLIDER STYLES (noUiSlider)
   ===================================================== */
.noUi-target {
  background: var(--border-color);
  border: none;
  box-shadow: none;
}

.noUi-connect {
  background: var(--text-color) !important;
}

.noUi-horizontal {
  height: 4px !important;
}

.noUi-horizontal .noUi-handle {
  width: 16px !important;
  height: 16px !important;
  right: -8px !important;
  top: -6px !important;
  border-radius: 50% !important;
  border: 2px solid var(--text-color);
  background: white;
  box-shadow: none;
  cursor: grab;
}

.noUi-handle:before,
.noUi-handle:after {
  display: none !important;
}

.noUi-tooltip {
  display: none;
}

/* =====================================================
   RESPONSIVE — Container Queries
   Layout responds to the embed container width,
   not the viewport. Works correctly whether the embed
   is full-width, half-width, or in a narrow column.
   ===================================================== */

/* ─── Compact layout: container ≤ 1050px ─────────────
   The list column is fixed at 480px. At 1050px the map
   is 570px wide → ~310px tall → list shows ~2.5 items.
   Below 1050px the 2-column layout is too cramped;
   stacking gives a better experience.
   ─────────────────────────────────────────────────── */
@container wz (max-width: 1050px) {

  /* Stack vertically */
  .main-content {
    display: flex;
    flex-direction: column;
  }

  .map-column {
    flex: 0 0 auto;
    width: 100%;
    overflow: visible;
  }

  .clickMap svg {
    width: 100%;
    height: auto;
    display: block;
  }

  /* List fills full width below the map */
  .list-column {
    display: block !important;
    border-left: none;
    border-top: 1px solid var(--border-color);
    position: relative;
  }

  /* Give the grid a fixed height so the list is scannable */
  #myGrid {
    height: 420px !important;
    overflow-y: auto;
  }

  .ag-root-wrapper {
    height: 100% !important;
  }

  /* Filter bar collapses to a toggle button */
  .filter-bar-inner {
    justify-content: center;
  }

  .filter-toggle {
    display: flex;
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .filter-controls {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    z-index: 200;
  }

  .filter-controls.active {
    display: flex;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group .custom-dropdown {
    width: 100%;
  }

  .filter-slider-group {
    width: 100%;
    padding: 8px 0;
  }

  .filter-reset {
    width: 100%;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
  }

  /* List header */
  .list-header {
    padding: 12px 16px;
  }

  .list-header .custom-dropdown {
    max-width: none;
  }

  /* List items */
  .woning-item {
    padding: 12px 28px 12px 16px;
  }

  .woning-nummer {
    font-size: 16px;
  }

  .woning-kenmerken {
    gap: 12px;
    font-size: 13px;
  }

  .woning-status {
    margin-left: 12px;
  }

  .status-badge {
    font-size: 10px;
    padding: 5px 8px;
  }

  /* Detail modal — aspect-ratio handles image height automatically */

  .modalBwnrMeta {
    padding: 16px 16px 0;
  }

  .modalScrollContent {
    padding: 16px 16px 48px;
  }

  .modalBwnr {
    font-size: 20px;
  }

  .modalKenmerkItem1,
  .modalKenmerkItem1bvoKenmerk {
    flex: 0 0 140px;
  }

}

/* ─── Extra small: container ≤ 480px ─────────────────
   Tight embeds / narrow sidebars.
   ─────────────────────────────────────────────────── */
@container wz (max-width: 480px) {

  .filter-bar {
    padding: 10px 0;
  }

  .woning-item {
    padding: 10px 20px 10px 12px;
  }

  .woning-kenmerken {
    gap: 8px;
    font-size: 12px;
  }

  .modalKenmerkItem1,
  .modalKenmerkItem1bvoKenmerk {
    flex: 0 0 120px;
    font-size: 12.5px;
  }

  .modalBwnr {
    font-size: 18px;
  }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media (max-width: 768px) {
  .modalBwnrAfbeelding img,
  .swiper-slide img {
    cursor: default;
  }

  /* Bottom sheet — slides up from below, map stays visible above */
  .custom-modal-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: var(--sheet-height, 70vh);
    z-index: 500;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }

  .custom-modal-overlay.visible {
    transform: translateY(0);
  }

  .custom-modal-box {
    border-radius: 16px 16px 0 0;
    box-shadow: none;
  }

}

@media print {
  .woningzoeker-container {
    min-height: auto;
  }
  
  .lds-ellipsis,
  .filter-bar {
    display: none !important;
  }
}

/* Lightbox */
#lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9999;
  background: var(--lightbox-bg);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}

#lightbox.active {
  display: flex;
}

#lightbox.active.visible {
  opacity: 1;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--lightbox-img-radius);
  display: block;
  user-select: none;
  transition: opacity 0.15s ease;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.25);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.25);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-counter {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--lightbox-counter-color);
  font-size: 12px;
  font-family: var(--font-family);
  letter-spacing: 0.08em;
  background: var(--lightbox-counter-bg);
  padding: 4px 12px;
  border-radius: 0;
}
