/* ── FP-SELECT — кастомные popover-дропдауны для нативных <select> ── */
.fp-dd { position: relative; }
.fp-trigger {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .18s, box-shadow .18s;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.fp-trigger::after {
  content: '▾';
  font-size: .65rem;
  color: var(--gray);
  flex-shrink: 0;
  transition: transform .18s;
}
.fp-dd.open .fp-trigger::after { transform: rotate(180deg); }
.fp-trigger:hover { border-color: var(--blue-mid); }
.fp-dd.open .fp-trigger { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,93,160,.12); }
.fp-trigger.has-value { color: var(--blue); font-weight: 700; }
.fp-trigger.has-value::after { color: var(--blue); }
.fp-trigger:disabled { background: var(--gray-light); cursor: not-allowed; opacity: .65; }

.fp-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.16);
  z-index: 1000;
  overflow: hidden;
}
.fp-dd.open { z-index: 999; }
.fp-dd.open .fp-panel { display: block; }

.fp-list { max-height: 280px; overflow-y: auto; padding: 6px; }
.fp-empty { padding: 14px; font-size: .85rem; color: var(--gray); text-align: center; }
.fp-divider { height: 1px; background: var(--gray-border); margin: 4px 8px; }
.fp-group-head {
  padding: 6px 12px 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray);
  letter-spacing: .5px;
}
.fp-item {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text);
  transition: background .12s;
  user-select: none;
}
.fp-item:hover { background: var(--gray-light); }
.fp-item.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }

.fp-backdrop { display: none; }

@media (max-width: 640px) {
  .fp-panel {
    position: fixed;
    top: 50%; left: 50%; right: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 420px;
    min-width: 0;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1100;
  }
  .fp-dd.open .fp-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1099;
    animation: fpFadeIn .18s ease;
  }
  body.fp-active { overflow: hidden; }
}
@keyframes fpFadeIn { from { opacity: 0 } to { opacity: 1 } }
