/* Base Styles for Fly Nav Mobile Menu */
#fly-nav-mobile-menu {
    display: none; /* Hide the mobile menu by default */
}

@media (max-width: 768px) {
    /* Styles that apply only on screens 768px wide or less */

    /* Force non-sticky behavior */
    html, body {
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    body {
        position: relative; /* Set positioning context for absolute elements */
    }

    #fly-nav-mobile-menu {
        display: block; /* Show the mobile menu */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999; /* Ensure menu appears above other content */
    }

    .fnmm-header {
        position: relative;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Add subtle shadow */
    }

    /* Header Styling */
    .fnmm-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        background-color: #fff; /* Ensure consistent background */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Optional shadow */
        position: relative; /* Ensure header is positioned relative to the container */
    }

    /* Logo Styling */
    .fnmm-logo img {
        max-height: 50px;
        width: auto;
    }

    /* Icon Container Styling */
    .fnmm-icons {
        display: flex;
        align-items: center;
    }

    /* Hide Checkboxes */
    .fnmm-toggle {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    /* Menu Styling */
    .fnmm-menu {
        display: none; /* Hide menu by default */
        background-color: #fff;
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 60px; /* Adjust based on header height */
        right: 20px;
        width: 90%;
        max-width: 300px;
    }

    /* Show Menu when Checkbox is Checked */
    #fnmm-menu-toggle:checked ~ .fnmm-menu {
        display: block;
    }

    /* Menu Items Styling */
    .fnmm-menu-items {
        list-style-type: none; /* Remove bullet points */
        padding: 0;
        margin: 0;
    }

    .fnmm-menu-items li {
        padding: 10px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        position: relative;
    }

    .fnmm-menu-items li:last-child {
        border-bottom: none;
    }

    .fnmm-menu-items .sub-menu {
        display: none;
        padding-left: 20px;
        list-style-type: none; /* Remove bullet points from submenus */
        margin: 0; /* Remove default margin */
    }

    /* Remove Default Submenu Indicators from Theme */
    #fly-nav-mobile-menu .fnmm-menu-items li.menu-item-has-children > a::after {
        display: none;
    }

    /* Transitions */
    .fnmm-menu,
    .sub-menu {
        transition: all 0.3s ease-in-out;
    }

    /* Accessibility */
    .screen-reader-text {
        border: 0;
        clip: rect(1px, 1px, 1px, 1px);
        clip-path: inset(50%);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
        word-wrap: normal !important;
    }

    /* Ensure menu is hidden on larger screens */
    @media (min-width: 769px) {
        #fly-nav-mobile-menu {
            display: none;
        }
    }

    .fnmm-submenu-toggle {
        display: none;
    }
    .fnmm-submenu-label {
        display: inline-block;
        width: 30px;
        height: 30px;
        position: absolute;
        right: 0;
        top: 5px;
        cursor: pointer;
        text-align: center;
        line-height: 30px;
        transition: transform 0.3s ease;
    }
    .fnmm-menu-items .menu-item-has-children {
        position: relative;
    }
    .fnmm-menu-items .menu-item-has-children > a {
        padding-right: 40px;
    }
    .fnmm-menu-items .sub-menu {
        display: none;
    }
    .fnmm-submenu-toggle:checked ~ .sub-menu {
        display: block;
    }
    .fnmm-submenu-toggle:checked + .fnmm-submenu-label .arrow-down-symbol {
        transform: rotate(180deg);
    }
    .arrow-down-symbol {
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 9px solid #333;  /* Arrow pointing down */
        display: inline-block;
        transition: transform 0.3s ease;
    }
}