/* =========================================================
   FLEXA DIVI BLOG FILTER – v2.0 (Compact & Strak)
   ========================================================= */

/* ---------- Algemene layout ---------- */
.flexa-blog-filter {
  margin: 2rem 0;
  position: relative;
  color: #000;
}

/* ---------- Blog list GRID layout ---------- */
.flexa-blog-filter.layout-grid .flexa-blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  position: relative;
}

/* =========================================================
   KAARTEN / BLOG ITEMS
   ========================================================= */
.flexa-blog-item {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 0px;
  overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.flexa-blog-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.flexa-blog-item a.flexa-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* ---------- Afbeelding ---------- */
.flexa-blog-item .thumb {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #fafafa;
}

.flexa-blog-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.flexa-blog-item:hover .thumb img {
  transform: scale(1.05);
}

/* ---------- Inhoud ---------- */
.flexa-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.6rem 0.8rem 0.9rem;
  text-align: center;
}

/* ---------- Titel ---------- */
.flexa-blog-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #000;
  line-height: 1.3;
  margin: 0.6rem 0 0.4rem;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Prijs ---------- */
.acf-prijs .acf-value {
  color: #dbb307;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  display: inline-block;
}

/* ---------- Specs (kilometerstand & bouwjaar) ---------- */
.acf-specs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  font-size: 0.95rem;
  color: #000;
  font-weight: 500;
  margin-top: 2px;
}

.acf-spec {
  display: flex;
  align-items: center;
  gap: 6px;
}

.acf-spec i {
  font-size: 0.9rem;
  opacity: 0.8;
}

.acf-spec.km i {
  color: #dbb307;
}

.acf-spec.year i {
  color: #444;
}

/* =========================================================
   FILTERS + ZOEKVELD + TOGGLE
   ========================================================= */
.flexa-filter-wrapper {
  margin-bottom: 1.3rem;
}

.flexa-filter-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.flexa-filter-topbar .search-item {
  flex: 1 1 300px;
}

.flexa-filter-topbar .sort-item {
  flex: 0 1 220px;
}

.flexa-filter-topbar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
  display: block;
  margin-bottom: 3px;
}

/* ---------- Inputs & Selects ---------- */
.flexa-filter-topbar input[type="search"],
.flexa-filter-area input,
.flexa-filter-area select,
.flexa-filter-topbar .sort-item select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: #000;
}

.flexa-filter-topbar input[type="search"]:focus,
.flexa-filter-area input:focus,
.flexa-filter-area select:focus,
.flexa-filter-topbar .sort-item select:focus {
  outline: none;
  border-color: #fdcf09;
  box-shadow: 0 0 0 2px rgba(253, 207, 9, 0.25);
}

/* ---------- Toggle knop ---------- */
.flexa-filter-toggle {
  background: #000;
  color: #fdcf09;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.flexa-filter-toggle:hover {
  background: #fdcf09;
  color: #000;
}

/* ---------- Filterpaneel ---------- */
.flexa-filter-area {
  display: none;
  padding: 14px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-top: 5px;
  flex-wrap: wrap;
  gap: 12px;
}

.flexa-filter-area label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
}

/* ---------- Reset knop ---------- */
.flexa-filter-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.flexa-reset-filters {
  background: #f8f8f8;
  border: 1px solid #ccc;
  color: #000;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.flexa-reset-filters:hover {
  background: #fdcf09;
  color: #000;
  border-color: #dbb307;
}

/* =========================================================
   OVERLAY LOADER
   ========================================================= */
.flexa-overlay-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  display: none;
}

.flexa-overlay-loader .spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #fdcf09;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991px) {
  .flexa-blog-filter.layout-grid .flexa-blog-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .flexa-blog-filter.layout-grid .flexa-blog-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .acf-specs {
    flex-direction: column;
    gap: 4px;
  }

  .flexa-filter-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .flexa-filter-topbar .sort-item,
  .flexa-filter-topbar .search-item,
  .flexa-filter-toggle {
    width: 100%;
  }
}

/* =========================================================
   GEEN RESULTATEN / LOADER TEKST
   ========================================================= */
.flexa-loader {
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  color: #000;
}

.flexa-no-results {
  text-align: center;
  font-size: 1rem;
  color: #666;
  padding: 1rem 0;
}

/* ================================================
   PATCH – MOBIEL LAYOUT FIX
   ================================================ */
@media (max-width: 600px) {
  .flexa-filter-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px !important; /* was 15px, nu compacter */
    margin-bottom: 8px !important; /* voorkom grote witte ruimte */
  }

  .flexa-filter-topbar label {
    margin-bottom: 2px !important;
  }

  .flexa-filter-topbar .search-item,
  .flexa-filter-topbar .sort-item,
  .flexa-filter-toggle {
    width: 100%;
    margin: 0 !important;
  }

  .flexa-blog-filter {
    margin-top: 0 !important;
  }
}


/* ---------- Mobiel fix ---------- */
@media (max-width: 600px) {
  .flexa-filter-topbar .sort-item {
    flex: 1 1 100%;
    width: 100%;
  }
  
    .flexa-filter-topbar .search-item {
    flex: 1 1 100%;
    width: 100%;
    margin: 0; /* verwijdert eventuele restmarge */
  }

}

.flexa-blog-item .thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.flexa-blog-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.flexa-blog-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.flexa-slider-track {
  display: flex;
  transition: transform 0.6s ease;
}

.flexa-slide {
  min-width: 100%;
  display: none;
  text-align: center;
}
.flexa-slide.active { display: block; }

.slide-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.slide-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.slide-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide-content {
  padding: 0.8rem;
}
.slide-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.slide-acf span {
  display: block;
  font-size: 0.9rem;
  color: #333;
}

.slider-prev, .slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  border-radius: 50%;
  font-size: 1.4rem;
  z-index: 2;
}
.slider-prev:hover, .slider-next:hover { background: #000; }
.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.slider-dots {
  text-align: center;
  margin-top: 10px;
}
.slider-dots span {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #ccc;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
  transition: background 0.3s;
}
.slider-dots span.active { background: #dbb307; }

