/* ============ POPUP NÂNG CAO ============ */
#wpr-advanced-filter {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;                /* chiếm toàn màn hình */
  background: rgba(0, 0, 0, 0.45);
  display: flex;                /* bật flex container */
  justify-content: center;      /* căn giữa ngang */
  align-items: center;          /* căn giữa dọc */
  z-index: 9999;
  opacity: 0;                   /* mặc định ẩn */
  pointer-events: none;         /* không tương tác khi ẩn */
  transition: opacity 0.2s ease;
}

#wpr-advanced-filter.show {
  opacity: 1;
  pointer-events: auto;         /* bật tương tác khi show */
}

#wpr-advanced-filter .popup-inner {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#wpr-advanced-filter.show .popup-inner {
  transform: scale(1);
  opacity: 1;
}

/* Tiêu đề popup */
.wpr-filter-popup h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}

/* Các item trong popup */
.filter-item { margin-bottom: 12px; }

/* Thanh action */
.filter-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.filter-actions button {
  flex: 1;
  margin: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wpr-popup-reset { background: #f3f3f3; }
.wpr-popup-reset:hover { background: #e0e0e0; }

.wpr-popup-apply { background: #0073aa; color: #fff; }
.wpr-popup-apply:hover { background: #005f8d; }

/* Switch nhỏ */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 2px; bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: .4s;
}
input:checked + .slider {
  background-color: #0073aa;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Nút mở popup trong hàng filter */
.wpr-filter-row .wpr-open-popup {
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0073aa;
    color: #fff;
    border-radius: 6px;
    border: 1px solid #0073aa;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.wpr-filter-row .wpr-open-popup:hover {
    background: #005f8d;
}

.wpr-filter-row .wpr-open-popup svg {
    width: 20px;
    height: 20px;
}
