/* Trade directory advanced-filter modal. Kept separate from the core directory
 * stylesheet so the overlay can evolve without changing Trade cards/maps/forms. */
.pxab-trades-search__actions{
  display:grid;
  grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr);
  gap:10px;
  align-items:stretch;
  margin-top:12px;
}
.pxab-trades-search__actions .pxab-trades-search__submit{
  grid-column:auto;
  width:100%;
  min-height:48px;
  margin:0;
}
.pxab-trades-search__filters-open{
  width:100%;
  min-width:0;
  min-height:48px;
  position:relative;
}
.pxab-trades-search__filter-count{
  display:inline-grid;
  min-width:22px;
  height:22px;
  place-items:center;
  padding:0 6px;
  border-radius:999px;
  background:var(--pxab-trades-btn-secondary-text);
  color:var(--pxab-trades-btn-secondary-bg);
  font-size:.72rem;
  font-weight:850;
  line-height:1;
}
.pxab-trades-search__filter-count[hidden]{display:none!important}

.pxab-trades-filter-modal[hidden]{display:none!important}
.pxab-trades-filter-modal{
  position:fixed;
  inset:0;
  z-index:100500;
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  padding:clamp(12px,2.4vw,24px);
  color:var(--pxab-trades-public-text,var(--pxab-trades-ink,#17232c));
}
.pxab-trades-filter-modal__overlay{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.48);
  -webkit-backdrop-filter:blur(2px);
  backdrop-filter:blur(2px);
}
.pxab-trades-filter-modal__dialog{
  position:relative;
  z-index:1;
  display:flex;
  width:min(780px,calc(100vw - 24px));
  max-height:min(820px,calc(100vh - 24px));
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--pxab-trades-border,#dce4e9);
  border-radius:24px;
  background:#fff;
  box-shadow:0 30px 90px rgba(15,23,42,.28);
  outline:0;
}
.pxab-trades-filter-modal__header,
.pxab-trades-filter-modal__footer{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  background:#fff;
}
.pxab-trades-filter-modal__header{
  display:grid;
  grid-template-columns:38px minmax(0,1fr) 38px;
  border-bottom:1px solid var(--pxab-trades-border,#dce4e9);
}
.pxab-trades-filter-modal__header h2{
  margin:0;
  color:var(--pxab-trades-public-heading,var(--pxab-trades-ink,#17232c));
  font-size:1.16rem;
  line-height:1.25;
  text-align:center;
}
.pxab-trades-filter-modal__header-spacer{width:38px;height:38px}
.pxab-trades-filter-modal__close{
  appearance:none;
  display:inline-flex;
  width:38px;
  height:38px;
  min-width:38px;
  padding:0;
  align-items:center;
  justify-content:center;
  border:1px solid var(--pxab-trades-border,#dce4e9)!important;
  border-radius:999px;
  background:var(--pxab-trades-soft,#f4f7f8)!important;
  color:var(--pxab-trades-ink,#17232c)!important;
  cursor:pointer;
}
.pxab-trades-filter-modal__close:hover,
.pxab-trades-filter-modal__close:focus-visible{
  border-color:var(--pxab-trades-accent,#1f6f8b)!important;
  background:#fff!important;
  color:var(--pxab-trades-accent,#1f6f8b)!important;
}
.pxab-trades-filter-modal__close:focus:not(:focus-visible){
  border-color:var(--pxab-trades-border,#dce4e9)!important;
  background:var(--pxab-trades-soft,#f4f7f8)!important;
  color:var(--pxab-trades-ink,#17232c)!important;
  outline:0;
}
.pxab-trades-filter-modal__close:active{
  border-color:var(--pxab-trades-accent,#1f6f8b)!important;
  background:#fff!important;
  color:var(--pxab-trades-accent,#1f6f8b)!important;
}
.pxab-trades-filter-modal__close:focus-visible,
.pxab-trades-filter-modal__dialog:focus-visible{
  outline:3px solid color-mix(in srgb,var(--pxab-trades-accent,#1f6f8b) 26%,transparent);
  outline-offset:2px;
}
.pxab-trades-filter-modal__close .pxab-icon{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
}
.pxab-trades-filter-modal__body{
  min-height:0;
  padding:18px;
  overflow:auto;
  overscroll-behavior:contain;
}
.pxab-trades-filter-modal .pxab-trades-search__advanced{
  padding-top:0;
}
.pxab-trades-filter-modal .pxab-trades-search__checks{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--pxab-trades-border,#dce4e9);
}
.pxab-trades-filter-modal input:not([type="checkbox"]):not([type="hidden"]),
.pxab-trades-filter-modal select{
  box-sizing:border-box;
  width:100%;
  min-height:46px;
  border:1px solid var(--pxab-trades-border-strong,#c9d5dc);
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
  color:inherit;
  font:inherit;
}
.pxab-trades-filter-modal input:focus,
.pxab-trades-filter-modal select:focus{
  border-color:var(--pxab-trades-accent,#1f6f8b);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--pxab-trades-accent,#1f6f8b) 16%,transparent);
  outline:0;
}
.pxab-trades-filter-modal .pxab-trades-search__check input{
  width:20px;
  height:20px;
  min-height:0;
  margin:0;
  flex:0 0 auto;
  accent-color:var(--pxab-trades-accent,#1f6f8b);
}
.pxab-trades-filter-modal__footer{
  justify-content:space-between;
  border-top:1px solid var(--pxab-trades-border,#dce4e9);
}
.pxab-trades-filter-modal__footer .pxab-trades-button{
  min-width:150px;
}
.pxab-trades-filter-modal__clear{
  appearance:none;
  border:0!important;
  padding:8px 2px;
  background:transparent!important;
  color:var(--pxab-trades-public-link,var(--pxab-trades-link,var(--pxab-trades-ink,#17232c)))!important;
  font:inherit;
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
  cursor:pointer;
}
.pxab-trades-filter-modal__clear:hover,
.pxab-trades-filter-modal__clear:focus-visible,
.pxab-trades-filter-modal__clear:active{background:transparent!important;color:var(--pxab-trades-public-link-hover,var(--pxab-trades-link-hover,var(--pxab-trades-public-link,var(--pxab-trades-link,var(--pxab-trades-accent,#1f6f8b)))))!important}
.pxab-trades-filter-modal__clear:focus:not(:focus-visible){background:transparent!important;color:var(--pxab-trades-public-link,var(--pxab-trades-link,var(--pxab-trades-ink,#17232c)))!important;outline:0}

@media(max-width:680px){
  .pxab-trades-search__actions{grid-template-columns:1fr}
  .pxab-trades-filter-modal{align-items:flex-end;padding:10px}
  .pxab-trades-filter-modal__dialog{
    width:100%;
    max-height:min(88vh,820px);
    border-radius:22px 22px 16px 16px;
  }
  .pxab-trades-filter-modal__header,
  .pxab-trades-filter-modal__body,
  .pxab-trades-filter-modal__footer{padding:14px}
  .pxab-trades-filter-modal__footer{align-items:stretch;flex-direction:column-reverse}
  .pxab-trades-filter-modal__footer .pxab-trades-button{width:100%;min-width:0}
  .pxab-trades-filter-modal__clear{align-self:center}
}
@media(prefers-reduced-motion:reduce){
  .pxab-trades-filter-modal__dialog{scroll-behavior:auto}
}
@media(forced-colors:active){
  .pxab-trades-filter-modal__dialog,
  .pxab-trades-filter-modal__close{border:1px solid CanvasText}
  .pxab-trades-filter-modal__overlay{background:Canvas}
}

/* Trade-only page locking keeps background position stable without extending
 * the shared overlay runtime or changing another feature's scroll behaviour. */
html.pxab-trades-filter-scroll-locked,
body.pxab-trades-filter-scroll-locked{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.pxab-trades-filter-scroll-locked{
  position:fixed!important;
  left:0!important;
  right:0!important;
  width:100%!important;
}
.pxab-trades-search__primary{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:680px){.pxab-trades-search__primary{grid-template-columns:1fr}}

/* Trade distance/geolocation validation uses the shared inline warning language
 * while keeping its footprint scoped to the filter modal. */
.pxab-trades-filter-modal .pxab-trades-search__location-warning:not([hidden]){
  display:block;
  width:100%;
  margin:2px 0 0;
}
