/* BFMS (CSV Values) - ACF/select2-ish frontend styling */

select.bfms-select.bfms-hidden-select {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.bfms-wrap { position: relative; width: 100%; }

.bfms-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #fff;
  cursor: text;
}

.bfms-wrap:focus-within .bfms-control {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.bfms-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.bfms-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 2px;
  border: 1px solid #c3c4c7;
  background: #f0f0f1;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.2;
}

.bfms-tag-x {
  all: unset;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  color: #50575e;
}
.bfms-tag-x:hover { color: #1d2327; }

.bfms-tag-label { white-space: nowrap; }

.bfms-input {
  border: none;
  outline: none;
  font-size: 14px;
  min-width: 120px;
  flex: 1 1 120px;
  padding: 2px 0;
  background: transparent;
}
.bfms-wrap:not(.is-empty) .bfms-input::placeholder { color: transparent; }

.bfms-caret {
  all: unset;
  cursor: pointer;
  margin-left: auto;
  padding: 2px 4px;
  color: #50575e;
  user-select: none;
}
.bfms-caret:hover { color: #1d2327; }

.bfms-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  max-height: 260px;
  overflow: auto;
  z-index: 9999;
  display: none;
}
.bfms-wrap.is-open .bfms-dropdown { display: block; }

.bfms-list { display: flex; flex-direction: column; }

.bfms-item {
  all: unset;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.bfms-item:hover { background: #f6f7f7; }
.bfms-item.is-selected { background: #f0f6fc; }
.bfms-item.is-selected .bfms-label { font-weight: 600; }

.bfms-check {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2271b1;
}

.bfms-empty { padding: 10px 12px; color: #50575e; font-size: 13px; }
