/* ========================================================================
   УНИФИЦИРОВАННЫЕ СТИЛИ МЕНЮ - ЕДИНАЯ СКОРОСТЬ АНИМАЦИИ
   ======================================================================== */

/* ========================================================================
   ЕДИНАЯ СКОРОСТЬ АНИМАЦИИ ДЛЯ ВСЕХ КНОПОК МЕНЮ - 0.4s
   ======================================================================== */

/* УНИВЕРСАЛЬНЫЕ ПЕРЕХОДЫ - 0.4s ДЛЯ ВСЕХ КНОПОК МЕНЮ */
html body .header__nav.decst .header__link:not(.online-btn),
html body .header__popover .popover__link,
html body .header__popover2 .popover__link,
html body .header__popover3 .popover__link,
html body .popover__item.has-children .popover__link,
html body .popover__list.sublist .popover__link {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: scale(1) !important;
}

/* УНИВЕРСАЛЬНЫЕ HOVER ЭФФЕКТЫ - ОДИНАКОВЫЕ ДЛЯ ВСЕХ */
html body .header__nav.decst .header__link:not(.online-btn):hover,
html body .header__popover .popover__link:hover,
html body .header__popover2 .popover__link:hover,
html body .header__popover3 .popover__link:hover,
html body .popover__item.has-children .popover__link:hover,
html body .popover__list.sublist .popover__link:hover {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* ========================================================================
   СТИЛИ ВЕРХНЕГО ГОРИЗОНТАЛЬНОГО МЕНЮ
   ======================================================================== */

/* ВЕРХНЕЕ МЕНЮ - полупрозрачные кнопки с синей рамочкой */
html body .header__nav.decst .header__link:not(.online-btn) {
    display: inline-block !important;
    padding: 10px 16px !important;
    margin: 0 2px !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid #1b377b !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    color: #333333 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    position: relative !important;
    overflow: hidden !important;
}

html body .header__nav.decst .header__link:not(.online-btn):hover {
    background: rgba(255, 255, 255, 0.45) !important;
    color: #222222 !important;
    text-decoration: none !important;
}

/* ========================================================================
   СТИЛИ ВЫПАДАЮЩИХ МЕНЮ
   ======================================================================== */

/* Основные выпадающие меню - стеклянный эффект */
.header__popover,
.header__popover2,
.header__popover3 {
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(50px) saturate(180%) brightness(120%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(180%) brightness(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Кнопки в выпадающих меню с синей рамочкой */
html body .header__popover .popover__link,
html body .header__popover2 .popover__link,
html body .header__popover3 .popover__link {
    background: rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border: 1px solid #1b377b !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    margin: 4px 0 !important;
    padding: 12px 16px !important;
    transform: scale(1) !important;
    position: relative !important;
    z-index: 1 !important;
}

html body .header__popover .popover__link:hover,
html body .header__popover2 .popover__link:hover,
html body .header__popover3 .popover__link:hover {
    background: rgba(255, 255, 255, 0.45) !important;
}

/* ========================================================================
   СТИЛИ ПОДМЕНЮ
   ======================================================================== */

/* Родительские элементы с подменю */
.popover__item.has-children {
    position: relative !important;
}

.popover__item.has-children .popover__link {
    font-weight: 700 !important;
    padding-left: 20px !important;
    border: 1px solid #1b377b !important;
}

/* Стрелочки */
.popover__item.has-children>.popover__link::after {
    content: "" !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid #999999 !important;
    border-top: 4px solid transparent !important;
    border-bottom: 4px solid transparent !important;
    transition: transform 0.4s ease, border-left-color 0.4s ease !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
    background: none !important;
}

.popover__item.has-children:hover>.popover__link::after {
    border-left-color: #666666 !important;
    transform: translateY(-50%) rotate(90deg) !important;
}

/* Подменю - сильное матовое стекло с увеличенными отступами */
html body .popover__list.sublist {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 99999 !important;
    background: rgba(255, 255, 255, 0.425) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 20px !important;
    padding: 25px !important;
    width: max-content !important;
    min-width: 400px !important;
    max-width: 700px !important;
    display: none !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(153, 153, 153, 0.6) rgba(255, 255, 255, 0.1) !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* Псевдоэлемент для backdrop-filter эффекта подменю - УНИВЕРСАЛЬНЫЙ СЕЛЕКТОР */
.sublist::before,
.popover__list.sublist::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(50px) saturate(180%) brightness(120%) !important;
    -webkit-backdrop-filter: blur(50px) saturate(180%) brightness(120%) !important;
    border-radius: inherit !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

/* Backdrop-filter для подменю теперь управляется в header-menu.css */

/* Показываем подменю при наведении с задержкой исчезновения */
.popover__item.has-children:hover .popover__list.sublist,
.popover__list.sublist:hover {
    display: block !important;
}

/* Задержка исчезновения подменю */
.popover__item.has-children .popover__list.sublist {
    transition-delay: 0s !important;
}

.popover__item.has-children:not(:hover) .popover__list.sublist {
    transition-delay: 1s !important;
}

/* Контейнер колонок подменю */
.popover__list.sublist .popover__columns {
    display: flex !important;
    gap: 40px !important;
    align-items: flex-start !important;
}

/* Колонки подменю - БЕЗ СБРОСА BACKDROP-FILTER */
.popover__list.sublist .popover__list.sublist-column {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 250px !important;
    max-width: 250px !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Элементы подменю */
.popover__list.sublist .popover__item {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* Ссылки подменю с синей рамочкой */
html body .popover__list.sublist .popover__link {
    display: block !important;
    padding: 10px 15px !important;
    margin: 6px 0 !important;
    color: #454545 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid #1b377b !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transform: scale(1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    z-index: 10000 !important;
}

html body .popover__list.sublist .popover__link:hover {
    color: #454545 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.08) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ========================================================================
   СТИЛИЗАЦИЯ ПОЛОСЫ ПРОКРУТКИ
   ======================================================================== */

.popover__list.sublist::-webkit-scrollbar {
    width: 8px !important;
}

.popover__list.sublist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
}

.popover__list.sublist::-webkit-scrollbar-thumb {
    background: rgba(153, 153, 153, 0.6) !important;
    border-radius: 4px !important;
    transition: background 0.4s ease !important;
}

.popover__list.sublist::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 102, 102, 0.8) !important;
}

/* ========================================================================
   ТЕМНАЯ ТЕМА
   ======================================================================== */

/* Темная тема для верхнего меню */
body.dark-theme .header__nav.decst .header__link:not(.online-btn) {
    background: rgba(30, 41, 59, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--text-primary) !important;
    transform: scale(1) !important;
}

body.dark-theme .header__nav.decst .header__link:not(.online-btn):hover {
    background: rgba(30, 41, 59, 0.45) !important;
    color: #ffffff !important;
}

/* Темная тема для выпадающих меню */
body.dark-theme .header__popover,
body.dark-theme .header__popover2,
body.dark-theme .header__popover3 {
    background: rgba(10, 25, 41, 0.425) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .header__popover .popover__link,
body.dark-theme .header__popover2 .popover__link,
body.dark-theme .header__popover3 .popover__link {
    background: rgba(30, 41, 59, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    transform: scale(1) !important;
    position: relative !important;
    z-index: 1 !important;
}

body.dark-theme .header__popover .popover__link:hover,
body.dark-theme .header__popover2 .popover__link:hover,
body.dark-theme .header__popover3 .popover__link:hover {
    background: rgba(30, 41, 59, 0.45) !important;
}

/* Темная тема для подменю */
body.dark-theme .popover__list.sublist {
    background: rgba(10, 25, 41, 1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    scrollbar-color: rgba(203, 213, 225, 0.6) rgba(30, 41, 59, 0.3) !important;
}

body.dark-theme .popover__list.sublist::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3) !important;
}

body.dark-theme .popover__list.sublist::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.6) !important;
}

body.dark-theme .popover__list.sublist::-webkit-scrollbar-thumb:hover {
    background: rgba(203, 213, 225, 0.8) !important;
}

body.dark-theme .popover__list.sublist .popover__link {
    color: var(--text-primary) !important;
    background: rgba(30, 41, 59, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1) !important;
    position: relative !important;
    z-index: 10000 !important;
}

body.dark-theme .popover__list.sublist .popover__link:hover {
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, 0.45) !important;
}

/* ========================================================================
   СКРЫТИЕ ОРИГИНАЛЬНЫХ СТРЕЛОЧЕК
   ======================================================================== */

.has-children-indicator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
    background: none !important;
    border: none !important;
    position: static !important;
}

/* ========================================================================
   БЛОКИРОВКА СИНИХ КВАДРАТИКОВ
   ======================================================================== */

html body .header__popover .popover__item.has-children>.popover__link:first-of-type::before,
html body .header__popover2 .popover__item.has-children>.popover__link:first-of-type::before,
html body .header__popover3 .popover__item.has-children>.popover__link:first-of-type::before,
html body .popover__list .popover__item.has-children>.popover__link:first-of-type::before,
html body .popover__columns .popover__item.has-children>.popover__link:first-of-type::before {
    display: none !important;
    content: none !important;
    border: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    background-color: transparent !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: static !important;
}

/* Исключение для наших новых стрелочек */
html body .header__popover .popover__item.has-children>.popover__link::after,
html body .header__popover2 .popover__item.has-children>.popover__link::after,
html body .header__popover3 .popover__item.has-children>.popover__link::after,
html body .popover__list .popover__item.has-children>.popover__link::after,
html body .popover__columns .popover__item.has-children>.popover__link::after {
    content: "" !important;
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid #999999 !important;
    border-top: 4px solid transparent !important;
    border-bottom: 4px solid transparent !important;
    transition: transform 0.4s ease, border-left-color 0.4s ease !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
    background: none !important;
}

html body .header__popover .popover__item.has-children:hover>.popover__link::after,
html body .header__popover2 .popover__item.has-children:hover>.popover__link::after,
html body .header__popover3 .popover__item.has-children:hover>.popover__link::after,
html body .popover__list .popover__item.has-children:hover>.popover__link::after,
html body .popover__columns .popover__item.has-children:hover>.popover__link::after {
    border-left-color: #666666 !important;
    transform: translateY(-50%) rotate(90deg) !important;
}