/* ==========================================================================
   Cabeçalho (Header): Navegação do Explorer, Barra de Endereço, Busca e Usuário
   ========================================================================== */

.head {
  height: var(--head);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  flex: none;
  min-width: 0;
  background: var(--ground);
  border-bottom: 1px solid var(--line-soft);
  z-index: 20;
}

/* Botões de Navegação Histórica do Explorer (Voltar, Avançar, Subir, Recarregar) */
.nav-arrows {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: none;
}

.nav-arrow-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-pill);
  color: var(--ink-mid);
  font-size: 15px;
  transition: all 0.1s;
}

.nav-arrow-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}

.nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Barra de Endereço / Breadcrumb Interativo */
.address-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.6rem;
  min-width: 0;
  max-width: 32rem;
  flex: 1 1 auto;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}

.address-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.address-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--accent);
  margin-left: 0.25rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.crumb {
  padding: 0.25rem 0.5rem;
  border-radius: var(--r);
  color: var(--ink-mid);
  font-size: 13.5px;
  font-weight: 450;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.1s;
}

.crumb:hover:not(.cur) {
  background: var(--hover);
  color: var(--ink);
}

.crumb.cur {
  color: var(--ink);
  font-weight: 600;
  cursor: default;
}

.sep {
  color: var(--ink-faint);
  flex: none;
  font-size: 12px;
  padding: 0 0.05rem;
  user-select: none;
}

.copy-path-btn {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: var(--r-sm);
  color: var(--ink-faint);
  font-size: 12px;
  flex: none;
  margin-left: auto;
}

.copy-path-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

/* Caixa de Busca Global */
.search {
  position: relative;
  flex: 1 1 20rem;
  max-width: 36rem;
  min-width: 12rem;
}

.search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.6rem 2.2rem 0.6rem 2.5rem;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.search input::placeholder {
  color: var(--ink-faint);
}

.search input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.search .mag {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mid);
  font-size: 15px;
  pointer-events: none;
}

.search .clear-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--r-pill);
  color: var(--ink-faint);
  font-size: 12px;
  display: none;
}

.search input:not(:placeholder-shown) ~ .clear-btn {
  display: inline-flex;
}

.search .clear-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

/* Ações à Direita: Tema, Usuário, Sair */
.head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: none;
}

.theme-toggle-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--r-pill);
  color: var(--ink-mid);
  font-size: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink-mid);
  max-width: 14rem;
}

.user-avatar {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink-inverted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex: none;
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.burger {
  display: none;
}
