:root {
    --shell-content-bg: #f9fcfd;
}

/* ====================== ОСНОВНИЙ КОНТЕЙНЕР ====================== */
.main_container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    max-width: 1800px;
    padding: 0 8px;
    position: relative;
}

/* ====================== ГАМБУРГЕРИ БОКОВИХ МЕНЮ ====================== */
.menu-toggle {
    display: none;
}

.hamburger-btn {
    position: fixed;
    top: 12px;
    z-index: 1200;
    width: 46px;
    height: 46px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hamburger-btn:hover {
    background: #e9ecef;
}

.hamburger-btn--left {
    left: 12px;
}

.hamburger-btn--right {
/*    right: 12px;
    top: calc(var(--header-height, 52px) + 3px);*/
    right: 55px;
}

/* ====================== ОВЕРЛЕЙ ====================== */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#left-menu-toggle:checked ~ .menu-overlay--left,
#right-menu-toggle:checked ~ .menu-overlay--right {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ====================== БОКОВІ МЕНЮ ====================== */
.left_menu,
.right_menu {
    background: var(--header-bg) !important;
    border-radius: 12px;
    padding: 16px 12px;
    height: fit-content;
    overflow-y: auto;
    opacity: 1 !important;
    z-index: 1050;
    grid-row: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.left_menu a,
.right_menu a {
    color: var(--nav-link-color);
}

.left_menu a:hover,
.left_menu a:focus-visible,
.right_menu a:hover,
.right_menu a:focus-visible {
    color: var(--nav-link-hover);
}

.left_menu ul,
.right_menu ul {
    list-style: none;
    margin: 0 0 1em;
    padding-left: 1.5em;
    border-bottom: 1.5px solid darkgray;
}

.left_menu li,
.right_menu li {
    display: block;
    margin: 0 5px 0.25em;
}

.left_menu li:first-child,
.right_menu li:first-child {
    font-weight: bold;
    margin-bottom: 5px;
}

.left_menu li:last-child,
.right_menu li:last-child {
    margin-bottom: 5px;
    border-bottom: none;
}

.left_menu ul:last-child,
.right_menu ul:last-child {
    margin-bottom: 5px;
    border-bottom: none;
}

.left_menu.hidden,
.right_menu.hidden {
    display: none !important;
}

/* ====================== КОНТЕНТ ====================== */
.content_container {
    background: var(--shell-content-bg);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 200px;
    grid-column: 1;
    grid-row: 1;
    
    overflow-x: auto;
}

/* ====================== МОБІЛЬНА ВЕРСІЯ ====================== */
@media (max-width: 991px) {
    .left_menu,
    .right_menu {
        position: fixed;
        top: 0;
        bottom: 0;
        width: 270px;
        max-height: 100vh;
        height: 100vh;
        overflow-y: auto;
        padding-top: 70px;
        opacity: 1 !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .left_menu {
        left: 0;
        border-radius: 0 14px 14px 0;
        transform: translateX(-100%);
    }

    .right_menu {
        right: 0;
        border-radius: 14px 0 0 14px;
        transform: translateX(100%);
    }

    #left-menu-toggle:checked ~ .left_menu,
    #right-menu-toggle:checked ~ .right_menu {
        transform: translateX(0);
    }

    .content_container {
        grid-column: 1;
        margin: 10px 0 20px;
    }
}

/* ====================== ДЕСКТОПНА ВЕРСІЯ ====================== */
@media (min-width: 992px) {
    .main_container {
        gap: 12px;
        margin-top: 30px;
    }

    /* Лише ліве меню */
    .main_container.has-left-menu {
        grid-template-columns: 255px minmax(0, 1fr);
    }

    /* Лише праве меню */
    .main_container.has-right-menu {
        grid-template-columns: minmax(0, 1fr) 255px;
    }

    /* Ліве + праве меню */
    .main_container.has-left-menu.has-right-menu {
        grid-template-columns: 255px minmax(0, 1fr) 255px;
    }

    .left_menu,
    .right_menu {
        position: sticky;
        top: 12px;
        margin-top: 8px;
        border-radius: 12px;
        opacity: 1 !important;
    }

    .left_menu {
        grid-column: 1;
    }

    .content_container {
        grid-column: 1;
        margin-top: 8px;
    }

    .main_container.has-left-menu .content_container {
        grid-column: 2;
    }

    .right_menu {
        grid-column: 2;
    }

    .main_container.has-left-menu.has-right-menu .right_menu {
        grid-column: 3;
    }

    .hamburger-btn,
    .menu-overlay {
        display: none;
    }
}
