/* =================================
   БАЗОВЫЕ СТИЛИ
   ==================================== */
header ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo {
  margin: 0;
  font-size: 1.45em;
  white-space: nowrap;
}

.logo a,
.main-nav a {
  padding: 10px 15px;
  text-decoration: none;
  color: #34495e;
  text-transform: uppercase;
  text-align: center;
  display: block;
  white-space: nowrap;
}

.main-nav a {
  font-size: .99em;
}

.main-nav a:hover {
  color: #718daa;
}

.header {
  padding: 12px 20px;
  border-bottom: 1px solid #a2a2a2;
  background-color: #ddebf4;
  box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* =================================
   КОНТАКТЫ В ХЕДЕРЕ
   ==================================== */
.header-contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.header-contacts a {
  color: #34495e;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.header-contacts a:hover {
  color: #718daa;
}

/* =================================
   ГАМБУРГЕР & МОБИЛЬНОЕ МЕНЮ
   ==================================== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #34495e;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.main-nav {
  width: 100%;
  order: 3;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.main-nav.active {
  max-height: 250px;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
}

.main-nav li {
  width: 100%;
  text-align: center;
}

/* =================================
   DESKTOP: Полная ширина (> 1150px)
   ==================================== */
@media (min-width: 1051px) {
  .hamburger { display: none; }
  
  .header {
    flex-wrap: nowrap;
    padding: 15px 30px;
    justify-content: flex-start;
  }

  .logo { order: 1; }
  
  .header-contacts { 
    order: 2; 
    display: flex;
    margin-left: 25px;
  }

  .main-nav {
    order: 3;
    margin-left: auto;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .main-nav ul {
    flex-direction: row;
    padding-top: 0;
  }

  .main-nav li { width: auto; }
}

/* =================================
   NARROW DESKTOP / TABLET (769px - 1150px)
   Контакты скрываются, чтобы не ломать строку
   ==================================== */
@media (min-width: 769px) and (max-width: 1050px) {
  .hamburger { display: none; }
  .header { flex-wrap: nowrap; justify-content: center; padding: 15px 20px; }
  
  .logo { order: 1; }
  .header-contacts { display: none; /* ← Скрываем контакты при нехватке места */ }
  
  .main-nav {
    order: 2;
    width: auto;
    max-height: none;
    overflow: visible;
  }
  .main-nav ul { flex-direction: row; padding-top: 0; }
  .main-nav li { width: auto; margin: 0 5px; }
}

/* =================================
   MOBILE (< 769px)
   ==================================== */
@media (max-width: 768px) {
  .header { padding: 10px 15px; justify-content: space-between; }
  .header-contacts { display: none; }
}
