.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 18%),
    linear-gradient(180deg, #4a2d19 0%, #6a3f21 35%, #8b5a2b 55%, #6a3f21 78%, #3b2213 100%);
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}

.nav {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo img {
  display: block;
  height: 64px;
  width: auto;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.28));
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.logo:hover img {
  transform: translateY(-1px) scale(1.02);
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.34));
}

.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  line-height: 1.2;
}

.menu a {
  position: relative;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 2px;
  white-space: nowrap;
  opacity: .95;
  transition: color .2s ease, opacity .2s ease, transform .2s ease;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, background .2s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #d98a45, #b56a2f);
  box-shadow: 0 8px 18px rgba(181,106,47,.26);
}

.btn-secondary {
  color: #fff;
  background: linear-gradient(180deg, #8c5a34, #6d4326);
  box-shadow: 0 8px 18px rgba(109,67,38,.22);
}

.burger {
  display: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 10px;
  transition: transform .2s ease, opacity .2s ease;
}

/* dropdown */
.dropdown-wrapper {
  position: relative;
}

.dropdown-toggle,
.dropdown-sub-toggle {
  cursor: pointer;
  display: block;
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: rgba(181, 122, 60, 0.8);
  border-radius: 12px;
  padding: 10px 0;
  list-style: none;
  margin: 0;
  z-index: 1001;
  box-shadow: 0 10px 24px rgba(181, 122, 60, 0.3);
}

.dropdown-wrapper:hover .submenu {
  display: block;
}

.submenu li {
  position: relative;
}

.submenu a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  display: block;
  transition: color 0.2s ease;
}

.submenu a:hover {
  color: #a2f3b0;
}

.submenu-sub {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 170px;
  background: rgba(181, 122, 60, 0.8);
  border-radius: 12px;
  padding: 10px 0;
  list-style: none;
  margin: 0;
  z-index: 1002;
  box-shadow: 0 10px 24px rgba(181, 122, 60, 0.3);
}

.dropdown-sub:hover .submenu-sub {
  display: block;
}

.submenu-sub a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  display: block;
  transition: color 0.2s ease;
}

.submenu-sub a:hover {
  color: #a2f3b0;
}

/* Авторизационные кнопки */
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  box-sizing: border-box;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn-cabinet {
  background: #0d6efd;
  color: #fff !important;
}

.btn-cabinet:hover {
  background: #0b5ed7;
  color: #fff !important;
}

.btn-register {
  background: #198754;
  color: #fff !important;
}

.btn-register:hover {
  background: #146c43;
  color: #fff !important;
}

.btn-logout {
  background: #dc3545;
  color: #fff !important;
}

.btn-logout:hover {
  background: #bb2d3b;
  color: #fff !important;
}

/* Кнопка бургера (единый стиль) */
.burger {
  display: none;
  position: relative;
  z-index: 1100;
  width: 46px;
  height: 44px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 9px;
  background: rgba(0, 0, 0, .2);
  cursor: pointer;
}

.burger span {
  display: block;
  width: 28px;
  height: 3px;
  margin: 5px auto;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition:
    transform .25s ease,
    opacity .25s ease;
}

.burger:hover {
  background: rgba(0, 0, 0, .35);
}

.burger:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

/* Состояние открытого бургера */
.burger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav {
    min-height: 72px;
    padding: 10px 0;
  }

  .logo img {
    height: 52px;
  }

  .menu {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 0 14px;
  }

  .menu.open {
    display: flex;
  }

  .menu a {
    font-size: 15px;
    padding: 8px 0;
  }

  .nav-actions {
    margin-left: auto;
    gap: 10px;
  }

  .burger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    order: 2;
    margin-left: auto;
  }

  .btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .submenu,
  .submenu-sub {
    display: none;
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-top: 6px;
    width: 100%;
  }

  .dropdown-wrapper.open .submenu,
  .dropdown-sub.open .submenu-sub {
    display: block;
  }

  .submenu a,
  .submenu-sub a {
    padding: 10px 14px;
  }

  .header .menu {
    position: relative;
    z-index: 9998;
    order: 3;
  }
}

@media (max-width: 480px) {
  .header {
    background:
      linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 15%),
      linear-gradient(180deg, #402714 0%, #6a3f21 35%, #8b5a2b 58%, #5f381d 100%);
  }

  .nav {
    min-height: 64px;
    padding: 8px 0;
  }

  .logo img {
    display: none;
    height: 46px;
  }

  .burger {
    margin-left: 0;
    font-size: 28px;
    padding: 6px 8px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .nav-actions {
    margin-left: auto;
  }
}