/* ================================================================
   ZA TOUR FILTERS — Filter Bar, Dual Sliders, Custom Checkboxes
   ================================================================ */

/* ---- Filter Bar Container ---- */
.za-tf-bar {
  background: var(--za-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  overflow: hidden;
}

.za-tf-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--za-gray-100);
}

.za-tf-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  font-family: var(--font-accent);
  font-size: 1rem;
  font-weight: 600;
  color: var(--za-forest);
  cursor: pointer;
  padding: 0;
  transition: color .2s var(--ease);
}
.za-tf-toggle:hover { color: var(--za-mountain); }
.za-tf-chevron {
  transition: transform .3s var(--ease);
}
.za-tf-bar.collapsed .za-tf-chevron {
  transform: rotate(-90deg);
}

.za-tf-count {
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--za-gray-500);
}
.za-tf-count strong {
  color: var(--za-forest);
  font-weight: 700;
}

/* ---- Filter Body ---- */
.za-tf-body {
  padding: 24px 28px 28px;
  max-height: 600px;
  overflow: hidden;
  transition: max-height .4s var(--ease), padding .4s var(--ease), opacity .3s var(--ease);
  opacity: 1;
}
.za-tf-bar.collapsed .za-tf-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* ---- Search ---- */
.za-tf-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--za-gray-100);
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 2px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.za-tf-search:focus-within {
  border-color: var(--za-mountain);
  background: var(--za-white);
}
.za-tf-search svg { color: var(--za-gray-500); flex-shrink: 0; }
.za-tf-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--za-black);
  outline: none;
}
.za-tf-search input::placeholder { color: var(--za-gray-500); }

/* ---- Filter Groups Grid ---- */
.za-tf-groups {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
}

.za-tf-group h4 {
  font-family: var(--font-accent);
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--za-gray-700);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--za-gray-100);
}

/* ---- Custom Checkboxes ---- */
.za-tf-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.za-tf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  user-select: none;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--za-gray-700);
  transition: color .2s var(--ease);
}
.za-tf-check:hover { color: var(--za-forest); }
.za-tf-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.za-tf-checkmark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--za-gray-300);
  border-radius: 4px;
  background: var(--za-white);
  position: relative;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.za-tf-check input:checked ~ .za-tf-checkmark {
  background: var(--za-forest);
  border-color: var(--za-forest);
}
.za-tf-checkmark::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--za-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.za-tf-check input:checked ~ .za-tf-checkmark::after {
  display: block;
}
.za-tf-check:hover .za-tf-checkmark {
  border-color: var(--za-mountain);
}
.za-tf-check-label {
  line-height: 1.3;
}

/* ---- Dual Range Slider ---- */
.za-tf-slider {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}
.za-tf-slider-track {
  position: absolute;
  width: 100%;
  height: 5px;
  background: var(--za-gray-300);
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
}
.za-tf-slider-fill {
  position: absolute;
  height: 100%;
  background: var(--za-mountain);
  border-radius: 3px;
  transition: left .05s, width .05s;
}

.za-tf-range {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 5px;
  background: transparent;
  pointer-events: none;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  z-index: 2;
}
.za-tf-range::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
}
.za-tf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--za-white);
  border: 3px solid var(--za-forest);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  margin-top: -9px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.za-tf-range::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transform: scale(1.1);
}
.za-tf-range::-webkit-slider-thumb:active {
  background: var(--za-forest);
}
/* Firefox */
.za-tf-range::-moz-range-track {
  height: 5px;
  background: transparent;
  border: none;
}
.za-tf-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--za-white);
  border: 3px solid var(--za-forest);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.za-tf-range::-moz-range-thumb:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.za-tf-slider-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-accent);
  font-size: .82rem;
  font-weight: 600;
  color: var(--za-forest);
  margin-top: 4px;
}

/* ---- Actions ---- */
.za-tf-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--za-gray-100);
}
.za-tf-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid var(--za-gray-300);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: var(--font-accent);
  font-size: .85rem;
  font-weight: 600;
  color: var(--za-gray-700);
  cursor: pointer;
  transition: all .3s var(--ease);
}
.za-tf-reset:hover {
  border-color: var(--za-red);
  color: var(--za-red);
  background: rgba(192,57,43,.04);
}

/* ---- Results Area ---- */
.za-tf-results {
  position: relative;
  min-height: 300px;
}

/* Loading overlay */
.za-tf-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  z-index: 10;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-family: var(--font-accent);
  font-size: .95rem;
  color: var(--za-gray-700);
  border-radius: var(--radius-lg);
}
.za-tf-results.loading .za-tf-loading { display: flex; }
.za-tf-results.loading .tours-grid { opacity: .4; pointer-events: none; }

.za-tf-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--za-gray-300);
  border-top-color: var(--za-forest);
  border-radius: 50%;
  animation: za-spin .7s linear infinite;
}
@keyframes za-spin { to { transform: rotate(360deg); } }

/* Fade in cards */
.za-tf-results .tours-grid {
  transition: opacity .3s var(--ease);
}

/* Empty state */
.za-tf-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--za-gray-500);
}
.za-tf-empty svg { margin-bottom: 16px; opacity: .4; }
.za-tf-empty p { font-family: var(--font-accent); font-size: 1.1rem; margin: 0; }
.za-tf-empty-sub { font-size: .9rem !important; margin-top: 6px !important; opacity: .7; }

/* Difficulty badge on card */
.tour-card-difficulty {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 12px;
  font-family: var(--font-accent);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 50px;
  color: var(--za-white);
  z-index: 2;
}
.tour-diff-easy   { background: #27ae60; }
.tour-diff-medium { background: #f39c12; }
.tour-diff-hard   { background: #e74c3c; }

/* ---- Pagination ---- */
.za-tf-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.za-tf-pagination button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--za-gray-300);
  border-radius: var(--radius);
  background: var(--za-white);
  font-family: var(--font-accent);
  font-size: .9rem;
  font-weight: 600;
  color: var(--za-gray-700);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.za-tf-pagination button:hover {
  border-color: var(--za-forest);
  color: var(--za-forest);
}
.za-tf-pagination button.active {
  background: var(--za-forest);
  border-color: var(--za-forest);
  color: var(--za-white);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .za-tf-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .za-tf-bar-top { padding: 14px 20px; }
  .za-tf-body { padding: 18px 20px 22px; }
  .za-tf-groups {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .za-tf-count { font-size: .82rem; }
  .za-tf-bar.collapsed .za-tf-bar-top {
    border-bottom: none;
  }
}
@media (max-width: 480px) {
  .za-tf-groups {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .za-tf-bar-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
