.top-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
  height: 80px;
  background: rgba(4,4,14,0.95);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: transform 0.35s ease;
}
.top-header.hidden { transform: translateY(-100%); }

.header-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 100% 300% at 20% 50%, rgba(180,180,200,0.02) 0%, transparent 60%),
              radial-gradient(ellipse 80% 250% at 80% 50%, rgba(91,127,170,0.015) 0%, transparent 60%);
  animation: glowPulse 8s ease-in-out infinite alternate;
}
@keyframes glowPulse { 0% { opacity: 0.3; } 50% { opacity: 0.8; } 100% { opacity: 0.4; } }

.header-inner {
  max-width: 1700px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}

.header-group { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo-link { flex-shrink: 0; display: flex; align-items: center; }
.logo-img { height: 58px;  width: auto; display: block; opacity: 0.85; margin-left: -4px; }
.logo-link:hover .logo-img { opacity: 0.85; transform: scale(1.03); }

.brand-link { flex-shrink: 0; display: flex; align-items: center; }
.brand-img { height: 42px; width: auto; display: block; opacity: 0.85; }
.brand-link:hover .brand-img { opacity: 0.85; }

.city-tag { margin-left: 5px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(4,4,14,0.95); border: 1px solid rgba(255,255,255,0.06);
  color: #9090a8; font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  opacity: 0.85; transition: all 0.25s;
}
.city-tag:hover { opacity: 0.85; border-color: rgba(255,255,255,0.12); color: #b0b0c0; }
.caret { font-size: 6px; color: #5e5e7a; transition: transform 0.3s; }
.city-tag:hover .caret { transform: rotate(180deg); }

.header-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.header-nav a {
  display: flex; align-items: center; gap: 7px;
  color: #8a8aa4; text-decoration: none;
  font-size: 13px; font-weight: 500; padding: 8px 14px;
  border-radius: 10px; transition: all 0.3s ease; position: relative;
}
.header-nav a::after {
  content: ''; position: absolute; bottom: 2px; left: 50%;
  width: 0; height: 2px; background: #5b7faa; border-radius: 2px;
  transition: all 0.3s ease; transform: translateX(-50%);
}
.header-nav a:hover { color: #fff; background: rgba(255,255,255,0.03); }
.header-nav a:hover::after { width: 18px; }
.header-nav a i { font-size: 14px; color: #5b7faa; transition: all 0.3s ease; }
.header-nav a:hover i { color: #7aa0cc; transform: scale(1.1); }

.header-nav a:last-child {
  margin-left: 4px; padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px;
  font-weight: 600; overflow: hidden;
}
.header-nav a:last-child::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(180,180,190,0.08), rgba(91,127,170,0.08));
  opacity: 0; transition: opacity 0.3s ease;
}
.header-nav a:last-child:hover {
  border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.03);
  transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.header-nav a:last-child:hover::before { opacity: 0.85; }

.city-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); z-index: 2000;
}
.city-overlay.show { display: block; }

.city-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.92); z-index: 2001;
  background: rgba(16,16,30,0.98); backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 18px; padding: 28px 24px 20px; min-width: 220px; text-align: center;
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.22,0.61,0.36,1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}
.city-popup.show { opacity: 0.85; visibility: visible; transform: translate(-50%,-50%) scale(1); }
.city-popup-title {
  font-family: 'Montserrat','Inter',sans-serif; font-size: 14px; font-weight: 700;
  color: #c8c8d4; margin-bottom: 16px; letter-spacing: 1px; text-transform: uppercase;
}
.city-popup button {
  display: block; width: 100%; padding: 12px 20px; border: none; border-radius: 10px;
  background: rgba(91,127,170,0.12); color: #7aa0cc; font-size: 14px;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
  font-weight: 600;
}
.city-popup button:hover { background: rgba(91,127,170,0.2); }

@media (max-width: 900px) {
  .header-inner { padding: 0 16px; }
  .brand-img { height: 42px; }
  .header-nav a { padding: 8px 10px; font-size: 0; }
  .header-nav a i { font-size: 18px; margin: 0; }
}
@media (max-width: 600px) {
  .city-tag { margin-left: 5px; display: none; }
}
.logo-img,.brand-img{filter:brightness(0) invert(1)}
[data-theme="light"] .logo-img,[data-theme="light"] .brand-img{filter:brightness(0)}
.city-tag{margin-left:5px;display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:8px;background:transparent;border:1px solid rgba(255,255,255,0.06);color:#9090a8;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit;white-space:nowrap;opacity:0.85;transition:all 0.25s}
.city-tag:hover{border-color:rgba(255,255,255,0.12);color:#b0b0c0}
.caret{font-size:6px;color:#5e5e7a;transition:transform 0.3s}
.city-tag:hover .caret{transform:rotate(180deg)}
[data-theme="light"] .city-tag{color:#5a5a70;border-color:rgba(0,0,0,0.1)}
[data-theme="light"] .city-tag:hover{color:#1a1a2e;border-color:rgba(0,0,0,0.18)}
.theme-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #9a9ab0;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.25s;
  margin-left: 8px;
  flex-shrink: 0;
}
.theme-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}
[data-theme="light"] .theme-btn {
  border-color: rgba(0,0,0,0.1);
  color: #6a6a80;
}
[data-theme="light"] .theme-btn:hover {
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.04);
}

/* Мобильная версия */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .logo-img { height: 40px; }
  .brand-img { height: 28px; }
  .city-tag { display: none; }
  .header-nav a { padding: 8px 10px; font-size: 0; }
  .header-nav a i { font-size: 18px; margin: 0; }
  .theme-btn { width: 34px; height: 34px; margin-left: 4px; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 10px; }
  .logo-img { height: 34px; }
  .brand-img { height: 24px; }
  .header-nav { gap: 0; }
  .header-nav a { padding: 8px 6px; }
  .header-nav a i { font-size: 16px; }
}
