body {
    font-family: Arial, sans-serif;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

nav#menu-container {
    background: #586e75;
    position: relative;
    width: 100%;
    overflow: hidden;
}

#btn-nav-previous, #btn-nav-next {
    text-align: center;
    color: white;
    cursor: pointer;
    font-size: 24px;
    position: absolute;
    padding: 14px 20px;
    background: #8f9a9d;
    top: 0;
    height: 56px;
    z-index: 10;
}

#btn-nav-previous {
    left: 0;
}

#btn-nav-next {
    right: 0;
}

.menu-inner-box {
    width: calc(100% - 108px);
    overflow-x: auto;
    padding: 0 54px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.menu.main-menu {
    padding: 0;
    margin: 0;
    list-style-type: none;
    display: flex;
    white-space: nowrap;
}

.menu-item {
    padding: 0 25px;
    color: #fff;
    display: inline-block;
    line-height: 56px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.menu-item:hover {
    text-decoration: underline;
}

.submenu-container {
    display: none;
    width: 100%;
    background: #4b545e;
    overflow-x: auto;
}

.submenu {
    display: flex;
    white-space: nowrap;
    padding: 5px 0;
}

.submenu-item {
    padding: 0 15px;
    color: #fff;
    display: inline-block;
    line-height: 40px;
    text-decoration: none;
    white-space: nowrap;
}

.submenu-item:hover {
    text-decoration: underline;
}

.category-dropdown-menu, .nested-dropdown-menu {
    display: none;
    background: #3a3f44;
    position: fixed;
    z-index: 1000;
    list-style-type: none;
    margin: 0;
    padding: 10px 0;
    min-width: 200px;
}

.category-dropdown-menu > li, .nested-dropdown-menu > li {
    padding: 5px 15px;
}

.dropdown-item, .nested-dropdown-item {
    color: #fff;
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 5px 15px;
    cursor: pointer;
}

.dropdown-item:hover, .nested-dropdown-item:hover {
    background: #586e75;
}

@media only screen and (max-width: 768px) {
    #btn-nav-previous, #btn-nav-next {
        padding: 10px 16px;
        font-size: 20px;
    }

    .menu-inner-box {
        width: calc(100% - 84px);
    }

    .menu-item {
        padding: 0 20px;
    }
}

@media only screen and (max-width: 480px) {
    #btn-nav-previous, #btn-nav-next {
        display: none; /* Optional: hide navigation buttons on very small screens */
    }

    .menu-inner-box {
        width: 100%;
        padding: 0 10px;
    }

    .menu.main-menu {
        flex-direction: row;
    }

    .menu-item {
        padding: 0 15px;
        line-height: 56px;
    }
}

/* Ensure dropdown menu is visible on mobile */
@media only screen and (max-width: 768px) {
    .category-dropdown-menu, .nested-dropdown-menu {
        position: static;
        top: 100%; /* Position below the submenu item */
        left: 50%; /* Center horizontally */
        transform: translateX(-50%); /* Offset the left position by half its width */
        background: #4b545e;
        padding: 10px 0;
        list-style: none;
        margin: 0;
        z-index: 1000; /* Ensure it appears above other elements */
        display: block; /* Ensure visibility on mobile */
        width: 80%; /* Adjust width as needed */
        max-width: 400px; /* Optional: max width to prevent it from becoming too wide */
        box-sizing: border-box;
    }
    
    /* Adjust submenu containers for mobile */
    .submenu-container {
        width: 100%;
        overflow-x: auto; /* Enable horizontal scroll if needed */
        white-space: nowrap; /* Prevent wrapping */
    }

    .submenu {
        /* display: flex; */
        flex-wrap: nowrap; /* Ensure horizontal layout */
    }
}

