/* Header & Brand */
.topbar {
  position: static;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(246, 248, 251, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  height: auto;
  max-height: 42px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-text span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Language Switcher */
html[lang='vi'] .lang-btn[data-lang='vi'],
html[lang='en'] .lang-btn[data-lang='en'] {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.3);
}

html[lang='vi'] .lang-btn[data-lang='en'],
html[lang='en'] .lang-btn[data-lang='vi'] {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.lang-btn:hover {
  color: var(--text);
}

/* Buttons */
.icon-btn,
.btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active,
.btn:active {
  transform: scale(0.98);
}

.icon-btn {
  width: 42px;
  min-height: 42px;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.btn {
  width: 100%;
  padding: 8px 16px;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.24);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-dark {
  background: #111827;
  color: #ffffff;
}

.btn-dark:hover {
  background: #1f2937;
}

.btn-light {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-light:hover {
  background: #f9fafb;
}

/* Toast Message */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.25);
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjustments */
@media (max-width: 559px) {
  .topbar {
    gap: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    max-height: 38px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text span {
    font-size: 11px;
  }

  .top-actions {
    gap: 6px;
  }

  .btn {
    min-height: 46px;
    border-radius: 16px;
    font-size: 14px;
  }
}

@media (min-width: 640px) {
  .brand-logo {
    max-height: 44px;
  }
}

@media (min-width: 860px) {
  .topbar {
    width: min(100% - 48px, 1120px);
    margin: 20px auto 0;
    border: 1px solid var(--line);
    border-radius: 24px;
  }
}
