/* ============================================ */
/*              ПОЛНЫЙ CSS ДЛЯ МЕНЮ              */
/* ============================================ */

.menu-top, .menu-top *, .sub-menu-top, .sub-menu-top *, .pushy, .pushy * {
    box-sizing: border-box;
}

/* ===== БУРГЕР ===== */
.menu-btn {
    display: none;
    width: 44px;
    height: 38px;
    cursor: pointer;
    z-index: 10001;
    border: 2px solid #0088f5;
    border-radius: 6px;
    background-color: rgba(0, 136, 245, 0.15);
    background-image: url(/local/templates/main/components/bitrix/menu/menu-top/images/iii-line.gif);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px 24px;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    transform: scale(0.9);
    background-color: rgba(0, 136, 245, 0.3);
}

/* ===== ДЕСКТОПНОЕ МЕНЮ ===== */
.menu-top-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0088f5 #e3e3e3;
    margin: 0 10px;
}

.menu-top-wrapper::-webkit-scrollbar { height: 4px; }
.menu-top-wrapper::-webkit-scrollbar-track { background: #e3e3e3; border-radius: 4px; }
.menu-top-wrapper::-webkit-scrollbar-thumb { background: #0088f5; border-radius: 4px; }

.menu-top {
    font-size: 0;
    padding: 0 20px;
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-bottom: 2px solid #0088f5;
    box-shadow: 0 4px 20px rgba(0, 136, 245, 0.08);
    border-radius: 0 0 12px 12px;
    white-space: nowrap;
    overflow: visible;
    text-align: left;
}

.menu-top__item {
    border-left: 1px solid #e3e3e3;
    display: inline-block;
    height: 44px;
    line-height: 44px;
    position: relative;
    transition: all 0.3s ease;
}

.menu-top__item:first-child { border-left: none; }

.menu-top__link {
    padding: 0 18px;
    font: 600 15px/44px "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    text-decoration: none;
    color: #3f3f3f;
    display: inline-block;
    letter-spacing: 0.3px;
    position: relative;
    transition: all 0.3s ease;
}

.menu-top__link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 3px;
    background: #0088f5;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
}

.menu-top__item:hover .menu-top__link::after { width: 60%; }
.menu-top__item:hover .menu-top__link { color: #0088f5; transform: translateY(-1px); }

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ (ДЕСКТОП) ===== */
.sub-menu-top {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.menu__info { display: none; }

.menu-top__item:hover .sub-menu-top {
    display: block;
    position: absolute;
    z-index: 100;
    top: 44px;
    left: 0;
    right: auto;
    background: #ffffff;
    border-radius: 16px;
    min-width: 220px;
    padding: 8px 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,136,245,0.06);
    animation: slideDown 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    text-align: left;
}

/* Последние пункты: выпадашка уходит влево, чтобы не вылезти за экран */
.menu-top__item:nth-last-child(-n+5):hover .sub-menu-top {
    left: auto;
    right: 0;
}

@keyframes slideDown {
    0%   { opacity: 0; transform: scale(0.95) translateY(-10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-top__item:hover .sub-menu-top::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    right: auto;
    transform: rotate(45deg);
    width: 16px; height: 16px;
    background: #ffffff;
    box-shadow: -3px -3px 8px rgba(0,0,0,0.04);
    border-radius: 3px 0 0 0;
}

.menu-top__item:nth-last-child(-n+5):hover .sub-menu-top::before {
    left: auto;
    right: 20px;
}

.sub-menu-top__item {
    padding: 0;
    font: 400 15px/20px "Open Sans", -apple-system, sans-serif;
    list-style: none;
    white-space: nowrap;
    text-align: left;
    border-left: 3px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sub-menu-top__item:first-child { border-radius: 16px 16px 0 0; }
.sub-menu-top__item:last-child  { border-radius: 0 0 16px 16px; }
.sub-menu-top__item:hover { background: #f5f9ff; border-left-color: #0088f5; }

.sub-menu-top__link {
    display: block;
    padding: 12px 24px;
    text-decoration: none;
    color: #3f3f3f;
    letter-spacing: 0.3px;
    text-align: left;
    transition: color 0.25s ease, padding-left 0.25s ease;
}

/* Стрелка: в покое занимает 0 места, при наведении плавно выезжает */
.sub-menu-top__link::before {
    content: '▸';
    display: inline-block;
    width: 0;
    margin-right: 0;
    opacity: 0;
    overflow: hidden;
    color: #0088f5;
    vertical-align: middle;
    transition: width 0.25s ease, opacity 0.25s ease, margin-right 0.25s ease;
}

/* При наведении: стрелка появляется, пункт чуть правее */
.sub-menu-top__item:hover .sub-menu-top__link {
    color: #0088f5;
    padding-left: 30px;
}

.sub-menu-top__item:hover .sub-menu-top__link::before {
    width: 12px;
    opacity: 1;
    margin-right: 6px;
}

@media screen and (max-width: 1279px) {
    .menu-top__link { padding: 0 14px; font-size: 14px; }
}

/* ============================================ */
/*              МОБИЛЬНАЯ ВЕРСИЯ                */
/* ============================================ */
@media screen and (max-width: 1023px) {

    .menu-top-wrapper { display: none !important; margin: 0; }

    /* ===== БУРГЕР СПРАВА ===== */
    .menu-btn {
        display: block !important;
        position: fixed;
        right: 10px;
        top: 10px;
        left: auto;
        z-index: 10001;
    }

    .pushy-open-right .menu-btn {
        background-image: url(/local/templates/main/components/bitrix/menu/menu-top/images/iii-line_white.gif);
        background-color: rgba(255,255,255,0.1) !important;
        border-color: #ffffff !important;
    }

    /* ===== ПАНЕЛЬ СПРАВА ===== */
    .pushy {
        position: fixed;
        width: 280px; height: 100%;
        top: 0; right: 0;
        z-index: 9999;
        background: #191918;
        visibility: hidden;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        padding: 60px 0 40px;
        box-shadow: -4px 0 40px rgba(0,0,0,0.3);
        transform: translate3d(280px, 0, 0);
        transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
        text-align: left;
    }

    .pushy-open-right .pushy { transform: translate3d(0, 0, 0); visibility: visible; }

    .pushy-open-right #container,
    .pushy-open-right .push { transform: translate3d(-280px, 0, 0); }

    #container, .push { transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1); }

    /* ===== 1-Й УРОВЕНЬ ===== */
    .pushy .menu-top {
        display: block !important;
        padding: 0; margin: 0;
        background: transparent;
        border: none; box-shadow: none; border-radius: 0;
        white-space: normal;
        overflow: visible;
    }

    .pushy .menu-top__item {
        display: block !important;
        width: 100%;
        height: auto;
        line-height: normal;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    .pushy .menu-top__item:hover { background: rgba(255,255,255,0.04); }

    .pushy .menu-top__link {
        display: block !important;
        color: #ffffff !important;
        font: 600 16px/1.4 "Open Sans", sans-serif !important;
        padding: 15px 50px 15px 20px !important;
        letter-spacing: 0.3px;
        text-decoration: none;
        text-align: left;
        transform: none !important;
    }

    .pushy .menu-top__link::after { display: none !important; }

    /* ===== ШЕВРОН У РОДИТЕЛЕЙ ===== */
    .pushy .pushy-submenu > a { position: relative; }

    .pushy .pushy-submenu > a.pushy-submenu-toggle::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 20px;
        width: 8px; height: 8px;
        border-right: 2px solid #8a8a88;
        border-bottom: 2px solid #8a8a88;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.3s ease, border-color 0.3s ease;
    }

    .pushy .pushy-submenu-open > a.pushy-submenu-toggle::after {
        transform: translateY(-50%) rotate(-135deg);
        border-color: #0088f5;
    }

    /* ===== ВЛОЖЕННЫЕ СПИСКИ (АККОРДЕОН) ===== */
    .pushy .sub-menu-top,
    .pushy .pushy-submenu ul {
        display: block !important;
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        max-height: 0;
        overflow: hidden;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none;
        width: 100%;
        min-width: 0 !important;
        background: rgba(255,255,255,0.035) !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: none !important;
        transform: none;
        text-align: left;
        transition: max-height 0.35s ease;
    }

    .pushy .sub-menu-top::before { display: none !important; }

    .pushy .pushy-submenu-open > .sub-menu-top,
    .pushy .pushy-submenu-open > ul {
        max-height: 1000px;
    }

    /* Пункты вложенных списков */
    .pushy .sub-menu-top li,
    .pushy .pushy-submenu ul li {
        list-style: none;
        margin: 0;
        padding: 0;
        white-space: normal;
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        border-radius: 0 !important;
        background: transparent !important;
    }

    .pushy .sub-menu-top li:last-child,
    .pushy .pushy-submenu ul li:last-child { border-bottom: none; }

    /* Ссылки вложенных списков: flex — маркер НЕ МОЖЕТ наехать на текст */
    .pushy .sub-menu-top__link {
        display: flex !important;
        align-items: center;
        padding: 12px 16px 12px 18px !important;
        color: #b9b9b7 !important;
        font: 400 14px/1.45 "Open Sans", sans-serif !important;
        letter-spacing: 0.2px;
        text-decoration: none;
        text-align: left;
        white-space: normal;
        transition: color 0.2s ease, background 0.2s ease;
    }

    /* Маркер › */
    .pushy .sub-menu-top__link::before {
        content: '›' !important;
        display: inline-block;
        flex: 0 0 auto;
        width: auto !important;
        opacity: 1 !important;
        overflow: visible !important;
        margin: 0 9px 0 0 !important;
        color: #0088f5;
        font-size: 17px;
        line-height: 1;
    }

    /* Отступ для 3-го уровня */
    .pushy .pushy-submenu ul ul .sub-menu-top__link {
        padding-left: 34px !important;
    }

    /* Ховер вложенных пунктов */
    .pushy .sub-menu-top__item:hover .sub-menu-top__link,
    .pushy .sub-menu-top li:hover > .sub-menu-top__link {
        color: #ffffff !important;
        background: rgba(0,136,245,0.10);
        padding-left: 18px !important;
    }

    .pushy .pushy-submenu ul ul .sub-menu-top__item:hover .sub-menu-top__link {
        padding-left: 34px !important;
    }

    /* ===== ИНФО-БЛОК ===== */
    .pushy .menu__info {
        display: block !important;
        list-style: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        margin-top: 30px;
        padding: 24px 20px 20px;
        color: #888887;
        font-size: 14px;
        font-family: "Open Sans", sans-serif;
        letter-spacing: 0.3px;
        line-height: 1.6;
    }

    .pushy .menu__info a {
        color: #b3b3b1;
        text-decoration: none;
        transition: color 0.2s ease;
        display: inline;
        padding: 0;
    }

    .pushy .menu__info a:hover { color: #0088f5; background: transparent; }

    /* ===== ОВЕРЛЕЙ ===== */
    .site-overlay { display: none; }

    .pushy-open-right .site-overlay {
        display: block !important;
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: 9998;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
}