/* ============================================
   HEADER — шапка, логотип, навигация, меню
   ============================================ */

/* ---------- Шапка ---------- */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--color-header, #f5f5dc);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ---------- Логотип ---------- */
.logo {
  cursor: pointer;
}

.logo img {
  height: 40px;
}

/* ---------- Десктопное меню ---------- */
.header-menu {
  display: none;
}

@media screen and (min-width: 1025px) {
  .menu-button {
    display: none;
  }

  .header-menu {
    display: flex;
    gap: 3rem;
  }

  .header-menu a {
    font-family: var(--font-manrope, 'Manrope', sans-serif);
    text-decoration: none;
    color: var(--color-text-primary, #5d4037);
    font-weight: 500;
    font-size: 1.4rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
  }

  .header-menu a:hover {
    color: #666;
  }

  .overlay-menu {
    display: none !important;
  }
}

/* ---------- Кнопка гамбургер ---------- */
.menu-button {
  width: 30px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.menu-button span {
  position: absolute;
  height: 4px;
  width: 100%;
  background: var(--color-text-dark, #333);
  border-radius: 2px;
  left: 0;
  transition: all 0.3s ease;
}

.menu-button span:nth-child(1) { top: 0; }
.menu-button span:nth-child(2) { top: 10px; }
.menu-button span:nth-child(3) { top: 20px; }

.menu-button.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 10px;
}

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

.menu-button.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 10px;
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  header {
    padding: 0.75rem 1.5rem;
  }

  .logo img {
    height: 32px;
  }

  .menu-button span {
    height: 3px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 0.89rem 1.5rem;
  }

  .logo img {
    height: 32px;
  }
}

/* ---------- Оверлейное меню (мобильное) ---------- */
.overlay-menu {
  font-family: var(--font-manrope, 'Manrope', sans-serif);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-header, #f5f5dc);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  z-index: 999;
  box-shadow: var(--shadow-md, 0 4px 10px rgba(0,0,0,0.2));
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
  box-sizing: border-box;
  max-width: 100vw;
}

.overlay-menu.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3.5rem;
}

.overlay-header .logo img {
  height: 40px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.menu-links a {
  margin: 0.5rem 0;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--color-text-primary, #5d4037);
  transition: color 0.2s;
  text-align: center;
}

.menu-links a:hover {
  color: #666;
}
