.demo-header__toggle {
  display: none;
}

.demo-header__toggle {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  z-index: 1003;
}

.demo-header__toggle span {
  width: 18px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.demo-lang>summary {
  list-style: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  padding: 0;
  position: relative;
  z-index: 1003;
}

.demo-lang>summary::-webkit-details-marker {
  display: none;
}

.demo-lang>summary::before {
  content: "";
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffcb10' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17'/%3E%3Cpath d='M12 3.5c3 3.2 3 13.8 0 17'/%3E%3Cpath d='M12 3.5c-3 3.2-3 13.8 0 17'/%3E%3C/svg%3E");
}

.demo-lang__icon {
  display: none;
}

.demo-lang[open]>summary {
  border-color: rgba(255, 255, 255, 0.62);
}

.demo-lang__menu {
  z-index: 1005;
}

@media (max-width: 1024px) {
  body.header-menu-open {
    overflow: hidden;
  }

  .demo-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    position: sticky;
    top: 0;
  }

  .demo-header__brand {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .demo-header__title {
    min-width: 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .demo-header__logo {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
  }

  .demo-header__toggle {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    flex-shrink: 0;
  }

  .demo-lang {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    flex-shrink: 0;
  }

  .demo-header__nav {
    position: fixed;
    top: 84px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: none;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    margin-top: 0;
    padding: 20px 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(9, 30, 104, 0.96), rgba(3, 17, 74, 0.98)),
      rgba(3, 17, 74, 0.96);
    box-shadow: 0 28px 60px rgba(3, 17, 74, 0.36);
    z-index: 1002;
  }

  .demo-header.menu-open .demo-header__nav {
    display: flex;
  }

  .demo-header.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(3, 17, 74, 0.42);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1001;
  }

  .demo-header__link {
    width: 100%;
    display: block;
    font-size: 14px;
    text-align: left;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
  }

  .demo-header__dropdown {
    width: 100%;
  }

  .demo-header__dropdown[open] .demo-header__link {
    background: #ffffff;
    color: #05134b;
    border-radius: 10px 10px 0 0;
  }

  .demo-header__dropdown-menu {
    position: static;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: none;
    border-radius: 0 0 14px 14px;
    box-shadow: none;
    min-width: 0;
    padding: 10px;
    gap: 6px;
  }

  .demo-header__dropdown-item {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    padding: 10px 12px;
  }

  .demo-header__dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .demo-header.menu-open .demo-header__toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .demo-header.menu-open .demo-header__toggle span:nth-child(2) {
    opacity: 0;
  }

  .demo-header.menu-open .demo-header__toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 600px) {
  .demo-header__title {
    font-size: 11px;
  }

  .demo-header__toggle,
  .demo-lang>summary {
    width: 38px;
    height: 38px;
  }

  .demo-header__toggle span {
    width: 16px;
  }

  .demo-lang>summary::before {
    width: 16px;
    height: 16px;
  }

  .demo-header__link {
    font-size: 12px;
    padding: 9px 10px;
  }

  .demo-header__nav {
    top: 76px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 16px 12px 14px;
    border-radius: 20px;
  }
}
