/* Mega Menu Styles */
.mega-menu-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
    margin-left: 10px;
}

.mega-menu-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: rgb(var(--text_muted));
    transition: all 0.3s ease;
    padding: 15px 0;
    font-weight: 500;
}

.mega-menu-trigger:hover {
    color: rgb(var(--primary_color));
}

.mega-menu-trigger i {
    transition: transform 0.3s ease;
}

.mega-menu-wrapper:hover .mega-menu-trigger i {
    transform: rotate(180deg);
}

.mega-menu {
    position: fixed;
    top: 65px;
    left: 0;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    width: 100%;
    max-width: 100%;
    min-width: 800px;
    padding: 0;
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.mega-menu-wrapper:hover .mega-menu {
    opacity: 1;
    visibility: visible;
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(var(--primary_color), 1);
}

.mega-menu-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.mega-menu-item {
    transition: all 0.3s ease;
}

.mega-menu-item:hover {
    transform: translateY(-2px);
}

.mega-menu-item:hover .mega-menu-link {
    box-shadow: 0 8px 25px rgba(var(--primary_color), 0.15);
}

.mega-menu-link {
    display: flex;
    align-items: flex-start;
    padding: 30px;
    border-radius: 12px;
    text-decoration: none;
    color: rgb(var(--text_color));
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: rgba(var(--primary_color), 0.02);
}

.mega-menu-link:hover {
    background: rgba(var(--primary_color), 0.05);
    border-color: rgba(var(--primary_color), 0.1);
    color: rgb(var(--primary_color));
    text-decoration: none;
    transform: translateY(-2px);
}

.mega-menu-text {
    width: 100%;
}

.mega-menu-text h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: inherit;
    line-height: 1.3;
}

.mega-menu-text p {
    margin: 0;
    font-size: 14px;
    color: rgb(var(--text_muted));
    line-height: 1.5;
    opacity: 0.8;
}

.mega-menu-link:hover .mega-menu-text p {
    color: rgb(var(--primary_color));
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1399.98px) {
    .mega-menu {
        width: 100vw;
        max-width: 1000px;
        min-width: 700px;
        margin-left: calc(-50vw + 50%);
    }
    .mega-menu-content {
        max-width: 1000px;
    }
}

@media (max-width: 991.98px) {
    .mega-menu {
        width: 100vw;
        max-width: 800px;
        min-width: 600px;
        margin-left: calc(-50vw + 50%);
    }
    
    .mega-menu-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    
    .mega-menu-link {
        padding: 25px;
    }
    .mega-menu-content {
        max-width: 800px;
    }
}

@media (max-width: 767.98px) {
    .mega-menu {
        position: static;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        margin-top: 0;
        padding: 0 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        left: 0;
        right: 0;
    }
    
    .mega-menu::before {
        display: none;
    }
    
    .mega-menu-content {
        padding: 20px 0;
    }
    
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mega-menu-link {
        padding: 25px;
    }
    
    .mega-menu-wrapper:hover .mega-menu {
        transform: none;
    }
    
    .mega-menu-wrapper.active .mega-menu {
        max-height: 1000px;
    }
    
    .mega-menu-wrapper.active .mega-menu-trigger i {
        transform: rotate(180deg);
    }
    
    .mega-menu-trigger {
        padding: 10px 0;
    }
    
    .mega-menu-text h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }
}

@media (max-width: 575.98px) {
    .mega-menu-content {
        padding: 15px 0;
    }
    
    .mega-menu-grid {
        gap: 18px;
    }
    
    .mega-menu-link {
        padding: 22px;
    }
    
    .mega-menu-text h4 {
        font-size: 15px;
    }
    
    .mega-menu-text p {
        font-size: 13px;
    }
}

/* Animation for mega menu items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-item {
    animation: fadeInUp 0.3s ease forwards;
}

.mega-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mega-menu-item:nth-child(2) { animation-delay: 0.2s; }
.mega-menu-item:nth-child(3) { animation-delay: 0.3s; }
.mega-menu-item:nth-child(4) { animation-delay: 0.4s; }

/* Hover effects for better UX */
.mega-menu-wrapper {
    position: relative;
}

.mega-menu-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgb(var(--primary_color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mega-menu-wrapper:hover::after {
    width: 100%;
}

/* Enhanced shadow and border effects */
.mega-menu {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(var(--primary_color), 0.1);
}

/* Gradient background for mega menu */
.mega-menu::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgb(var(--primary_color)), rgb(var(--primary_color), 0.7), rgb(var(--primary_color)));
    border-radius: 12px 12px 0 0;
}

/* Smooth transitions for all interactive elements */
.mega-menu-trigger,
.mega-menu-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
