.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
}

.logo-wrapper img {
  display: block;
  height: var(--logo-height);
  width: auto;
}

.logo-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 15px;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

.top-button {
  display: flex;
  gap: 10px;
}

.top-button a {
  font-family: "lato";
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.625rem 0.9rem;
  text-decoration: none;
  color: #1c1c1c;
  font-size: clamp(0.8rem, 0.7rem + 0.3vw, 0.95rem);
  border-radius: 8px;
  transition: background-color 0.5s ease,
    box-shadow 0.5s ease,
    border-radius 0.5s ease;
}

.top-button a:hover {
  overflow: visible !important;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  background-color: #e7e7e7;
}

.top-button img {
  height: 30px !important;
  width: auto;
  vertical-align: middle;
  padding-right: 8px;
  opacity: 0.5;
}

.burger-toggle {
  display: none;
  position: relative;
  width: var(--burger-size);
  height: var(--burger-size);
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  flex-shrink: 0;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.burger-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.burger-lines {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--burger-line-width);
  height: 2px;
  background-color: #1c1c1c;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: background-color 0.22s ease;
}

.burger-lines::before,
.burger-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #1c1c1c;
  border-radius: 999px;
  transition: transform 0.22s ease, top 0.22s ease, background-color 0.22s ease;
}

.burger-lines::before {
  top: -6px;
}

.burger-lines::after {
  top: 6px;
}

/* Состояние открытого бургера (крестик) */
.burger-toggle.is-open .burger-lines {
  background-color: transparent;
}

.burger-toggle.is-open .burger-lines::before {
  top: 0;
  transform: rotate(45deg);
}

.burger-toggle.is-open .burger-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Мобильные кнопки быстрых действий (Оплата, Кабинет) */
.mobile-top-actions {
  display: none;
  gap: 12px;
  align-items: center;
}

.mobile-action-btn {
  position: relative;
  width: var(--burger-size);
  height: var(--burger-size);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.mobile-action-btn img {
  width: 24px !important;
  height: 24px !important;
  opacity: 0.7;
  padding: 0 !important;
  margin: 0 !important;
}

.mobile-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

/*  Меню начало */
.topnav-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.topnav {
  width: 100%;
  max-width: 1200px;
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, .05), 0 4px 4px 0 rgba(0, 0, 0, .05), 0 10px 10px 0 rgba(0, 0, 0, .1);
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(236, 236, 241, 0.5) 0%, rgba(215, 217, 228, 0.5) 100%);
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: center;
  position: relative;
}

.topnav a {
  color: #1c1c1c;
  text-decoration: none;
  font-size: var(--menu-font-size);
  padding: 0.875rem 1.1rem;
  text-align: center;
  position: relative;
  z-index: 2;
  font-family: "firacode";
  transition: color 0.2s ease;
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: #d93b3f;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.topnav:hover .nav-indicator,
.nav-indicator.active {
  opacity: 1;
}

.topnav a:hover {
  color: #ffffff !important;
  transition: color 0.2s ease;
}

.topnav a.active {
  color: #ffffff !important;
  /* font-weight: 600; */
  position: relative;
  z-index: 2;
}

/* Показываем индикатор когда есть активный пункт */
.topnav:has(a.active) .nav-indicator {
  opacity: 1;
}

.topnav .icon {
  display: none;
  cursor: pointer;
}

/* Мобильное меню (панель) */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-menu-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  max-height: 100vh;
  overflow-y: auto;
  background: #ffffff;
  padding: 72px 20px 20px;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;

  /* Прячем скроллбар */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mobile-menu-inner::-webkit-scrollbar {
  display: none;
}

.mobile-menu-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-group img {
  height: 30px;
  opacity: 0.5;
  vertical-align: middle;
  padding-right: 8px;
}

.mobile-menu-link {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: #1c1c1c;
  font-size: var(--mobile-menu-font-size);
}

.mobile-menu-link:hover {
  color: #d93b3f;
}

.mobile-menu-separator {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid #e0e0e0;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu.is-open .mobile-menu-inner {
  transform: translateX(0);
}

body.mobile-menu-open {
  overflow: hidden;
}

/*  Адаптив меню  */
@media screen and (max-width: 1180px),
screen and (pointer: coarse) {
  .top-button {
    display: none;
  }

  .topnav-wrapper {
    display: none;
  }

  .burger-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    margin-left: 0;
  }

  .mobile-top-actions {
    display: flex;
  }

  main {
    margin-top: 90px;
  }

  h2 {
    margin-top: 15px;
  }
}