/* ================================================
   OFFCANVAS MENU - Мобильное меню
   ================================================ */

/* Overlay (затемнение фона) */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
    cursor: pointer;
}
.offcanvas-nav .has-submenu.active .submenu {
    display: block;
    max-height: 500px;
}
.offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Само offcanvas меню */
.offcanvas-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Скрыто справа */
    width: 90%;
    max-width: 85%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(0);
    transition: right 0.3s ease;
       z-index: 9999;
    overflow-y: auto;
}

.offcanvas-menu.active {
    left: 0; /* Выезжает */
}

/* Шапка меню */
.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.offcanvas-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Кнопка закрытия */
.offcanvas-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.offcanvas-close:hover {
    color: #333;
}

/* Тело меню */
.offcanvas-body {
    padding: 0;
}

/* Навигация */
.offcanvas-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.offcanvas-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.offcanvas-nav a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.3s ease, padding-left 0.3s ease;
}

.offcanvas-nav a:hover {
    background: #f8f8f8;
    padding-left: 30px;
}

.offcanvas-nav a.active {
    color: #007bff;
    font-weight: 600;
}

/* Подменю */
.offcanvas-nav .submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: #f8f8f8;
}

.offcanvas-nav .submenu.active {
    display: block;
}

.offcanvas-nav .submenu a {
    padding-left: 40px;
    font-size: 14px;
}

.offcanvas-nav .has-submenu > a {
    position: relative;
    padding-right: 50px;
}

.offcanvas-nav .has-submenu > a::after {
    content: '▼';
    position: absolute;
    right: 20px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.offcanvas-nav .has-submenu.active > a::after {
    transform: rotate(180deg);
}

/* Футер меню (опционально) */
.offcanvas-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.offcanvas-footer .social-links {
    display: flex;
    gap: 15px;
}

.offcanvas-footer .social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    transition: background 0.3s ease;
}

.offcanvas-footer .social-links a:hover {
    background: #007bff;
    color: #fff;
}

/* Блокировка скролла body когда меню открыто */
body.offcanvas-open {
    overflow: hidden;
}

/* Адаптивность */
@media (min-width: 992px) {
    /* На десктопе можно скрыть кнопку меню */
    .menu-toggle-btn {
        display: none;
    }
}
