/* Filter widget - scoped with ax- prefix to avoid clashes with Jetshop's own styles */

/* Robust hiding: !important defeats any inline width/display the theme might apply.
 * Also strip margins/borders so the removed slot doesn't leave grid/flex gaps. */
.ax-hidden-by-filter,
.ax-hidden-by-filter.product-outer-wrapper,
.ax-hidden-by-filter .product-outer-wrapper {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}


.ax-filter-widget {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  border: 1px solid #d0d0d0;
  background: #f6f6f6;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 0 0 16px;
  color: #222;
}

.ax-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ax-filter-header strong {
  font-style: italic;
  font-size: 14px;
}
.ax-filter-clear {
  background: transparent;
  border: 1px solid #999;
  border-radius: 3px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
}
.ax-filter-clear:hover {
  background: #e8e8e8;
}

.ax-filter-facet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ax-facet-btn {
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: #222;
  transition: border-color .12s, background .12s;
}
.ax-facet-btn:hover {
  border-color: #666;
}
.ax-facet-btn.is-active {
  background: #eaf3ff;
  border-color: #4477bb;
  color: #234;
}
.ax-facet-caret {
  color: #666;
  font-size: 10px;
  margin-left: 4px;
}

.ax-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #ccc;
}

.ax-chip {
  background: #4477bb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 4px 10px 4px 12px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ax-chip:hover {
  background: #365e97;
}
.ax-chip-x {
  font-size: 15px;
  line-height: 1;
}

.ax-filter-count {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
  color: #555;
  font-size: 12px;
}

/* ---------------- Popup ---------------- */

.ax-filter-popup {
  background: #fff;
  border: 1px solid #999;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
  min-width: 280px;
  max-width: 380px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #222;
}
.ax-popup-header {
  padding: 10px 14px;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}
.ax-popup-body {
  padding: 8px 12px;
  max-height: 320px;
  overflow-y: auto;
}
.ax-popup-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.ax-popup-footer button {
  padding: 5px 14px;
  border-radius: 3px;
  border: 1px solid #999;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.ax-popup-clear {
  color: #666;
}
.ax-popup-apply {
  background: #4477bb !important;
  color: #fff !important;
  border-color: #365e97 !important;
}

/* List filter */
.ax-popup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ax-popup-list li {
  margin: 2px 0;
}
.ax-popup-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 2px;
  cursor: pointer;
}
.ax-popup-list label:hover {
  background: #f0f5fb;
}
.ax-popup-list input[type="checkbox"] {
  margin: 0;
}
.ax-opt-label {
  flex: 1;
}
.ax-opt-count {
  color: #888;
  font-size: 11px;
}

/* Numeric filter */
.ax-numeric {
  padding: 4px 4px 8px;
}
.ax-num-inputs {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}
.ax-num-inputs label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #555;
  flex: 1;
}
.ax-num-inputs input[type="number"] {
  padding: 4px 6px;
  border: 1px solid #bbb;
  border-radius: 3px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 2px;
}

.ax-num-slider {
  padding: 0 8px;
}
.ax-num-track {
  position: relative;
  height: 28px;
}
.ax-num-track::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
}
.ax-num-range {
  position: absolute;
  top: 12px;
  height: 4px;
  background: #4477bb;
  border-radius: 2px;
}
.ax-num-track input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 28px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  margin: 0;
}
.ax-num-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #4477bb;
  cursor: pointer;
  margin-top: 0;
}
.ax-num-track input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #4477bb;
  cursor: pointer;
}
.ax-num-track input[type="range"]::-moz-range-track {
  background: transparent;
}
.ax-num-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* Bool filter */
.ax-bool {
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ax-bool label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 2px;
}
.ax-bool label:hover {
  background: #f0f5fb;
}

/* Responsive */
@media (max-width: 640px) {
  .ax-filter-popup {
    min-width: 260px;
    max-width: 90vw;
  }
  .ax-num-inputs {
    flex-direction: column;
    gap: 8px;
  }
}
