/* MoonLight_X — shop-filters.css
   Price range slider · filter panel · checkboxes · active chips · load more */

/* ═══════════════════════════════════════════════════════════════════
   FILTER BAR WRAPPER
══════════════════════════════════════════════════════════════════ */
.mlx-shop-filter-bar {
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE TOGGLE
══════════════════════════════════════════════════════════════════ */
.mlx-filter-toggle {
  display: none; /* shown on mobile via @media */
  align-items: center;
  gap: .5rem;
  padding: .625rem 1rem;
  background: var(--mlx-bg-card, #fff);
  border: 1px solid var(--mlx-border, #ddd);
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--mlx-color-primary, #0a0a0a);
  transition: border-color .2s, box-shadow .2s;
}
.mlx-filter-toggle:hover { border-color: var(--mlx-color-primary, #0a0a0a); }
.mlx-filter-toggle svg   { width: 16px; height: 16px; flex-shrink: 0; }

.mlx-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--mlx-color-accent, #e84545);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0 5px;
}

/* ═══════════════════════════════════════════════════════════════════
   FILTER PANEL — desktop horizontal strip
══════════════════════════════════════════════════════════════════ */
.mlx-filter-panel {
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  padding: 1.25rem;
  display: none;  /* hidden by default — toggle opens it */
  flex-direction: column;
  gap: 1rem;
}
.mlx-filter-panel.is-open {
  display: flex;
}
/* When sidebar type — always visible, no toggle needed */
.mlx-sidebar--filters .mlx-filter-panel {
  display: flex !important;
  border: none;
  border-radius: 0;
  padding: 0;
  flex-direction: column;
}
.mlx-sidebar--filters .mlx-filter-toggle { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   FILTER GROUP (each filter block: price, category, attribute)
══════════════════════════════════════════════════════════════════ */
.mlx-filter-group { min-width: 160px; flex: 0 0 auto; }

.mlx-filter-group__title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--mlx-text-subtle, #888);
  margin: 0 0 .75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   PRICE RANGE SLIDER (dual thumb, pure CSS)
══════════════════════════════════════════════════════════════════ */
.mlx-price-slider { position: relative; width: 200px; padding: .5rem 0 0; }

.mlx-price-slider__track {
  position: relative;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 8px 0;
}

.mlx-price-slider__range {
  position: absolute;
  height: 100%;
  background: var(--mlx-color-primary, #0a0a0a);
  border-radius: 2px;
}

/* Both range inputs stacked on the same track */
.mlx-price-slider__input {
  position: absolute;
  width: 100%;
  height: 4px;
  top: 8px; /* aligns with track */
  left: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.mlx-price-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--mlx-bg-card, #fff);
  border: 2px solid var(--mlx-color-primary, #0a0a0a);
  cursor: pointer;
  pointer-events: all;
  transition: border-color .2s, transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.mlx-price-slider__input::-webkit-slider-thumb:hover { transform: scale(1.15); }

.mlx-price-slider__input::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--mlx-bg-card, #fff);
  border: 2px solid var(--mlx-color-primary, #0a0a0a);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.mlx-price-slider__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8125rem;
  font-weight: 500;
  margin-top: .625rem;
  color: var(--mlx-text-muted, #444);
}

/* ═══════════════════════════════════════════════════════════════════
   FILTER LIST (categories + attributes)
══════════════════════════════════════════════════════════════════ */
.mlx-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--mlx-border,#ddd) var(--mlx-bg-subtle,#f5f5f5);
}

.mlx-filter-checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .8125rem;
  color: var(--mlx-text-muted, #444);
  line-height: 1.3;
  transition: color .15s;
}
.mlx-filter-checkbox:hover { color: var(--mlx-color-primary, #0a0a0a); }
.mlx-filter-checkbox input { display: none; }

/* Custom checkbox box */
.mlx-filter-checkbox__box {
  flex-shrink: 0;
  width: 16px; height: 16px;
  border: 1.5px solid #bbb;
  border-radius: 3px;
  background: #fff;
  position: relative;
  transition: border-color .15s, background .15s;
}
.mlx-filter-checkbox input:checked ~ .mlx-filter-checkbox__box {
  background: var(--mlx-color-primary, #0a0a0a);
  border-color: var(--mlx-color-primary, #0a0a0a);
}
.mlx-filter-checkbox input:checked ~ .mlx-filter-checkbox__box::after {
  content: '';
  position: absolute;
  left: 3px; top: 1px;
  width: 7px; height: 10px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* Color swatch checkbox */
.mlx-filter-checkbox__swatch {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.1);
  position: relative;
}
.mlx-filter-checkbox input:checked ~ .mlx-filter-checkbox__swatch {
  outline: 2px solid var(--mlx-color-primary, #0a0a0a);
  outline-offset: 2px;
}

.mlx-filter-checkbox__count { color: var(--mlx-text-subtle,#aaa); margin-left: auto; flex-shrink: 0; font-size: .75rem; }

/* ═══════════════════════════════════════════════════════════════════
   FILTER ACTIONS
══════════════════════════════════════════════════════════════════ */
.mlx-filter-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-top: 1.5rem;
  margin-top: auto;
  align-self: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════
   ACTIVE FILTER CHIPS
══════════════════════════════════════════════════════════════════ */
.mlx-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  min-height: 28px;
  margin-bottom: .75rem;
}

.mlx-active-filters__label {
  font-size: .8125rem;
  color: var(--mlx-text-subtle, #888);
  flex-shrink: 0;
}

.mlx-active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .3125rem .6875rem;
  background: var(--mlx-color-primary, #0a0a0a);
  color: #fff;
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s, transform .12s;
}
.mlx-active-filter-chip:hover {
  background: var(--mlx-color-accent, #e84545);
  transform: scale(1.03);
}

.mlx-active-filter-chip__remove {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.mlx-active-filter-chip__remove:hover { color: #fff; }

.mlx-active-filters__clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .8125rem;
  color: var(--mlx-color-accent, #e84545);
  text-decoration: underline;
  padding: 0;
  margin-left: .25rem;
}

/* ═══════════════════════════════════════════════════════════════════
   PRODUCTS WRAPPER — loading state
══════════════════════════════════════════════════════════════════ */
.mlx-products-wrapper {
  position: relative;
  min-height: 200px;
  transition: opacity .25s ease;
}
.mlx-products-wrapper.is-loading {
  opacity: .4;
  pointer-events: none;
}
.mlx-products-wrapper.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.5);
  z-index: 10;
  border-radius: 8px;
}

.mlx-no-products {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--mlx-text-subtle, #888);
  font-size: 1rem;
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════════
   LOAD MORE
══════════════════════════════════════════════════════════════════ */
.mlx-load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.mlx-load-more-btn {
  min-width: 200px;
}

.mlx-load-more-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Infinite scroll trigger (invisible sentinel) */
.mlx-infinite-trigger {
  height: 1px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .mlx-filter-toggle { display: inline-flex; }

  .mlx-filter-panel {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    margin-top: .5rem;
  }
  .mlx-filter-panel.is-open { display: flex; }

  .mlx-filter-group  { min-width: unset; width: 100%; }
  .mlx-price-slider  { width: 100%; }
  .mlx-filter-actions { flex-direction: row; padding-top: 0; }
  .mlx-filter-list   { max-height: 160px; }
}

@media (max-width: 479px) {
  .mlx-filter-actions { flex-direction: column; }
  .mlx-active-filters { gap: .35rem; }
}
