/* GFSelect — Custom dropdown wrapper around native <select>.
   Alinha com o design do avatar-hub unit toggle (button + panel com animação). */

.gf-select {
  position: relative;
  width: 100%;
}

.gf-select__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.gf-select__toggle {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--gf-field-min-height, 44px);
  padding: 0.65rem 1rem;
  background: var(--gf-field-bg, #ffffff);
  border: 1.5px solid var(--gf-field-border, rgba(15, 23, 42, 0.16));
  border-radius: 14px;
  color: var(--gf-color-neutral-900, #0f172a);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.gf-select__toggle:hover {
  border-color: var(--gf-field-border-hover, rgba(15, 23, 42, 0.3));
}

.gf-select__toggle:focus-visible,
.gf-select.is-open .gf-select__toggle {
  outline: none;
  border-color: var(--gf-color-brand, #2e7d32);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18);
}

.gf-select__label {
  flex: 1 1 auto;
  text-align: left;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-select__chevron {
  font-size: 20px;
  color: var(--gf-color-neutral-500, #64748b);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.gf-select.is-open .gf-select__chevron {
  transform: rotate(180deg);
}

.gf-select__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 40;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.22s linear;
}

.gf-select.is-open .gf-select__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.gf-select__item {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  color: var(--gf-color-neutral-900, #0f172a);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.gf-select__item:hover,
.gf-select__item:focus-visible {
  background-color: rgba(46, 125, 50, 0.08);
  color: var(--gf-color-brand, #2e7d32);
}

.gf-select__item.is-active {
  background-color: rgba(46, 125, 50, 0.12);
  color: var(--gf-color-brand, #2e7d32);
}

.gf-select__item[disabled] {
  color: var(--gf-color-neutral-500, #94a3b8);
  cursor: not-allowed;
  opacity: 0.7;
}

.gf-select__item-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-select__item-check {
  font-size: 18px;
  color: var(--gf-color-brand, #2e7d32);
  flex-shrink: 0;
}

/* Badge opcional (data-badge na <option>) — pill com a abreviação,
   mesmo vocabulário do seletor de unidade do header. */
.gf-select__item-badge,
.gf-select__badge {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 0.375rem;
  background: rgba(15, 23, 42, 0.07);
  color: var(--gf-color-neutral-600, #475569);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.gf-select__item.is-active .gf-select__item-badge {
  background: rgba(46, 125, 50, 0.14);
  color: var(--gf-color-brand, #2e7d32);
}

/* Scrollbar theming inside the panel */
.gf-select__panel::-webkit-scrollbar {
  width: 6px;
}

.gf-select__panel::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 3px;
}

.gf-select__panel::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.25);
}
