/*
 * Thomas Products Enterprise (v7.0)
 * Sidebar filters – designed to match Thomas Pumps.
 */

:root{
  --tp-border:#d0d5dd;
  --tp-border-soft:#e4e7ec;
  --tp-text:#101828;
  --tp-muted:#667085;
  --tp-panel:#f3f3f3;
  --tp-red:#d91f2a;
}

.tp-sidebar{ position: sticky; top: 16px; }

.tp-filter-form{
  background: #f3f3f3;
  border: 1px solid #e2e2e2;
  border-radius: 0;
  overflow: hidden;
}

/* Selected filters */
.tp-selected{
  background: #fff;
  border-bottom: 1px solid var(--tp-border-soft);
  padding: 14px 14px 12px;
}

.tp-selected__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tp-muted);
}

.tp-clear{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 10px;
  border: 1px solid var(--tp-red);
  color: var(--tp-red);
  background: #fff;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  text-decoration:none;
}

.tp-selected__chips{ display:flex; flex-wrap:wrap; gap: 10px; }

.tp-chip{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--tp-border);
  background: #fff;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #344054;
}

.tp-chip__x{
  appearance:none;
  border:0;
  background: transparent;
  color: #344054;
  font-size: 16px;
  line-height: 1;
  cursor:pointer;
  padding: 0;
  margin: 0;
}

.tp-selected__none{ color: var(--tp-muted); font-size: 12px; }

/* Accordion rows (Thomas flat style) */
.tp-acc{
  border-bottom: 1px solid #e6e6e6;
  background: #f3f3f3;
}

.tp-acc__btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 18px 20px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: #f3f3f3;
  cursor:pointer;
  text-align:left;
  min-height: 56px;
}

.tp-acc__btn:hover{ background:#ececec; }

.tp-acc__label{
  margin:0;
  font-size: 15px;
  font-weight: 600;
  color: #2c2c2c;
  line-height: 1.2;
}

/* Chevron (SVG stroke to match Thomas) */
.tp-acc__chev{
  width: 18px;
  height: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 18px;
  margin-left: 10px;
}

.tp-acc__chev svg{
  width: 18px;
  height: 18px;
  display:block;
  fill: none !important;
  stroke: #2c2c2c;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}

.tp-acc__btn[aria-expanded="true"] .tp-acc__chev svg{ transform: rotate(180deg); }

.tp-acc__body{
  padding: 0 20px 18px;
  display:none;
  overflow:hidden;
  max-height: 0;
  opacity: 1;
  transition: max-height .25s ease, opacity .25s ease;
}
/* Checklist (Thomas-style square checkboxes) */
.tp-checklist{ display:flex; flex-direction:column; gap: 10px; padding-top: 4px; }

.tp-check{
  display:flex;
  align-items:center;
  gap: 10px;
  cursor:pointer;
  user-select:none;
  font-size: 13px;
  color: #344054;
}

.tp-check input{
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--tp-red);
}

/* Slider */
.tp-slider{ position:relative; padding-top: 8px; padding-bottom: 26px; }

.tp-slider__out{
  display:flex;
  align-items:center;
  gap: 6px;
  font-size: 12px;
  color: #344054;
  font-weight: 600;
  margin-bottom: 10px;
}

.tp-slider__bar{
  position:relative;
  height: 4px;
  background: #d0d5dd;
  border-radius: 999px;
}

.tp-slider__bar-range{
  position:absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: var(--tp-red);
  border-radius: 999px;
}

.tp-range{
  -webkit-appearance: none;
  appearance: none;
  position:absolute;
  left: 0;
  right: 0;
  top: 32px; /* aligns thumbs around the bar */
  width:100%;
  height: 4px;
  background: transparent;
  pointer-events: none; /* let thumbs handle pointer */
}

.tp-range::-webkit-slider-runnable-track{ height: 4px; background: transparent; }
.tp-range::-moz-range-track{ height: 4px; background: transparent; }

.tp-range::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tp-red);
  cursor: pointer;
  pointer-events: all;
}

.tp-range::-moz-range-thumb{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tp-red);
  cursor: pointer;
  pointer-events: all;
}

/* Prevent overlap selection issues */
.tp-range--min{ z-index: 2; }
.tp-range--max{ z-index: 3; }

.tp-empty{ font-size: 12px; color: var(--tp-muted); padding: 8px 0; }

/* Mobile */
@media (max-width: 860px){
  .tp-sidebar{ position: relative; top: auto; }
}
