/*========== Menu / Navigation ==========*/
#menu {
  position: relative;
  width: 100%;
  z-index: 10;
}

#nav {
  text-align: center;
  background: #606060;
}

#nav li {
  display: inline-block;
  /* height: 60px; */
  min-height: 60px;
  cursor: pointer;
  position: relative;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);   /* ← центрирование */
  background: #909090;
  padding: 10px 0;
  min-width: 220px;
  text-align: center;
  /* z-index: 100; */
  display: none;
}

/* пункты submenu */
.submenu li {
  display: block;
}

.submenu a {
  display: block;
  padding: 10px 20px;
  white-space: nowrap;
}

#nav a {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: white;
}

/* .sub-close { 
  display: none; 
} */

/* Arrows */
.nonactive2:after {
  content: "";
  position: relative;
  margin-left: 20px;
  top: 20px;
  border-width: 10px 10px 0 10px;
  border-style: solid;
  border-color: #444 transparent;
}

.active2:after {
  content: "";
  position: relative;
  margin-left: 20px;
  top: -16px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: #444 transparent;
}

.active3:after {
  content: '';
  display: block;
  position: absolute;
  z-index: 4;
  margin: 0 40%;
  width: 0;
  height: 0;
  border-color: #fb0 transparent transparent transparent;
  border-style: solid;
  border-width: 15px;
}

#connect:hover {
  background-color:#909090;
}

.active3,
#connect.active3:hover {
  background-color:#fb0;
}

.submenu.sub-open {
  display: block;
}

/* .submenu.sub-close {
  display: none;
} */


@media screen and (max-width: 630px) {

  #top { 
    /* position: relative; */
    /* margin-top: 19px;  */
  }

  /* ===== Бургер ===== */
  .sticky {
    /* position: absolute; */
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
  }


  .btn {
    /* right: 30px; */
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #606060;
    /* position: fixed; */
  }


  /* ===== Меню ===== */
  #nav {
    position: fixed;
    /* под шапкой */
    top: 40px;              
    left: 0;
    width: 100%;
    height: calc(100vh);
    background: #606060;
    overflow-y: auto;
    z-index: 1000;

    /* скрыто */
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }

  /* открыто */
  #nav.nav-open {
    transform: translateY(0);
  }

  /* пункты меню */
  #nav li {
    display: block;
    border-bottom: 1px solid #999;

    height: auto;
    min-height: 60px;
  }

  #nav a {
    padding: 20px 45px;
    display: block;
    text-align: center;
  }

  .active3:after {
    margin: 0 50%;
    top: 58px;
  }

  /* ===== Подменю ===== */
  .submenu {
    position: static;
    background: #777;
    transform: none;
    width: 100%;
    background: #777;
    padding: 0;
    
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  /* открытое подменю */
  .submenu.sub-open {
    max-height: 500px; /* с запасом */
  }

  /* пункты подменю */
  .submenu li a {
    font-size: 14px;
    padding: 14px;
  }


  /* ===== Полоска ===== */
  .btn span {
    position: relative;
    width: 30px;
    height: 3px;
    background: #fff;
    transition: background 0.3s;
  }

  /* ===== Верх / Низ ===== */
  .btn span::before,
  .btn span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 30px;
    height: 3px;
    background: #fff;
    transition: transform 0.3s, top 0.3s, bottom 0.3s;
  }

  .btn span::before {
    top: -10px;
  }

  .btn span::after {
    bottom: -10px;
  }

  /* ===== АКТИВНОЕ СОСТОЯНИЕ ===== */

  .btn.active span {
    background: transparent;
  }

  .btn.active span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .btn.active span::after {
    bottom: 0;
    transform: rotate(-45deg);
  }

}

@media screen and (max-width: 520px) {
  #nav {
    top: 60px;   
  }
  .btn {
    height: 60px;
  }
}

@media screen and (max-width: 420px) {

  .txt-p-01 { font-size: 2em; }
  .txt-p-02 { font-size: 1em; }

  .contacts-block {
    flex-direction: column;
    gap: 10px;
  }
}

@media screen and (max-width: 350px) {
  
  /* #top { margin-top: -15px; } */
  /* .btn { right: 20px; width: 40px; height: 40px; }
  #nav { top: 40px; }
  #nav li { height: 40px; }
  #nav a { padding: 10px; } */
}