/* ============================================
   ПОЛНОСТЬЮ НОВОЕ МЕНЮ - ИЗОЛИРОВАННЫЕ СТИЛИ
   ============================================ */

/* Сброс всех стилей */
.main-menu,
.main-menu *,
.main-menu *::before,
.main-menu *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Основной контейнер меню */
.main-menu {
  padding: 18px 0 20px 0;
  height: 50px;
  background: transparent;
  width: 100%;
  position: relative;
  margin-bottom: 0px;
}

.main-menu__container {
  max-width: 1230px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Список пунктов меню */
.main-menu__list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  width: 100%;
  height: 100%;
  gap: 0;
  flex-wrap: nowrap;
}

/* Пункт меню */
.main-menu__item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}

/* Ссылка в пункте меню */
.main-menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  color: #222222;
  text-decoration: none;
  transition: color 0.3s ease;
  background: transparent;
  border: none;
  outline: none;
  white-space: nowrap;
  height: 100%;
  width: 100%;
  padding: 0;
  cursor: pointer;
}

.main-menu__link:hover {
  color: #3182ce;
  text-decoration: none;
}

.main-menu__link--active {
  color: #3182ce;
}

.main-menu__link--denied {
  opacity: 0.5;
  cursor: not-allowed;
}

.main-menu__link-text {
  display: inline-block;
}

.main-menu__link-arrow {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 4px;
}

.main-menu__link-arrow svg {
  display: block;
  width: 14px;
  height: 14px;
  position: relative;
  top: 1px;
}

/* Выпадающее меню */
.main-menu__dropdown {
  position: absolute;
  top: calc(100% + 20px);
  left: 0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
  padding: 0;
  padding-bottom: 10px;
  margin: 0;
  border-radius: 0;
  white-space: nowrap;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Псевдоэлемент для заполнения промежутка между пунктом меню и дроплистом */
.main-menu__item--has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
  z-index: 999;
  display: none;
  pointer-events: none;
}

.main-menu__item--has-dropdown:hover::after,
.main-menu__item--has-dropdown .main-menu__dropdown--open ~ *::after {
  display: block;
}

/* Показываем псевдоэлемент когда дроплист открыт */
.main-menu__item--has-dropdown:has(.main-menu__dropdown--open)::after {
  display: block;
}

.main-menu__dropdown--open {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Список элементов выпадающего меню */
.main-menu__dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
  width: 100%;
}

.main-menu__dropdown-item {
  margin: 0;
  padding: 0;
  display: block;
  width: 100%;
}

/* Ссылка в выпадающем меню */
.main-menu__dropdown-link {
  display: block;
  padding: 10px 26px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #222222;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  background: transparent;
  width: 100%;
  cursor: pointer;
}

.main-menu__dropdown-link:hover {
  background-color: #f5f5f5;
  color: #3182ce;
  text-decoration: none;
}

.main-menu__dropdown-link--active {
  background-color: #f5f5f5;
  color: #3182ce;
}

.main-menu__dropdown-link--denied {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Переопределение всех старых классов - чтобы они не влияли */
.menu.desktop .main-menu,
.menu.desktop .main-menu * {
  all: unset;
  box-sizing: border-box;
}

.menu.desktop {
  padding: 0 !important;
  height: auto !important;
  background: transparent !important;
  margin-bottom: 40px !important;
}

.menu.desktop .wrapper {
  all: unset;
  box-sizing: border-box;
}

/* Применяем стили заново после unset */
.menu.desktop .main-menu {
  padding: 18px 0 20px 0;
  height: 50px;
  background: transparent;
  width: 100%;
  position: relative;
  display: block;
}

.menu.desktop .main-menu__container {
  max-width: 1230px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.menu.desktop .main-menu__list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  width: 100%;
  height: 100%;
  gap: 0;
  flex-wrap: nowrap;
}

.menu.desktop .main-menu__item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
}

.menu.desktop .main-menu__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  color: #222222;
  text-decoration: none;
  transition: color 0.3s ease;
  background: transparent;
  border: none;
  outline: none;
  white-space: nowrap;
  height: 100%;
  width: 100%;
  padding: 0;
  cursor: pointer;
}

.menu.desktop .main-menu__link:hover {
  color: #3182ce;
  text-decoration: none;
}

.menu.desktop .main-menu__link--active {
  color: #3182ce;
}

.menu.desktop .main-menu__dropdown {
  position: absolute;
  top: calc(100% + 20px);
  left: 0;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
  padding: 0;
  padding-bottom: 10px;
  margin: 0;
  border-radius: 0;
  white-space: nowrap;
  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Псевдоэлемент для заполнения промежутка */
.menu.desktop .main-menu__item--has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
  z-index: 999;
  display: none;
  pointer-events: none;
}

.menu.desktop .main-menu__item--has-dropdown:hover::after {
  display: block;
}

/* Показываем псевдоэлемент когда дроплист открыт */
.menu.desktop
  .main-menu__item--has-dropdown:has(.main-menu__dropdown--open)::after {
  display: block;
}

.menu.desktop .main-menu__dropdown--open {
  display: block;
  opacity: 1;
  visibility: visible;
}

.menu.desktop .main-menu__dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
  width: 100%;
}

.menu.desktop .main-menu__dropdown-item {
  margin: 0;
  padding: 0;
  display: block;
  width: 100%;
}

.menu.desktop .main-menu__dropdown-link {
  display: block;
  padding: 10px 20px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #222222;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
  background: transparent;
  width: 100%;
  cursor: pointer;
}

.menu.desktop .main-menu__dropdown-link:hover {
  background-color: #f5f5f5;
  color: #3182ce;
  text-decoration: none;
}

.menu.desktop .main-menu__dropdown-link--active {
  background-color: #f5f5f5;
  color: #3182ce;
}

/* Скрытие меню на мобильных устройствах */
@media (max-width: 1024px) {
  .main-menu {
    display: none !important;
  }

  .menu.desktop .main-menu {
    display: none !important;
  }

  .menu.desktop {
    display: none !important;
  }
}
