/* ==========================================================================
   Mega Menu - True Full-Width (Edge-to-Edge) Fix
   ========================================================================== */

/* Prevent horizontal scrollbar on body */
html, body {
    overflow-x: hidden !important;
}

.mega-menu-wrapper {
    position: static !important;
}

/* Mega Menu Panel - Forced Viewport Full Width */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50% !important;
    transform: translateX(-50%) translateY(15px) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 50px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
    border-top: 3px solid #6c63ff;
    box-sizing: border-box;
    margin: 0 !important;
}

/* Hover / Active State */
.mega-menu-wrapper:hover .mega-menu,
.mega-menu-wrapper.active .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) !important;
}

/* Content Layout Inside Full Width Panel */
.mega-menu .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.mega-menu .row {
    margin: 0 -15px;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.mega-menu .col-lg-3 {
    padding: 0 15px;
    flex: 0 0 25%;
    max-width: 25%;
    box-sizing: border-box;
}

/* Headings & Text Styles */
.mega-menu h5 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-menu h5::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: linear-gradient(90deg, #6c63ff, #3f3d9e);
    border-radius: 2px;
}

/* Menu Items */
.mega-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu ul li {
    margin-bottom: 14px;
}

.mega-menu ul li a {
    color: #555;
    text-decoration: none;
    font-size: 14.5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
}

.mega-menu ul li a:hover {
    color: #6c63ff;
    transform: translateX(8px);
    border-bottom-color: rgba(108, 99, 255, 0.1);
}

.mega-menu ul li a .icon {
    width: 32px;
    height: 32px;
    background: #f5f5ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c63ff;
    font-size: 15px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mega-menu ul li a:hover .icon {
    background: #6c63ff;
    color: #fff;
    transform: scale(1.05);
}

/* Featured Service Box */
.mega-menu .featured-service {
    background: linear-gradient(135deg, #6c63ff, #3f3d9e);
    color: #fff;
    padding: 30px 25px;
    border-radius: 12px;
    height: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.mega-menu .featured-service h5 {
    color: #fff;
    margin-bottom: 20px;
}

.mega-menu .featured-service h5::after {
    background: #fff;
}

.mega-menu .featured-service ul li a {
    color: rgba(255,255,255,0.9);
}

.mega-menu .featured-service ul li a:hover {
    color: #fff;
    transform: translateX(8px);
}

.mega-menu .featured-service ul li a .icon {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.mega-menu .featured-service ul li a:hover .icon {
    background: #fff;
    color: #6c63ff;
    transform: scale(1.05);
}

/* Dark Mode */
.index-dark .mega-menu {
    background: #1a1a2e;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.index-dark .mega-menu h5 {
    color: #fff;
}

.index-dark .mega-menu ul li a {
    color: #b0b0c0;
}

.index-dark .mega-menu ul li a:hover {
    color: #6c63ff;
}

.index-dark .mega-menu ul li a .icon {
    background: rgba(255,255,255,0.05);
    color: #6c63ff;
}

.index-dark .mega-menu ul li a:hover .icon {
    background: #6c63ff;
    color: #fff;
}

/* Responsive (Tablet & Mobile) */
@media (max-width: 991px) {
    .mega-menu {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        padding: 30px 0;
        box-shadow: none;
        border-radius: 0;
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent;
        min-height: auto;
        border-top: none;
    }

    .mega-menu .container {
        padding: 0 15px;
    }

    .mega-menu .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 30px;
    }

    .mega-menu-wrapper:hover .mega-menu {
        transform: none !important;
    }

    .index-dark .mega-menu {
        background: transparent;
    }

    .mega-menu .featured-service {
        min-height: auto;
    }
}

@media (max-width: 576px) {
    .mega-menu .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}