/**
 * Header Styles - Dominternet Style
 * Стили шапки в стиле Dominternet
 */

/* Убираем outline при фокусе для всех элементов шапки */
.top-bar a:focus,
.main-header a:focus,
.main-header button:focus {
  outline: none;
}

/* ========================================
   Верхняя информационная полоса (Top Bar)
   ======================================== */

.top-bar {
  background-color: #f4f4f4;
  font-size: 13px;
  color: #666666;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-links {
  display: flex;
  gap: 25px;
}

.top-links a {
  color: #666666;
  text-decoration: none;
  transition: color 0.3s;
}

.top-links a:hover {
  color: #0056b3;
}

.auth-link {
  font-weight: 500;
  color: #666666;
  text-decoration: none;
  transition: color 0.3s;
}

.auth-link:hover {
  color: #0056b3;
}

/* ========================================
   Основная навигационная полоса (Main Header)
   ======================================== */

.main-header {
  background-color: #ffffff;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.main-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

/* Логотип */
.logo {
  font-size: 26px;
  font-weight: 800;
  color: #0056b3;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-image {
  display: block;
  max-height: 46px;
  width: auto;
}

.logo span {
  color: #333333;
}

/* Меню */
.main-nav {
  display: flex;
  gap: 35px;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: #333333;
  padding-bottom: 5px;
  position: relative;
  text-decoration: none;
  transition: color 0.3s;
}

/* Анимация подчеркивания от центра */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #0056b3;
  transition: width 0.3s ease, left 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover {
  color: #0056b3;
}

.nav-link:hover::after {
  width: 100%;
  left: 50%;
}

.nav-link.active {
  color: #0056b3;
}

.nav-link.active::after {
  width: 100%;
  left: 50%;
}

/* Зона действий */
.header-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}

/* Телефон */
.phone-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.phone-number {
  font-size: 18px;
  font-weight: 700;
  color: #333333;
  text-decoration: none;
  transition: color 0.3s;
}

.phone-number:hover {
  color: #0056b3;
}

.phone-sub {
  font-size: 12px;
  color: #666666;
  margin-top: 2px;
}

/* Кнопка (CTA) */
.btn-primary-header {
  background-color: #0056b3;
  color: #ffffff;
  padding: 12px 26px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-header:hover {
  background-color: #004494;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
  text-decoration: none;
  color: #ffffff;
}

/* ========================================
   Burger Menu
   ======================================== */

.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  gap: 6px;
  order: 2;
}

.burger-menu span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #333333;
  transition: all 0.3s ease;
  transform-origin: center;
}

.burger-menu.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   Mobile Styles
   ======================================== */

@media (max-width: 991px) {
  .top-bar {
    display: none;
  }

  .main-header .container {
    flex-wrap: wrap;
    height: auto;
    padding: var(--spacing-4) var(--spacing-4);
    position: relative;
  }

  .logo {
    order: 0;
    flex-shrink: 0;
  }

  .burger-menu {
    display: flex;
    margin-left: auto;
    margin-right: 0;
  }

  .header-actions {
    order: 1;
    gap: var(--spacing-4);
    margin-left: auto;
  }

  .phone-block {
    align-items: flex-end;
  }

  .main-nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    padding: 0 var(--spacing-4);
    border-top: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
  }

  .main-nav.active {
    max-height: 300px;
    margin-top: var(--spacing-4);
    padding-top: var(--spacing-4);
    padding-bottom: var(--spacing-2);
    border-top: 1px solid #f0f0f0;
  }

  .main-nav .nav-link {
    padding: var(--spacing-3) 0;
    padding-left: var(--spacing-2);
    border-bottom: 1px solid #f5f5f5;
    width: 100%;
    text-align: left;
  }

  .main-nav .nav-link:last-child {
    border-bottom: none;
  }

  .main-nav .nav-link::after {
    display: none;
  }

  .btn-primary-header {
    padding: 10px 20px;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .logo {
    font-size: 20px;
  }

  .logo-image {
    max-height: 36px;
  }

  .main-nav {
    gap: 10px;
  }

  .nav-link {
    font-size: 14px;
  }

  .phone-number {
    font-size: 16px;
  }

  .phone-sub {
    font-size: 11px;
  }

  .btn-primary-header {
    padding: 8px 16px;
    font-size: 12px;
  }

  .burger-menu {
    width: 40px;
    height: 40px;
  }
}
