/* Beymen-style filter overlay */
.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
}
.fx-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.fx-overlay__form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.fx-overlay__head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.fx-overlay__head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fx-overlay__brand {
  font-size: 13px;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.fx-overlay__head-center {
  text-align: center;
}
.fx-overlay__cat {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.fx-overlay__cat span {
  font-weight: 500;
  color: #777;
  font-size: 0.9em;
}
.fx-overlay__crumb {
  margin: 2px 0 0;
  font-size: 12px;
  color: #888;
}
.fx-overlay__close {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: #111;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}
.fx-overlay__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.fx-overlay__rail {
  border-right: 1px solid #eee;
  overflow: auto;
  background: #f7f7f7;
}
.fx-overlay__toggles {
  padding: 18px 18px 8px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.fx-overlay__rail-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
}
.fx-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  cursor: pointer;
}
.fx-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fx-toggle__ui {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d0d0d0;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.fx-toggle__ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.fx-toggle input:checked + .fx-toggle__ui {
  background: #111;
}
.fx-toggle input:checked + .fx-toggle__ui::after {
  transform: translateX(18px);
}
.fx-overlay__nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.fx-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #111;
  cursor: pointer;
}
.fx-nav__item.is-active {
  background: #ebebeb;
}
.fx-nav__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fx-overlay__main {
  position: relative;
  overflow: auto;
  background: #fff;
  min-height: 0;
}
.fx-panel {
  display: none;
  padding: 20px 24px 32px;
}
.fx-panel.is-active { display: block; }
.fx-panel__search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  padding: 0 14px;
  min-height: 44px;
  margin-bottom: 18px;
}
.fx-panel__search input {
  border: 0;
  outline: none;
  width: 100%;
  font: inherit;
  font-size: 14px;
  background: transparent;
}
.fx-panel__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 18px;
}
.fx-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-size: 14px;
  cursor: pointer;
}
.fx-check input {
  width: 16px;
  height: 16px;
  accent-color: #111;
  flex-shrink: 0;
}
.fx-check--all {
  grid-column: 1 / -1;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #eee;
  margin-bottom: 6px;
  padding-bottom: 8px;
}
.fx-check.is-hidden { display: none; }
.fx-empty {
  color: #777;
  font-size: 14px;
  margin: 24px 0;
}
.fx-overlay__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eee;
  flex-shrink: 0;
  background: #fff;
}
.fx-overlay__result {
  margin: 0;
  font-size: 14px;
  color: #333;
}
.fx-overlay__apply {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.fx-overlay__apply-mobile { display: none; }
body.fx-open { overflow: hidden; }

.fx-overlay__title-mobile { display: none; margin: 0; font-size: 16px; font-weight: 500; }
.fx-overlay__close--mobile { display: none; }

@media (max-width: 959px) {
  .fx-overlay__head {
    grid-template-columns: 44px 1fr 44px;
    min-height: 52px;
    padding: 6px 8px;
  }
  .fx-overlay__head-left,
  .fx-overlay__cat,
  .fx-overlay__crumb,
  .fx-overlay__close--desktop {
    display: none !important;
  }
  .fx-overlay__close--mobile {
    display: inline-flex;
    border: 0;
    background: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
  }
  .fx-overlay__title-mobile { display: block; }
  .fx-overlay__head-center { text-align: center; }
  .fx-overlay__body {
    display: flex;
    flex-direction: column;
  }
  .fx-overlay__rail {
    display: contents;
  }
  .fx-overlay__toggles {
    order: 1;
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0;
  }
  .fx-overlay__rail-label { display: none; }
  .fx-toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid #e5e5e5;
  }
  .fx-overlay__nav {
    order: 2;
    flex-direction: row;
    overflow-x: auto;
    border-bottom: 1px solid #eee;
    background: #f3f3f3;
    padding: 0;
  }
  .fx-nav__item {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 13px;
    border-bottom: 2px solid transparent;
  }
  .fx-nav__item.is-active {
    background: #fff;
    border-bottom-color: #111;
  }
  .fx-overlay__main {
    order: 3;
    flex: 1;
  }
  .fx-panel {
    padding: 14px 14px 24px;
  }
  .fx-panel__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .fx-check {
    min-height: 48px;
    border-bottom: 1px solid #eee;
  }
  .fx-overlay__foot {
    justify-content: stretch;
    padding: 0;
  }
  .fx-overlay__result { display: none; }
  .fx-overlay__apply {
    width: 100%;
    border-radius: 0;
    min-height: 54px;
  }
  .fx-overlay__apply-desktop { display: none; }
  .fx-overlay__apply-mobile { display: inline; }
}

@media (min-width: 960px) and (max-width: 1199px) {
  .fx-panel__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fx-overlay__body {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}
