:root {
  --clr-header-bg: #ebeff5;
  --clr-accent: #3f51b5;
  --clr-header-btn: #00b050;
  --clr-header-btn-hover: #009c42;
}

body {
  margin: 0;
  font-family: montserrat;
}

main {
  padding-top: 120px;
}

/* ===== Header Capsule ===== */
.site-header {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 2000;
  pointer-events: all;
  
  /* Предотвращение смещения при зуме и масштабировании */
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
  
  /* Обеспечение стабильного позиционирования */
  /* ВАЖНО: убираем paint-контейнмент, чтобы выпадающее меню не обрезалось шапкой */
  /* contain: layout style; */
}

/* Ensure inner wrapper centers content */
.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  
  /* Центрирование содержимого */
  display: flex;
  justify-content: center;
  align-items: center;
}

.white-bar {
  background: var(--clr-header-bg);
  border-radius: 36px;
  padding: 10px 20px;
  width: 100%;
  max-width: 1160px; /* 1200px - 40px margin */
  box-sizing: border-box;
  
  /* Стабильная сетка */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  
  /* Предотвращение искажения */
  min-height: 60px;
  flex-shrink: 0;
}

/* Logo */
.logo h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--clr-accent);
}
.logo a {
  text-decoration: none;
  color: inherit;
}

/* Desktop Nav */
.nav-container {
  display: flex;
  gap: 20px;
}
.nav-container a {
  font-size: 1rem;
  font-weight: 600;
  color: #303854;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}
.nav-container a:hover,
.nav-container a.active {
  background: var(--clr-accent);
  color: #fff;
}

/* Universal Button Style */
.btn {
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 24px;
  background: var(--clr-header-btn);
  color: #fff;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
  line-height: 1;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--clr-header-btn-hover);
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.97);
}

/* Pulse animation удалена - без теней */

/* Mobile burger - стили перенесены в mobile-menu.css */

/* Высокие разрешения - предотвращение проблем на больших экранах */
@media (min-width: 1400px) {
  .site-header {
    top: 24px;
  }
  
  .header-inner {
    max-width: 1400px;
  }
  
  .white-bar {
    max-width: 1360px;
    padding: 12px 24px;
    min-height: 70px;
  }
  
  .logo h1 {
    font-size: 1.7rem;
  }
  
  .nav-container a {
    font-size: 1.1rem;
    padding: 8px 16px;
  }
  
  .btn {
    font-size: 1.1rem;
    padding: 10px 20px;
  }
}

@media (max-width: 1024px) {
  .white-bar {
    padding: 8px 16px;
    border-radius: 28px;
    gap: 12px;
    min-height: 64px;
  }
  .logo h1 {
    font-size: 1.3rem;
  }
  .nav-container a {
    font-size: 0.95rem;
    padding: 5px 10px;
  }
  .btn {
    font-size: 1rem;
    padding: 6px 14px;
  }
}

@media (max-width: 900px) {
  .nav-container {
    gap: 12px;
  }
  .nav-container a {
    font-size: 0.9rem;
    padding: 4px 8px;
  }
  .btn {
    font-size: 0.95rem;
    padding: 6px 12px;
  }
}

@media (max-width: 768px) {
  .site-header {
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
  }
  
  .header-inner {
    width: 100%;
    max-width: none;
    padding: 0 10px;
  }
  
  .white-bar {
    padding: 8px 12px;
    border-radius: 20px;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
    width: calc(100% - 20px);
    max-width: none;
    margin: 0 10px;
    box-sizing: border-box;
  }
  
  .nav-container {
    display: none !important;
  }
  
  .logo {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 60px);
  }
  
  .logo h1 {
    font-size: 1.2rem;
    white-space: nowrap;
    margin: 0;
  }
  
  .header-action {
    display: none !important;
  }
  
  /* Мобильные стили перенесены в mobile-menu.css */
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 8px;
  }
  
  .white-bar {
    margin: 0 8px;
    padding: 8px 12px;
    border-radius: 20px;
    gap: 12px;
    min-height: 56px;
    width: calc(100% - 16px);
    max-width: none;
  }
  
  .logo {
    max-width: calc(100% - 50px);
  }
  
  .logo h1 {
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  
  .btn {
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 18px;
    font-weight: 600;
  }
  
  /* Мобильные стили перенесены в mobile-menu.css */
}

@media (max-width: 360px) {
  .header-inner {
    padding: 0 6px;
  }
  
  .white-bar {
    margin: 0 6px;
    padding: 6px 10px;
    gap: 10px;
    min-height: 52px;
    width: calc(100% - 12px);
    max-width: none;
  }
  
  .logo {
    max-width: calc(100% - 45px);
  }
  
  .logo h1 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
  }
  
  .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 16px;
  }
  
  /* Мобильные стили перенесены в mobile-menu.css */
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes burgerToX {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

@keyframes lineToX {
  from {
    transform: rotate(0deg);
    box-shadow: 0 6px 0 white, 0 -6px 0 white;
  }
  to {
    transform: rotate(45deg);
    box-shadow: 0 0 0 white, 0 0 0 white;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Эти стили теперь объединены в основных медиа-запросах выше */

.logo a,
.btn,
.nav-container a {
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.logo a:hover,
.btn:hover,
.nav-container a:hover {
  transform: scale(1.05);
}

.nav-container a.active {
  position: relative;
}

.nav-container a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--clr-accent);
  animation: underlineGrow 0.3s ease forwards;
}

@keyframes underlineGrow {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.site-header {
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeSlideDown 0.6s ease-out forwards;
  animation-delay: 0.2s;
}

@keyframes fadeSlideDown {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


