/* nes-busca-frontal.css — Campo de busca fixo na faixa frontal do paciente */

/* ─── WIDGET CONTAINER ─────────────────────────────────────────────────────── */

#nes-busca-frontal-widget {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 16px;
  background: var(--white, #fff);
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  flex-wrap: wrap;
}

/* ─── INPUT WRAP ────────────────────────────────────────────────────────────── */

.nbf-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nbf-icon {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  color: var(--gray-400, #9ca3af);
  pointer-events: none;
  flex-shrink: 0;
}

.nbf-input {
  width: 230px;
  height: 34px;
  padding: 0 10px 0 30px;
  font-size: 0.8rem;
  font-family: inherit;
  border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: 8px;
  background: var(--white, #fff);
  color: var(--navy-800, #1e293b);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.nbf-input:focus {
  border-color: var(--blue-400, #60a5fa);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.nbf-input::placeholder {
  color: var(--gray-400, #9ca3af);
  font-size: 0.76rem;
}

/* remove browser's native X in search inputs */
.nbf-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ─── TROCAR PACIENTE ───────────────────────────────────────────────────────── */

.nbf-trocar {
  font-size: 0.78rem !important;
  padding: 4px 10px !important;
  height: 34px !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── DROPDOWN ──────────────────────────────────────────────────────────────── */

#nes-busca-frontal-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
  z-index: 9999;
  overscroll-behavior: contain;
}

/* ─── ITENS DO DROPDOWN ─────────────────────────────────────────────────────── */

.nbf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
  transition: background 0.1s;
}

.nbf-item:last-child {
  border-bottom: none;
}

.nbf-item:hover,
.nbf-item:focus {
  background: var(--blue-50, #eff6ff);
  outline: none;
}

.nbf-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400, #60a5fa), var(--teal-end, #2dd4bf));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.nbf-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nbf-nome {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy-800, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nbf-meta {
  font-size: 0.72rem;
  color: var(--gray-500, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.nbf-empty {
  padding: 16px;
  font-size: 0.82rem;
  color: var(--gray-400, #9ca3af);
  text-align: center;
}

/* ─── MOBILE ────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .nbf-input {
    width: 160px;
  }
}

@media (max-width: 680px) {
  #nes-busca-frontal-widget {
    margin-left: 0;
    width: 100%;
    margin-top: 0.4rem;
  }

  .nbf-input {
    width: 100%;
    flex: 1;
  }

  .nbf-search-wrap {
    flex: 1;
  }

  .nbf-trocar {
    display: none;
  }

  #nes-busca-frontal-dropdown {
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 24px);
    max-width: 420px;
    max-height: 55vh;
  }
}
