/* Сайдбар: мобилка — нативный скролл; десктоп — SimpleBar без лишней пустоты */
@media (max-width: 991.98px) {
    #sidebarMenu.sidebar {
        height: 100vh;
        max-height: 100vh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #sidebarMenu .simplebar-wrapper,
    #sidebarMenu .simplebar-mask,
    #sidebarMenu .simplebar-offset {
        position: static !important;
        height: auto !important;
        overflow: visible !important;
    }

    #sidebarMenu .simplebar-content-wrapper {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #sidebarMenu .simplebar-content {
        min-height: 0 !important;
    }

    #sidebarMenu .simplebar-placeholder,
    #sidebarMenu .simplebar-track,
    #sidebarMenu .simplebar-height-auto-observer-wrapper {
        display: none !important;
    }

    #sidebarMenu .sidebar-inner {
        overflow: visible !important;
        padding-bottom: 5rem;
    }

    #sidebarMenu .sidebar-logo {
        display: block;
        width: auto;
        max-width: 72%;
        height: auto;
        max-height: 52px;
        margin: 0 auto 0.75rem;
        object-fit: contain;
    }
}

@media (min-width: 992px) {
    #sidebarMenu[data-simplebar] {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    #sidebarMenu .simplebar-wrapper,
    #sidebarMenu .simplebar-mask {
        height: 100%;
    }

    #sidebarMenu .simplebar-content-wrapper {
        height: 100% !important;
        max-height: 100%;
    }

    #sidebarMenu .simplebar-content {
        min-height: 0 !important;
    }

    #sidebarMenu .sidebar-inner {
        overflow: visible !important;
    }
}

/* Стили для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(159, 159, 160, 0.3) transparent;
}

/* Стили для IE/Edge */
* {
    -ms-overflow-style: auto;
}

/* Дополнительные стили для лучшей видимости */
.simplebar-track {
    background: transparent !important;
}

.simplebar-scrollbar {
    background: transparent !important;
}

/* Анимация появления скроллбара */
.simplebar-scrollbar:before {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Sidebar language selector (Google Translate) */
.sidebar-language-item {
    margin-bottom: 0.2rem;
}

.sidebar-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
}

.sidebar-language-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #9ca3af;
    font-size: 1.125rem;
}

.sidebar-language #google_translate_element {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#sidebarMenu #google_translate_element,
#sidebarMenu #google_translate_element > div {
    min-height: 0;
    height: auto;
}

#sidebarMenu #google_translate_element iframe {
    display: none !important;
    height: 0 !important;
}

.sidebar-language .goog-te-gadget {
    font-family: inherit !important;
    color: #e5e7eb !important;
    font-size: 0 !important;
}

.sidebar-language .goog-te-gadget > span {
    display: none !important;
}

.sidebar-language .goog-te-combo {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #e5e7eb;
    background-color: #374151;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.25rem;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sidebar-language .goog-te-combo:hover {
    background-color: #4b5563;
    border-color: #6b7280;
}

.sidebar-language .goog-te-combo:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.25);
}

.sidebar-language .goog-te-combo option {
    background-color: #374151;
    color: #e5e7eb;
}

.sidebar.contracted .sidebar-language {
    flex-direction: column;
    padding: 0.55rem 0.5rem;
    gap: 0.35rem;
}

.sidebar.contracted .sidebar-language .goog-te-combo {
    padding: 0.45rem 1.75rem 0.45rem 0.5rem;
    font-size: 0.75rem;
} 