/* Mobile Side Drawer Custom Styles - Refined */
@media (max-width: 991.98px) {

    /* Target via ID for higher specificity and override standard classes */
    #ftco-nav.navbar-collapse {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        /* Start fully off-screen */
        width: 60% !important;
        /* Drawer width - reduced size */
        max-width: 250px !important;
        height: 100vh !important;
        background-color: #000000 !important;
        /* Force Black Background */
        z-index: 9999 !important;
        /* Highest Z-index */
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease !important;
        padding-top: 60px !important;
        /* Space for top */
        padding-left: 30px !important;
        padding-right: 30px !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5) !important;
        display: block !important;
        /* Force block to ensure it exists for transition */
        opacity: 0 !important;
        visibility: hidden !important;
        overflow-y: auto !important;
    }

    /* Active State - When 'show' class is added by Bootstrap toggler */
    #ftco-nav.navbar-collapse.show {
        right: 0 !important;
        /* Slide in */
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8) !important;
    }

    /* Handling the 'collapsing' state during transition */
    #ftco-nav.navbar-collapse.collapsing {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        /* Override BS inline height */
        background-color: #000000 !important;
        z-index: 9999 !important;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1) !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Nav Links Styling inside the drawer */
    #ftco-nav .navbar-nav {
        width: 100% !important;
        margin-top: 40px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #ftco-nav .nav-item {
        margin: 15px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        opacity: 1 !important;
        /* Ensure visible */
    }

    /* Link Colors - fix white on white */
    #ftco-nav .nav-link {
        color: #ffffff !important;
        /* Force white text */
        font-family: "Poppins", sans-serif !important;
        font-size: 20px !important;
        font-weight: 500 !important;
        padding-bottom: 15px !important;
        display: block !important;
    }

    #ftco-nav .nav-link span {
        color: #ffffff !important;
    }

    #ftco-nav .nav-link:hover,
    #ftco-nav .nav-item.active .nav-link {
        color: #3e64ff !important;
        /* Accent color on hover */
        padding-left: 10px !important;
        transition: all 0.3s ease !important;
    }

    /* Close Button (using pseudo-element since we can't easily add HTML) */
    /* This creates a visual indicator that it's a separate panel */
    #ftco-nav::before {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.4s;
        pointer-events: none;
    }

    #ftco-nav.show::before {
        opacity: 1;
        left: -100vw;
        /* Attempt to cover the rest of the screen - simplistic approach */
        width: 200vw;
    }
}