.aid-epf,
.aid-epf * {
  box-sizing: border-box;
}

.aid-epf {
  --aid-epf-border: #e5e7eb;
  --aid-epf-text: #111827;
  --aid-epf-muted: #6b7280;
  --aid-epf-bg: #ffffff;
  --aid-epf-soft: #f8fafc;
  --aid-epf-accent: #1d4ed8;
  --aid-epf-radius: 14px;
  color: var(--aid-epf-text);
  font-size: 14px;
  line-height: 1.4;
}

.aid-epf-desktop-sticky .aid-epf-panel {
  position: sticky;
  top: var(--aid-epf-sticky-offset, 96px);
}

.aid-epf-panel {
  background: var(--aid-epf-bg);
  border: 1px solid var(--aid-epf-border);
  border-radius: var(--aid-epf-radius);
  overflow: hidden;
}

.aid-epf-title {
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--aid-epf-border);
  font-size: 18px;
  font-weight: 700;
}

.aid-epf-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--aid-epf-border);
  font-size: 18px;
}

.aid-epf-close {
  border: 0;
  background: transparent;
  color: var(--aid-epf-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.aid-epf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px 4px;
}

.aid-epf-chips-empty {
  display: none;
}

.aid-epf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--aid-epf-border);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--aid-epf-soft);
  color: var(--aid-epf-text);
  text-decoration: none;
  font-size: 12px;
}

.aid-epf-chip:hover,
.aid-epf-chip:focus {
  border-color: var(--aid-epf-accent);
  color: var(--aid-epf-accent);
}

.aid-epf-chip-reset {
  background: #fff;
  color: var(--aid-epf-accent);
  font-weight: 600;
}

.aid-epf-sections {
  padding: 8px 0;
}

.aid-epf-section {
  border-top: 1px solid var(--aid-epf-border);
}

.aid-epf-section:first-child {
  border-top: 0;
}

.aid-epf-section-title {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: #fff;
  color: var(--aid-epf-text);
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.aid-epf-section-title svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform .18s ease;
}

.aid-epf-section-title[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.aid-epf-section-content {
  padding: 0 12px 14px;
}

.aid-epf-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aid-epf-children {
  margin-left: 22px;
  padding-left: 10px;
  border-left: 1px solid var(--aid-epf-border);
}

.aid-epf-item-row,
.aid-epf-filter-link {
  display: flex;
  align-items: center;
  min-width: 0;
}

.aid-epf-item-row {
  gap: 2px;
}

.aid-epf-filter-link {
  flex: 1 1 auto;
  gap: 8px;
  padding: 7px 4px;
  color: var(--aid-epf-text);
  text-decoration: none;
  border-radius: 9px;
}

.aid-epf-filter-link:hover,
.aid-epf-filter-link:focus {
  background: var(--aid-epf-soft);
  color: var(--aid-epf-accent);
}

.aid-epf-box {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
}

.aid-epf-item.is-selected > .aid-epf-filter-link .aid-epf-box,
.aid-epf-item.is-selected > .aid-epf-item-row .aid-epf-box {
  background: var(--aid-epf-accent);
  border-color: var(--aid-epf-accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.aid-epf-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aid-epf-count {
  margin-left: auto;
  min-width: 24px;
  color: var(--aid-epf-muted);
  font-size: 12px;
  text-align: right;
}

.aid-epf-tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--aid-epf-muted);
  cursor: pointer;
}

.aid-epf-tree-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform .18s ease;
}

.aid-epf-item.is-open > .aid-epf-item-row .aid-epf-tree-toggle svg {
  transform: rotate(90deg);
}

.aid-epf-term-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--aid-epf-border);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 10px;
}

.aid-epf-more {
  display: inline-flex;
  align-items: center;
  margin: 4px 0 0 28px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--aid-epf-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  text-decoration: none;
  opacity: .62;
}

.aid-epf-more:hover,
.aid-epf-more:focus-visible {
  color: var(--aid-epf-accent);
  opacity: .9;
}

.aid-epf-more .aid-epf-more-close,
.aid-epf-more.is-open .aid-epf-more-open {
  display: none;
}

.aid-epf-more.is-open .aid-epf-more-close {
  display: inline;
}

.aid-epf-price-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.aid-epf-price-fields label {
  display: grid;
  gap: 5px;
  color: var(--aid-epf-muted);
  font-size: 12px;
}

.aid-epf-price-fields input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--aid-epf-border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--aid-epf-text);
}

.aid-epf-price-range {
  display: grid;
  gap: 8px;
}

.aid-epf-price-range input[type="range"] {
  width: 100%;
}

.aid-epf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--aid-epf-border);
}

.aid-epf-reset,
.aid-epf-apply,
.aid-epf-open-button {
  min-height: 42px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.aid-epf-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--aid-epf-border);
  color: var(--aid-epf-text);
  background: #fff;
}

.aid-epf-apply {
  flex: 1 1 auto;
  border: 0;
  background: var(--aid-epf-accent);
  color: #fff;
  cursor: pointer;
  padding: 0 18px;
}

.aid-epf-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--aid-epf-border, #e5e7eb);
  background: #fff;
  color: var(--aid-epf-text, #111827);
  padding: 0 16px;
  cursor: pointer;
}

.aid-epf-open-icon svg {
  width: 20px;
  height: 20px;
}

.aid-epf-overlay {
  display: none;
}

.aid-epf-loading,
.aid-epf-error {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.aid-epf-is-loading {
  cursor: progress;
}

@media (max-width: 900px) {
  .aid-epf-mobile-drawer .aid-epf-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    z-index: 999999;
    border-radius: 0;
    transform: translateX(104%);
    transition: transform .22s ease;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .aid-epf-drawer-open .aid-epf-mobile-drawer .aid-epf-panel {
    transform: translateX(0);
  }

  .aid-epf-mobile-drawer .aid-epf-mobile-head {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }

  .aid-epf-mobile-drawer + .aid-epf-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  .aid-epf-drawer-open .aid-epf-mobile-drawer + .aid-epf-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .aid-epf-mobile-drawer .aid-epf-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
  }

  body.aid-epf-drawer-open {
    overflow: hidden;
  }
}

/* JS-controlled breakpoint fallback. This honors the breakpoint configured in WooCommerce > Enterprise Filters. */
.aid-epf-viewport-mobile .aid-epf-mobile-drawer .aid-epf-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  z-index: 999999;
  border-radius: 0;
  transform: translateX(104%);
  transition: transform .22s ease;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.aid-epf-viewport-mobile.aid-epf-drawer-open .aid-epf-mobile-drawer .aid-epf-panel {
  transform: translateX(0);
}

.aid-epf-viewport-mobile .aid-epf-mobile-drawer .aid-epf-mobile-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.aid-epf-viewport-mobile .aid-epf-mobile-drawer + .aid-epf-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.aid-epf-viewport-mobile.aid-epf-drawer-open .aid-epf-mobile-drawer + .aid-epf-overlay {
  opacity: 1;
  pointer-events: auto;
}

.aid-epf-viewport-mobile .aid-epf-mobile-drawer .aid-epf-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 2;
}

/* v2.1 layout variants */
.aid-epf-auto-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.aid-epf-auto-controls .aid-epf-chips {
  padding: 0;
  flex: 1 1 auto;
}

.aid-epf-style-flat .aid-epf-panel {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
}

.aid-epf-style-flat .aid-epf-section-title {
  background: transparent;
}

.aid-epf-style-compact {
  font-size: 13px;
}

.aid-epf-style-compact .aid-epf-section-title {
  padding: 10px 12px;
}

.aid-epf-style-compact .aid-epf-section-content {
  padding: 0 10px 10px;
}

.aid-epf-style-compact .aid-epf-filter-link {
  padding: 5px 3px;
}

.aid-epf-more[hidden] {
  display: none !important;
}

.aid-epf-category-item.is-active-path > .aid-epf-item-row .aid-epf-name {
  font-weight: 700;
}
