@use 'variables' as v;
@use 'mixins' as m;

// ─────────────────────────────────────────────
// Topbar shell
// ─────────────────────────────────────────────
.topbar {
  @include m.flex-between;
  height: v.$topbar-height;
  padding: 0 20px;
  background: v.$white;
  border-bottom: 1px solid v.$border-color;
  position: sticky;
  top: 0;
  z-index: v.$z-topbar;
  gap: 16px;
  flex-shrink: 0;
}

// ─────────────────────────────────────────────
// Left: hamburger + breadcrumb
// ─────────────────────────────────────────────
.topbar-left {
  @include m.flex-start;
  gap: 12px;
  min-width: 0;
}

.topbar-toggle {
  @include m.flex-center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: v.$radius;
  color: v.$gray-500;
  cursor: pointer;
  transition: background v.$transition-base, color v.$transition-base;
  flex-shrink: 0;

  &:hover { background: v.$gray-100; color: v.$gray-700; }

  svg { width: 20px; height: 20px; }
}

// ─────────────────────────────────────────────
// Center: Search
// ─────────────────────────────────────────────
.topbar-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: v.$gray-400;
  pointer-events: none;

  svg { width: 16px; height: 16px; }
}

.topbar-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 38px;
  border: 1px solid v.$border-color;
  border-radius: v.$radius;
  font-size: v.$font-size-sm;
  color: v.$gray-700;
  background: v.$gray-50;
  transition: border-color v.$transition-base, background v.$transition-base, box-shadow v.$transition-base;

  &::placeholder { color: v.$gray-400; }

  &:focus {
    outline: none;
    background: v.$white;
    border-color: v.$primary-border;
    @include m.focus-ring;
  }
}

.topbar-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: v.$font-size-2xs;
  color: v.$gray-400;
  background: v.$gray-100;
  border: 1px solid v.$gray-200;
  border-radius: v.$radius-sm;
  padding: 1px 5px;
  pointer-events: none;
}

// ─────────────────────────────────────────────
// Right: Actions
// ─────────────────────────────────────────────
.topbar-actions {
  @include m.flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.topbar-icon-btn {
  @include m.flex-center;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: v.$radius;
  color: v.$gray-500;
  cursor: pointer;
  transition: background v.$transition-base, color v.$transition-base;
  position: relative;
  text-decoration: none;

  &:hover { background: v.$gray-100; color: v.$gray-700; }

  svg { width: 18px; height: 18px; }
}

.topbar-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: v.$danger;
  border-radius: v.$radius-full;
  border: 2px solid v.$white;
}

.topbar-lang {
  @include m.flex-start;
  gap: 6px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid v.$border-color;
  border-radius: v.$radius;
  background: transparent;
  font-size: v.$font-size-sm;
  color: v.$gray-600;
  cursor: pointer;
  transition: background v.$transition-base;

  &:hover { background: v.$gray-50; }

  svg { width: 14px; height: 14px; }
}

.topbar-divider {
  width: 1px;
  height: 22px;
  background: v.$border-color;
  margin: 0 4px;
}
