header{
    display: flex;
    width: 100%;
    max-width: 1240px;
    padding: 20px;
    justify-content: space-between;
    margin: 0 auto;
    align-items: center;
    position: relative;
}

header .phone{
    font-size: 18px!important;
    font-weight: 700!important;
    color: #404040;
}

header .tri{
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #60a5a3;
}

header .phone img{
    display: none;
}

header .callback{
    color: #60A4A2;
    position: relative;
    font-size: 16px;
    font-weight: 600;
    position: relative;
}

header .menu__link{
    font-size: 16px;
    color: #404040;
    font-weight: 500;

}

header .callback::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    border-bottom: 2px dotted #6b9d9d;
}

header .contact{
   display: flex;
   flex-direction: column;
   gap: 5px;
   align-items: flex-end;
}

.menu { display:flex; gap:24px; list-style:none; }
.menu__item { position:relative; }
.menu__link { text-decoration:none; }

/* Стили для бургер-меню */
.burger {
  display: none;
  position: relative;
  z-index: 1000;
  width: 30px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.burger__line {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 1px;
  background-color: #60A4A2;
  margin: 6px 0;
  transition: transform 0.5s, opacity 0.5s;
}

.burger.is-open .burger__line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger.is-open .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.is-open .burger__line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Стили для меню */
.main-nav {
  transition: transform 0.3s, visibility 0s 0.3s, opacity 0.3s;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu__item {
  position: relative;
  display: flex;                                                                                                                                                                        │
  align-items: center;                                                                                                                                                                  │
  justify-content: space-between;
}

.menu__link {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #000;
  flex-grow: 1;
}

.menu__toggle {
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu__toggle[aria-expanded="true"] {
  transform: rotate(180deg);
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #F5FDFF;
}

.submenu__item {
  padding-left: 20px;
  white-space: nowrap;
}

/* Поведение на десктопе */
@media (min-width: 992px) {
  .menu__item_has-children:hover > .submenu {
    flex-direction: column;
    display: flex;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    min-width: 260px;
    width: auto;
    border: 1px solid #DFDFDF;
  }

  .menu__item_has-children:hover > .submenu a{
    color: #404040;
    font-weight: 500;
    white-space: nowrap;
  }

  .menu__item_has-children:hover > .submenu li{
    border-bottom: 1px solid #DFDFDF;
  }

  .menu__item_has-children:hover > .submenu li a{
    padding-bottom: 10px;
    padding-top: 10px;
    display: flex;
    width: 100%;
  }

  .submenu__item:hover{
    background: #60A4A2;
  }

  .submenu__item:hover > a{
    color: white!important;
  }

.menu__item_has-children {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: visibility 0s, opacity 0.5s, transform 0.5s;
    z-index: 100;
  }
}

/* Поведение на мобильных */
@media (max-width: 991px) {
  .submenu__item{
    border-bottom: 1px solid #DFDFDF;
  }

  header .logo{
    max-width: 120px;
    width: 100%;
    z-index: 2;
  }

  header .contact{
    z-index: 2;
  }

  .submenu__item a{
    color: #404040;
    font-weight: 500;
    width: 100%;
    font-size: 14px;
    padding-bottom: 10px;
    padding-top: 10px;
    display: flex;
    width: 100%;
  }
  .burger {
    display: block;
    order: -1;
  }
  header .menu__link{
   flex: 1;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-100%);
    transition: transform 0.5s, visibility 0s 0.5s, opacity 0.5s;
    overflow-y: auto;
    padding-top: 80px;
  }

  .main-nav.is-open {
    visibility: visible;
    z-index: 999;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.5s, visibility 0s 0s, opacity 0.5s;
  }

  .main-nav.is-open .menu__toggle{
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.5s;
    background: #ebf4f3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
  }
  
  .menu__item{
    border-bottom: 1px solid #DFDFDF;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
  }

  .menu {
    flex-direction: column;
    gap: 0px;
  }

  .menu__toggle {
    display: block;
  }

  .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    padding-left: 20px;
  }

  .submenu.is-open {
    max-height: 500px; /* или другое достаточно большое значение */
    transition: max-height 0.5s ease-in-out;
    width: 100%;
    padding-left: 0;
    border-left: 1px solid #DFDFDF;
    border-right: 1px solid #DFDFDF;
    border-top: 1px solid #DFDFDF;
  }
  header .callback{
    display: none;
  }
  header .phone{
    font-size: 14px!important;
    white-space: nowrap;
  }
  header{
    padding: 10px;
    gap: 20px;
  }

  header .phone img{
    display: flex;
    width: 36px;
  }
  
  header .phone span{
    display: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

header .menu__link:hover{
    color: #60A4A2;
    transition: 0.3s;
}

