* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.header {
  position: sticky;
  padding: 0 20px;
  top: 0;
  color: white;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  border-bottom: 3px solid #249ee0;
  z-index: 100;
  background-color: #393e54fa;
}

.nav-container {
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: auto;
  justify-content: space-between;
}

.logo {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
}

.burger-button {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
}

.burger-button span {
  width: 40px;
  height: 4px;
  background: #0685c9;
  border-radius: 10px;
  transition: all 0.3s linear;
}

.burger-button.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.burger-button.active span:nth-child(2) {
  opacity: 0;
}

.burger-button.active span:nth-child(3) {
  transform: rotate(-45deg) translate(11px, -11px);
}

#block-webmix-main-menu {
  background-color: #3d4257;
  border-radius: 0 0 20px 20px;
}

.nav-container nav {
  /* background-color: #333; */
}

/* Скрываем заголовок меню */
.nav-container .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
}

@media (min-width: 769px) {
  /* Горизонтальное меню */
  .nav-container nav > ul {
    display: flex !important;
    flex-direction: row !important;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
    position: relative;
  }

  .nav-container nav > ul > li {
    position: relative;
  }

  .nav-container nav a {
    color: #fefefc;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    font-size: 17px;
    white-space: nowrap;
  }

  .nav-container nav a:hover {
    background-color: #0685c9;
    border-radius: 4px;
  }

  /* Подменю на ПК */
  .nav-container nav ul ul {
    display: none;
    position: absolute;
    top: 70%;
    left: -25px;
    background-color: #0685c9;
    min-width: 210px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 1000;
    list-style: none;
  }

  .nav-container nav li:hover > ul {
    display: block !important;
  }

  .nav-container nav ul ul ul {
    top: 0;
    left: 100%;
  }

  .nav-container nav ul ul li {
    width: 100%;
  }

  .nav-container nav ul ul a {
    padding: 10px 20px;
    white-space: nowrap;
  }

  .nav-container nav ul ul a:hover {
    background-color: #393e54;
  }

  .burger-button {
    display: none !important;
  }

  .nav-container nav {
    position: relative;
    top: auto;
    left: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  /* Показываем бургер */
  .burger-button {
    display: flex !important;
    position: absolute;
    right: 20px;
  }

  .nav-container nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    /* background-color: #333; */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .nav-container nav.open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-container nav > ul {
    display: flex !important;
    flex-direction: column !important;
    list-style: none;
    margin: 0;
    /* padding: 10px 0; */
    width: 100%;
  }

  .nav-container nav > ul > li {
    width: 100%;
    border-bottom: 1px solid #505464;
    background: #3d4257;
  }

  .nav-container nav > ul > li:last-child {
    border-bottom: none;
  }

  .nav-container nav a {
    color: #f3f3f3;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    font-size: 20px;
    text-align: left;
    max-width: 280px;
    margin: auto;
  }

  .nav-container nav ul ul {
    display: none;
    background-color: #0685c9;
    list-style: none;
    margin: 0;
    padding: 5px 15px 5px 15px;
    width: 100%;
  }

  .nav-container nav ul ul.open {
    display: block !important;
  }

  .nav-container nav ul ul li {
    width: 100%;
    border-bottom: 1px solid #0685c9;
  }

  .nav-container nav ul ul li:last-child {
    border-bottom: none;
  }

  .nav-container nav ul ul a {
    padding: 12px 30px 12px 30px;
    font-size: 19px;
  }

 .has-children > a {
    position: relative;
    padding-right: 40px !important;
  }

  .has-children > a::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    font-weight: 100;
    color: #0685c9;
  }

  .has-children > a.open::after {
    content: '−';
  }

  .nav-container nav li:hover > ul {
    display: none;
  }
}

.contextual {
  position: absolute !important;
  z-index: 2000 !important;
}

.contextual-links {
  background: white !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
  padding: 5px 0 !important;
  min-width: 200px !important;
  z-index: 2001 !important;
}

.contextual-links[hidden] {
  display: none !important;
}

.contextual-links li {
  display: block !important;
  width: 100% !important;
}

.contextual-links a {
  color: #333 !important;
  padding: 8px 15px !important;
  display: block !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  background: white !important;
  text-decoration: none !important;
}

.contextual-links a:hover {
  background-color: #ffedf0 !important;
}

.toolbar-fixed .header {
  padding-top: 39px;
}

.toolbar-horizontal.toolbar-tray-open .header {
  padding-top: 79px;
}

@media (max-width: 768px) {
  .toolbar-fixed .burger-button {
    margin-top: 40px;
  }
  
  .toolbar-fixed .nav-container nav.open {
    top: calc(100% + 40px);
  }
}

.nav-container a:active {
  background-color: rgb(238 238 238);
  -webkit-tap-highlight-color: transparent;
} 