/* Position the submenu container relative to its parent item */
.dropdown-submenu {
    position: relative;
}

/* Hide the submenu by default and pull it to the right side */
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: -1px;
    border-radius: 0 6px 6px 6px;
}

/* OPTIONAL: Show the submenu on hover */
@media (min-width: 768px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
}

/* Add a right-facing arrow indicator to show a submenu exists */
.dropdown-submenu > a:after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 0 5px 5px;
    border-left-color: #ccc;
    margin-top: 5px;
    margin-right: -10px;
}

/* Change arrow color when hovering over the parent item */
.dropdown-submenu:hover > a:after {
    border-left-color: #fff;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 767px) {
    /* 1. Reset positioning so it expands downward instead of right */
    .dropdown-submenu > .dropdown-menu {
        position: relative;
        top: 0;
        left: 0;
        float: none;
        width: 100%;
        box-shadow: none;
        border: 0;
        margin-top: 0;
        margin-left: 0;
        background-color: rgba(0, 0, 0, 0.05); /* Gives a slight indentation background */
    }

    /* 2. Rotate or change the caret arrow downward for mobile */
    .dropdown-submenu > a:after {
        border-width: 5px 5px 0 5px;
        border-top-color: #ccc;
        border-left-color: transparent;
        margin-top: 8px;
    }

    .dropdown-submenu:hover > a:after {
        border-top-color: #555;
        border-left-color: transparent;
    }
}

