/* ============================================
   HEADER.CSS — шапка сайта
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* ── Лого ── */
.logo { flex-shrink: 0; }
.logo-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon-wrap {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-icon-wrap .header-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}

/* ── Навигация ── */
.main-nav { flex: 1; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-link:hover,
.nav-link.active {
  background: var(--accent-light);
  color: var(--accent);
}
.nav-link i { font-size: 13px; }

/* ── Правые кнопки ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Бургер (мобайл) ── */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.burger:hover { background: var(--bg); }
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Мобильное меню ── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 99;
  padding: 16px 24px 24px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform .2s, opacity .2s;
}
.mobile-menu.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}
.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  transition: background .15s, color .15s;
}
.mobile-menu a:hover { background: var(--accent-light); color: var(--accent); }
.mobile-menu .divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.mobile-menu .btn { justify-content: center; margin-top: 4px; }

/* ── Unified User Profile Block (светло-серый) ── */
.user-profile-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s, border-color .15s;
}
.user-profile-block:hover {
  background: #eeeeee;
  border-color: #bdbdbd;
}
.user-profile-block img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-profile-block #userName {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-profile-block .profile-label {
  font-size: 11px;
  color: var(--text-muted);
  background: #e0e0e0;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Avatar wrapper for donor star */
.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.donor-star {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
}

.donor-star i {
  font-size: 9px;
  color: #fff;
}

/* Tariff star indicator for Pro/Max users */
.tariff-star {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
  animation: starPulse 2s infinite;
}

.tariff-star i {
  font-size: 8px;
  color: #fff;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ── Responsive header ── */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .header-actions .btn { display: none; }
  .burger { display: flex; }
}