/* === ОБЁРТКА === */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

/* === ВЕРТИКАЛЬНОЕ МЕНЮ === */
.vertical-burger-menu {
  width: 60px;
  min-width: 60px;
  max-width: 200px;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  overflow: visible;
  position: fixed;
  left: 0;
  top: 60px;
  bottom: 0;
  z-index: 90;
  transition: width 0.3s ease;
}


.vertical-burger-menu:hover {
  width: 200px;
}

/* === ЛОГО В МЕНЮ === */
.menu-logo {
   height: 80px;
  display: flex;
  align-items: center;
  justify-content: start;
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.menu-logo img {
  max-height: 30px;
}

/* === САМ МЕНЮ СПИСОК === */
.vertical-icon-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.vertical-icon-menu li {
  width: 100%;
}

.vertical-icon-menu li a {
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 10px;
  color: var(--color-muted);
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.2s ease;
  position: relative;
}

.vertical-icon-menu li a img.menu-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* СКРЫТЬ текст */
.vertical-icon-menu li a span {
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* === ХОВЕР НА ОБЩЕЕ МЕНЮ === */
.vertical-burger-menu:hover .vertical-icon-menu li a {
  opacity: 1;
  visibility: visible;
}

.vertical-burger-menu:hover .vertical-icon-menu li a span {
  opacity: 1;
  transform: translateX(0);
}

.vertical-icon-menu li a:hover {
  background: rgba(255, 215, 0, 0.1);
  color: var(--color-accent);
}

.vertical-icon-menu li.current-menu-item a {
  color: var(--color-text);
  font-weight: bold;
}

.vertical-icon-menu li {
  width: 100%;
  overflow: visible;
}

.vertical-icon-menu li a {
  width: 100%;
  overflow: visible;
  position: relative;
}

/* === ПРАВАЯ ОБЛАСТЬ КОНТЕНТА === */
.site-content-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* === HEADER === */
.site-header {
  background: var(--color-bg);
  color: var(--color-text);
  padding: var(--padding-base) 0;
  font-family: var(--font-family);
  z-index: 100;
  position: relative;
  width: 100%;
  overflow: visible !important;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  overflow: visible !important;
  box-sizing: border-box;
  position: relative;
  z-index: 101;
}

/* === ДЕСКТОП: ХЕДЕР НА ВСЮ ШИРИНУ === */
@media (min-width: 769px) {
  .site-header {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
  }
  
  .header-inner {
    max-width: 100%;
    padding: 0 40px;
  }
}

.site-logo img {
  max-height: 48px;
}

/* === ГОРИЗОНТАЛЬНОЕ МЕНЮ === */
.scroll-nav-wrapper {
  display: flex;
  align-items: center;
  max-width: 100%;
  overflow-x: visible !important;
  overflow-y: visible !important;
  position: relative;
  z-index: 101;
}

.main-scroll-nav {
  flex-grow: 1;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: nowrap;
  position: relative;
  z-index: 101;
}

/* Прокрутка теперь на .scroll-nav-wrapper */

.scroll-nav-list {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.scroll-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 8px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 4px;
  transition: background 0.3s ease;
  z-index: 10;
}

.scroll-btn.left {
  margin-right: 5px;
}

.scroll-btn.right {
  margin-left: 5px;
}

.main-scroll-nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* === КРИТИЧНЫЕ СТИЛИ ДЛЯ МЕГАМЕНЮ === */
.main-scroll-nav li.has-mega-menu,
.main-scroll-nav li.has-megamenu {
  position: relative !important;
  overflow: visible !important;
}

/* Показываем при hover на пункт меню */
.main-scroll-nav li.has-mega-menu:hover .megamenu-panel,
.main-scroll-nav li.has-megamenu:hover .megamenu-panel {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}

.main-scroll-nav li a {
  color: var(--color-text);
  text-decoration: none;
  font-family: 'Noto Sans', var(--font-main);
  font-weight: 400;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 25px;
  background: var(--color-bg-light);
  border: 1px solid rgba(255, 215, 0, 0.2);
  transition: all 0.3s ease;
  display: inline-block;
  white-space: nowrap;
}

.main-scroll-nav li a:hover {
  background: linear-gradient(90deg, #FFD700 0%, #FFC107 100%);
  color: #1A1A1A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  border-color: #FFD700;
}

.main-scroll-nav li.current-menu-item a,
.main-scroll-nav li.current_page_item a {
  background: linear-gradient(90deg, #FFD700 0%, #FFC107 100%);
  color: #1A1A1A;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  border-color: #FFD700;
}


/* === ЯЗЫКОВОЙ ПЕРЕКЛЮЧАТЕЛЬ === */
.language-toggle {
  background: var(--color-bg-light);
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  width: 94px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  transition: all 0.3s ease;
  z-index: 10;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Расширенная область hover для плавного перехода к меню */
.language-toggle::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.language-toggle:hover {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.4);
}

.language-toggle .lang-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.language-toggle .lang-flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.language-toggle .lang-code {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.language-toggle .lang-arrow {
  color: var(--color-text);
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.language-toggle:hover .lang-arrow {
  transform: translateY(2px);
}

.language-menu {
  display: none;
  list-style: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--color-bg-light);
  padding: 10px 8px 8px 8px;
  margin-top: 2px;
  border-radius: 12px;
  white-space: nowrap;
  z-index: 1001;
  min-width: 94px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Невидимый мост между кнопкой и меню */
.language-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.language-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.language-toggle:hover .language-menu,
.language-menu:hover {
  display: block !important;
}

/* Дополнительная поддержка для десктопа */
@media (min-width: 769px) {
  .language-toggle:hover .language-menu,
  .language-toggle .language-menu:hover {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.language-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.language-menu li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.language-menu li a img {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.language-menu li a .menu-lang-code {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  color: inherit;
}

.language-menu li a:hover {
  background: rgba(255, 215, 0, 0.15);
  color: var(--color-accent);
}

.language-menu li.current-lang a {
  background: rgba(255, 215, 0, 0.1);
  color: var(--color-accent);
}

/* === МОБИЛЬНОЕ МЕНЮ === */
.burger-toggle {
  display: none;
  font-size: 24px;
  padding: 10px;
  cursor: pointer;
  user-select: none;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--color-bg-light, #121425);
  z-index: 1101;
  padding: var(--padding-base);
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.4);
  transition: right var(--transition-slow);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-base);
  transition: color var(--transition-fast);
}

.mobile-sidebar-menu li a:hover {
  color: var(--color-accent);
  background: rgba(255, 215, 0, 0.1);
  padding-left: 16px;
}

/* === OVERLAY === */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: none;
}

.menu-overlay.active {
  display: block;
}

/* === АДАПТИВ === */
@media (max-width: 768px) {
  .site-header {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100%;
  }
  
  .header-inner {
    padding: 0 12px;
    gap: 0;
    overflow: visible !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
  }
	
  .header-controls {
    display: flex;
    gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
    flex-shrink: 0;
}
 
  .main-scroll-nav {
    display: none;
  }

  .vertical-burger-menu {
    display: none;
  }

  .burger-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .site-content-area {
    margin-left: 0;
    overflow: visible;
  }

  .site-logo {
    flex-shrink: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 100px;
  }

  .site-logo a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
  }

  .site-logo img {
    max-height: 36px;
    display: block;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .language-toggle {
    flex-shrink: 0;
    flex: 0 0 auto;
  }
}
