/* Wrapper */
.ife-filters-wrap {
    background: #f8f8f8;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Each filter block */
.ife-filter {
    padding: 10px 0;
    border-bottom: 1px solid #e1e1e1;
}

.ife-filter:last-child {
    border-bottom: none;
}

/* Filter label/title */
.ife-filter-label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
    color: #333;
}

/* NEW: make label feel/tap like a button on mobile */
.ife-filter-label[role="button"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
  position: relative;
  z-index: 3;             /* lift above slider tooltips/handles */
  pointer-events: auto;   /* ensure taps reach the label */
}
.ife-filter-label[role="button"]:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* NEW: body wrapper introduced by JS; hide when [hidden] is present */
.ife-filter-body[hidden] {
  display: none !important;
}

/* Optional: make native <summary> look tappable too */
summary {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Keep extra space above sliders so handles/tooltips don't collide with labels */
.ife-filter-type-slider .ife-filter-label{
    margin-bottom: 50px;
}

/* Checkbox list */
.ife-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 5px;
}

.ife-checkbox-list label {
    cursor: pointer;
    color: #444;
}

.ife-checkbox-list label input[type="checkbox"] {
    margin-right: 6px;
}

/* Hidden items for show more */
.ife-hidden {
    display: none;
}

/* Show more/less button */
.ife-show-more {
    background: none;
    border: none!important;
    color: #0073aa!important;
    padding: 2px 4px!important;
    cursor: pointer!important;
    font-size: 13px!important;
    margin-top: 5px!important;
}

.ife-show-more:hover, .ife-show-more:focus {
    background-color: #4CAF50!important;
    text-decoration: underline!important;
}

/* Slider */
.ife-slider {
    margin: 10px 0 20px;
}

.noUi-connect{
    background: #4CAF50;
}

/* Clear All button */
.ife-filter-clear {
    margin-top: 15px;
    text-align: right;
}

#ife-clear-all.button {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

#ife-clear-all.button:hover {
    background: #2D80C3;
    border-color: #2D80C3;
}

/* Mobile-only tooltip adjustments to prevent clipping */
/* MOBILE: show noUi tooltips *below* the handle so they don't overlap labels */
@media (max-width: 768px), (pointer: coarse) {
  /* Less gap above slider labels on mobile since tooltips move below */
  .ife-filter-type-slider .ife-filter-label {
    margin-bottom: 12px; /* was 50px */
  }

  /* Add space *below* sliders to make room for the tooltip */
  .ife-slider {
    margin: 10px 0 44px; /* extra bottom margin for the tooltip */
  }

  /* Base tooltip position: centered below the handle */
  .noUi-horizontal .noUi-handle .noUi-tooltip {
    position: absolute;
    top: 115%;     /* place below the handle */
    bottom: auto;  /* ensure we're not anchoring from bottom */
    left: 50%;
    transform: translate(-50%, 0);
    white-space: nowrap;
    pointer-events: none; /* avoid accidental taps */
    z-index: 2;          /* stay above track/handles */
  }

  /* If tooltip hits the right edge, nudge it left a bit */
  .noUi-horizontal .noUi-handle .noUi-tooltip.ife-tip-nudge-left {
    transform: translate(-70%, 0);
  }

  /* If tooltip hits the left edge, nudge it right a bit */
.noUi-horizontal .noUi-handle .noUi-tooltip.ife-tip-nudge-right {
    transform: translate(-30%, 0);
  }
}

/* Search shortcode loading indicator */
.ife-results.ife-results--loading {
    opacity: 0.55;
    position: relative;
    transition: opacity 0.2s ease;
}
.ife-results.ife-results--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,0.15);
    border-top-color: #2D80C3;
    animation: ife-spin 0.8s linear infinite;
    pointer-events: none;
}

@keyframes ife-spin {
    to { transform: rotate(360deg); }
}
