/**
 * Definitieve Styling voor Heidestaete Woningen
 * Versie: 2.2.0 - Finale versie met correcties.
 */

/* --- Globale Instellingen & Variabelen --- */
@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

:root {
  --kleur-te-koop: #b1c049;
  --kleur-onder-optie: #f7b14c;
  --kleur-verkocht: #eb6032;
}

/* --- NIEUWE Styling voor de Skeleton Loader elementen --- */

.skeleton-main-slider {
  width: 100%;
  height: 620px; /* Gebruik dezelfde hoogte als je echte slider */
  max-height: 70vh;
  background: #e0e0e0;
  border-radius: 4px;
}

.skeleton-status {
  width: 120px; /* Breedte van de status-tag */
  height: 20px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.skeleton-tab-link {
  display: inline-block;
  height: 35px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-right: 10px;
  margin-bottom: 20px; /* Vult de ruimte van de tab-nav bottom border */
}

.skeleton-price {
  width: 150px; /* Breedte van de prijs */
  height: 24px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 20px;
}

.skeleton-text-block {
  margin-bottom: 20px;
}

.skeleton-line {
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
}
.skeleton-line.full { width: 100%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.short { width: 50%; }

.skeleton-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.skeleton-table-row {
  height: 20px; /* Hoogte van een tabelrij */
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px; /* Ruimte tussen de rijen */
}

/* --- NIEUWE Styling en animatie voor de Skeleton Loader --- */

/* Definieer de animatie die de golf van links naar rechts beweegt */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Pas het effect toe op alle skeleton-onderdelen */
.skeleton-h2,
.skeleton-h3,
.skeleton-main-slider,
.skeleton-status,
.skeleton-tab-link,
.skeleton-price,
.skeleton-line,
.skeleton-table-row {
  position: relative; /* Noodzakelijk voor het positioneren van de golf */
  overflow: hidden;   /* Zorgt dat de golf binnen het blok blijft */
  background: #e0e0e0; /* De basiskleur van de blokken */
}

/* Creëer de golf zelf als een laagje bovenop de blokken */
.skeleton-h2::after,
.skeleton-h3::after,
.skeleton-main-slider::after,
.skeleton-status::after,
.skeleton-tab-link::after,
.skeleton-price::after,
.skeleton-line::after,
.skeleton-table-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  /* De golf: een gradient van donkergrijs, naar lichtgrijs en weer terug */
  background: linear-gradient(90deg, #e0e0e0, #f0f0f0, #e0e0e0);
  
  /* Start de golf buiten het scherm en laat hem bewegen */
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
/* --- Responsive aanpassingen voor de Skeleton Loader --- */
@media (max-width: 992px) {
  .skeleton-main-slider {
    height: 300px; /* Kleinere hoogte op mobiel */
  }
}

/* --- 1. Overzichtspagina Grid --- */
.woning-overzicht-grid .woning-rij {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.woning-type-blok {
  flex-basis: calc(33.333% - 16px);
  flex-grow: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  transition: box-shadow 0.3s ease;
  box-shadow: -6px 7px 22px -1px rgba(0,0,0,0.52);
}

.placeholder-blok {
flex-basis: calc(33.333% - 16px);
  flex-grow: 0;
     display: flex;
}
  
.woning-type-blok:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}


.placeholder-blok img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.woning-type-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  color: #333;
}

.woning-type-afbeelding {
  overflow: hidden;
  border: solid #fff;
  border-width: 10px 10px 5px;
}

.woning-type-afbeelding img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.woning-type-link:hover .woning-type-afbeelding img {
  transform: scale(1.05);
}

.woning-type-info {
  border: solid #fff;
  border-width: 0 10px 10px;
  padding: 0;
  margin-top: auto;
}

.woning-type-titel-balk {
  background-color: var(--kleur-te-koop);
  color: #000;
  padding: 15px 20px;
  text-align: left;
  font-family: 'Varela Round', sans-serif;
  font-weight: 600;
  font-size: 1.1em;
}


/* --- 2. Popup Hoofdstructuur --- */
.woning-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(25, 28, 31, 0.5);
  z-index: 10000;
  display: flex;
  justify-content: center;
  padding: 50px;
  box-sizing: border-box;
}

.woning-popup-container {
  width: 100%;
  max-width: 90vw;
  max-height: 95vh; /* Behoud de maximale hoogte */
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  margin: auto; 
  height: auto; 
}

.woning-popup-close {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  color: #333;
  border: 2px solid #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.60);
}

.woning-popup-close:hover {
  transform: scale(1.1);
}


/* --- 3. Popup Content --- */
#woning-popup-main {
  padding: 10px !important;
  overflow-y: auto;
  min-height: 0;
}

#woning-popup-main h2 {
  font-family: 'Varela Round', sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin-top: 0;
  padding: 10px 0px 0px 10px;
}

#woning-popup-main h3 {
  font-size: 2.5em;
  margin-bottom: 0;
}

.woning-details-info .status {
  font-family: 'Varela Round', sans-serif;
  text-transform: lowercase;
  font-weight: bold;
  font-size: 2.0em;
  margin-top: 0;
  margin-bottom: 0.5em;
}

.omschrijving p {
  line-height: 1.2;
}

.woning-details-content-wrapper {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 40px;
  align-items: start;
}

.woning-details-slideshow .splide {
  height: 620px;
  max-height: 70vh;
  border-radius: 4px;
  overflow: hidden;
}

.splide__track, .splide__list {
  height: 100%;
}

.splide__slide {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.tab-nav {
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}

.tab-link {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-bottom: 0;
  background: none;
  cursor: pointer;
  font-size: 1em;
  margin-bottom: -1px;
}
.tab-link.active {
  border-color: #ccc;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  background: #fff;
  font-weight: bold;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.woning-specificaties-tabel {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
}
.woning-specificaties-tabel td {
  padding: 0px 10px;
}

.popup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}
.popup-grid img {
  width: 100%;
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.popup-grid img:hover {
  transform: scale(1.05);
}


/* --- 4. Thumbnails (onderaan popup) --- */
/* Zorgt voor centrering van de thumbnails als ze in de balk passen */
#thumbnail-slider .splide__list {
  justify-content: center;
}

#woning-popup-sidebar {
  width: 100%;
  max-height: 130px;
  flex-shrink: 0;
  padding: 10px; 
  }

#woning-popup-sidebar::-webkit-scrollbar { width: 4px; }
#woning-popup-sidebar::-webkit-scrollbar-thumb { background: #888; border-radius: 2px; }
#woning-popup-sidebar::-webkit-scrollbar-thumb:hover { background: #555; }

.woning-thumb {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.woning-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.woning-thumb .thumb-title-block {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 8px;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  border-bottom-right-radius: 4px;
}


/* Achtergrond voor de titel-blokjes (blijft hetzelfde) */
.woning-thumb.status-te-koop .thumb-title-block { background-color: var(--kleur-te-koop); }
.woning-thumb.status-onder-optie .thumb-title-block { background-color: var(--kleur-onder-optie); }
.woning-thumb.status-verkocht .thumb-title-block { background-color: var(--kleur-verkocht); }

/* Border voor de actieve thumbnail (ULTRA-SPECIFIEKE SELECTOR) */
#thumbnail-slider .splide__slide.is-active.status-te-koop {
  border: 3px solid var(--kleur-te-koop);
}
#thumbnail-slider .splide__slide.is-active.status-onder-optie {
  border: 3px solid var(--kleur-onder-optie);
}
#thumbnail-slider .splide__slide.is-active.status-verkocht {
  border: 3px solid var(--kleur-verkocht);
}

/* Kleur voor de status-tekst (blijft hetzelfde) */
.status.status-te-koop { color: var(--kleur-te-koop); }
.status.status-onder-optie { color: var(--kleur-onder-optie); }
.status.status-verkocht { color: var(--kleur-verkocht); }


/* --- 6. Externe Library Fixes & Styles --- */
.fancybox__container {
  z-index: 11000 !important;
}

.splide__arrows {
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: auto;
  height: auto;
  display: flex;
  gap: 8px;
}

.splide__arrow {
  position: static;
  transform: none;
  background: rgba(255, 255, 255, 0.9);
  width: 40px;
  height: 40px;
  opacity: 0.8;
  border-radius: 50%;
}

.splide__arrow:hover {
  background: #fff;
  opacity: 1;
}

.splide__arrow svg {
  fill: #333;
}


/* --- 7. Responsive Media Queries --- */
@media (max-width: 992px) {
  /* Popup Layout */
  .woning-popup-overlay {
    padding: 10px;
  }
  .woning-popup-container {
    max-height: 90vh;
  }

  /* Thumbnails */
  .woning-thumb {
    width: 70px;
    height: 70px;
  }
  .woning-thumb .thumb-title-block {
    padding: 4px;
    font-size: 10px;
  }

  /* Popup Content Layout */
  .woning-details-content-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Slideshow */
  .woning-details-slideshow .splide {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  /* Mobiele Font Sizes */
  #woning-popup-main h2 {
    font-size: 20px;
  }
  #woning-popup-main h3 {
    font-size: 24px;
  }
  .woning-details-info .status {
    font-size: 20px;
  }
  /* NIEUW: Zet de thumbnail-uitlijning terug naar links op mobiel */
  #thumbnail-slider .splide__list {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  /* Overzichtspagina */
  .woning-rij {
    flex-direction: column;
  }
  .woning-type-titel-balk {
    padding: 10px 15px;
    font-size: 1em;
  }

  /* Popup */
  .tab-link {
    padding: 10px;
  }
  .popup-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}