/* =========================
   HEADER + MENU
========================= */

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #0d6efd;
  color: #fff;
}

.header-top .logo {
  font-size: 1.7rem;
  font-weight: 700;
}

.header-top .phone a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.navbar {
  background: #0d6efd;
  position: relative;
}

.nav-container {
  display: flex;
  align-items: center;
}

/* BURGER */
#menu-toggle,
#services-toggle {
  display: none;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 22px;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 3px;
  background: #fff;
  border-radius: 2px;
}

/* MENU */
.menu {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.menu a,
.submenu-title {
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.3s;
}

.menu a:hover,
.submenu-title:hover {
  background: rgba(255,255,255,0.25);
}

/* SUBMENU desktop */
.has-submenu {
  position: relative;
}

.submenu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #0b5ed7;
  border-radius: 6px;
  display: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.has-submenu:hover .submenu {
  display: block;
}

.submenu li a {
  padding: 12px 16px;
  display: block;
  color: #fff;
}

.submenu li a:hover {
  background: rgba(255,255,255,0.15);
}

/* ARROW */
.submenu-title .arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

  .burger {
    display: flex;
  }

  /* MENU */
  .menu {
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d6efd;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  #menu-toggle:checked ~ .menu {
    max-height: 600px;
  }

  /* Submenu mobile */
  .submenu {
    position: static;
    display: none;
    border-radius: 0;
    max-height: 0;
    transition: max-height 0.3s ease;
  }

  /* Показываем подменю при чекбоксе */
  .has-submenu input[type="checkbox"]:checked ~ .submenu {
    display: block;
    max-height: 500px; /* достаточно, чтобы вместить все пункты */
  }

  /* Поворот стрелки при открытии */
  .has-submenu input[type="checkbox"]:checked + .submenu-title .arrow {
    transform: rotate(180deg);
  }

  /* Отступ для вложенных пунктов */
  .submenu li a {
    padding-left: 30px;
  }

  /* Убираем hover для мобильных */
  .has-submenu:hover .submenu {
    display: none;
  }
}
