/* /home/idgrwjqh/taskit247.com/freelance/assets/css/megamenu.css */

/* Override conflicting styles from style.css */
.megamenu .dropdown-menu,
.megamenu .dropdown-submenu,
.megamenu .dropdown-submenu .dropdown-menu {
    display: none !important; /* Disable style.css dropdown styles */
}

/* Navbar styles */
.megamenu.navbar-dark {
    background-color: #28a745; /* Match bg-success */
}
.megamenu .navbar-nav {
    flex-direction: row;
    flex-wrap: nowrap; /* Prevent wrapping of level 1 categories */
    width: 100%;
}
.megamenu .nav-item {
    margin: 0 0.5rem; /* Spacing between categories */
}
.megamenu .nav-link {
    color: #ffffff !important; /* White text */
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap; /* Prevent text wrapping */
    transition: color 0.2s;
}
.megamenu .nav-link:hover,
.megamenu .nav-link.active {
    color: #ffc107 !important; /* Yellow for level 1 hover/active */
}

/* Ensure navbar doesn’t clip dropdowns */
.megamenu {
    position: relative; /* Anchor for dropdowns */
    overflow: visible !important;
}
.megamenu .navbar-collapse {
    overflow: visible !important;
}
.megamenu .container {
    position: relative;
    width: 100%; /* Full width */
}

/* Megamenu dropdown styles */
.megamenu .megamenu-item {
    position: relative; /* Anchor for level 2 dropdown */
}
.megamenu .megamenu-dropdown {
    display: none;
    position: absolute;
    left: 0; /* Align under parent by default */
    top: 100%; /* Below nav-link */
    width: 550px; /* Wider level 2 pane */
    max-height: 300px;
    overflow-y: auto; /* Vertical scrolling */
    overflow-x: hidden;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    z-index: 1002;
    padding: 10px;
}
.megamenu .megamenu-item:hover > .megamenu-dropdown {
    display: block;
}
.megamenu .open-left .megamenu-dropdown {
    left: auto;
    right: 0; /* Open to the left for right-side categories */
}
.megamenu .megamenu-list {
    list-style: none;
    padding: 10px 0 10px 15px; /* Left-aligned with padding by default */
    margin: 0;
}
.megamenu .open-left .megamenu-list {
    padding: 10px 15px 10px 0; /* Right-aligned for open-left */
    text-align: right; /* Right-align level 2 headings */
}
.megamenu .megamenu-subitem {
    position: relative;
}
.megamenu .megamenu-link {
    display: block;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.megamenu .open-left .megamenu-link {
    display: inline-block; /* Ensure right-align works */
}
.megamenu .megamenu-link:hover,
.megamenu .megamenu-link.active {
    background-color: #f8f9fa;
    color: #1d9bf0; /* X.com blue for level 2/3 */
    border-radius: 4px;
}
.megamenu .megamenu-subdropdown {
    display: none;
    position: absolute;
    top: 0;
    right: 2px; /* 2px padding from right edge of level 2 */
    min-width: 150px;
    width: auto; /* Auto-width to fit content */
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    z-index: 1003;
    padding: 10px;
}
.megamenu .open-left .megamenu-subdropdown {
    right: auto;
    left: 2px; /* Left-aligned with 2px padding for open-left */
}
.megamenu .megamenu-subparent:hover > .megamenu-subdropdown {
    display: block;
}
.megamenu .megamenu-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.megamenu .megamenu-subitem .megamenu-link {
    font-size: 0.9rem;
}

/* Mobile styles */
@media (max-width: 991px) {
    .megamenu .navbar-nav {
        flex-direction: column;
        flex-wrap: wrap;
    }
    .megamenu .nav-item {
        margin: 0.25rem 0;
    }
    .megamenu .nav-link {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
        white-space: normal;
    }
    .megamenu .nav-link:hover,
    .megamenu .nav-link.active {
        color: #ffc107 !important; /* Yellow for mobile */
    }
    .megamenu .megamenu-dropdown,
    .megamenu .megamenu-subdropdown {
        position: static;
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
        overflow-x: hidden;
        border: none;
        box-shadow: none;
        background-color: #f8f9fa;
        padding: 10px 20px;
    }
    .megamenu .megamenu-subdropdown {
        padding-left: 30px; /* Indent level 3 */
    }
    .megamenu .megamenu-list {
        padding: 10px 20px;
    }
    .megamenu .megamenu-link {
        font-size: 0.9rem;
        padding: 4px 10px;
    }
    .megamenu .megamenu-subitem .megamenu-link {
        font-size: 0.85rem;
    }
}