/* TreeVallei Mega Menu Styles */
.treevallei-mega-menu-item {
    position: relative;
}

/* Add hover delay to prevent accidental triggers */
.treevallei-mega-menu-item:hover .treevallei-mega-menu {
    transition-delay: 0.1s;
}

.treevallei-mega-menu-item .treevallei-mega-menu {
    transition-delay: 0s;
}

.treevallei-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    min-width: 800px;
    max-width: 1140px;
    padding: 25px;
    margin-top: -15px;
    border-top: 3px solid #08154A;
}

.treevallei-mega-menu-item:hover .treevallei-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Add a subtle connection between menu item and dropdown */
.treevallei-mega-menu::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid #08154A;
}

.treevallei-mega-menu-container {
    display: flex;
    gap: 35px;
    align-items: flex-start;
}

.treevallei-mega-menu-column {
    flex: 1;
    min-width: 180px;
}

.treevallei-mega-menu-column:first-child {
    flex: 0 0 200px;
    border-right: 1px solid #e8e8e8;
    padding-right: 25px;
    margin-right: 10px;
}

.treevallei-mega-menu-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.treevallei-mega-menu-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: #08154A;
    border-radius: 1px;
}

.treevallei-mega-menu-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #08154A;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: 'Poppins', sans-serif;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 8px;
}

.treevallei-menu-image {
    width: 100%;
    max-width: 160px;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    transition: transform 0.3s ease;
}

.treevallei-menu-image:hover {
    transform: scale(1.05);
}

.treevallei-mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.treevallei-mega-menu-item {
    margin-bottom: 8px;
}

.treevallei-mega-menu-link {
    display: block;
    padding: 6px 0;
    color: #777;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.25s ease;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.treevallei-mega-menu-link:hover {
    color: #08154A;
    padding-left: 12px;
    background: rgba(113, 127, 224, 0.05);
}

.treevallei-mega-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #08154A;
    transition: width 0.25s ease;
}

.treevallei-mega-menu-link:hover::before {
    width: 4px;
}

/* Responsive adjustments */
@media (max-width: 1199px) {
    .treevallei-mega-menu {
        min-width: 600px;
        padding: 20px;
    }

    .treevallei-mega-menu-container {
        gap: 20px;
    }

    .treevallei-mega-menu-column:first-child {
        flex: 0 0 150px;
        padding-right: 20px;
    }
}

@media (max-width: 991px) {
    .treevallei-mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        min-width: auto;
        padding: 15px 0;
        margin-top: 0;
        background: transparent;
    }

    .treevallei-mega-menu-container {
        flex-direction: column;
        gap: 15px;
    }

    .treevallei-mega-menu-column:first-child {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        flex: 1;
    }

    .treevallei-menu-image {
        max-width: 120px;
    }
}

/* Integration with existing TreeVallei menu styles */
.main-menu>.treevallei-mega-menu-item>a {
    color: #333;
    font-size: 15px;
    font-weight: 500;
    text-transform: capitalize;
    padding: 0 25px;
    line-height: 80px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    position: relative;
}

.main-menu>.treevallei-mega-menu-item>a:hover {
    color: #08154A;
}

/* Add subtle underline animation for menu items */
.main-menu>.treevallei-mega-menu-item>a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #08154A;
    transition: width 0.3s ease;
}

.main-menu>.treevallei-mega-menu-item:hover>a::before {
    width: 60%;
}

/* Arrow indicator for mega menu items */
.treevallei-mega-menu-item>a::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #ccc;
    transition: all 0.3s ease;
}

.treevallei-mega-menu-item:hover>a::after {
    border-top-color: #08154A;
    transform: translateY(-50%) rotate(180deg);
}

/* Ensure mega menu doesn't interfere with mobile menu */
@media (max-width: 991px) {
    .treevallei-mega-menu-item>a::after {
        display: none;
    }
}

/* Mobile Menu Nested Categories Styles */
.main-menu-m .sub-menu-m .sub-menu-m {
    background: #f8f8f8;
    margin-left: 20px;
    border-left: 2px solid #08154A;
    padding-left: 15px;
}

.main-menu-m .sub-menu-m .sub-menu-m li a {
    font-size: 13px;
    color: #666;
    padding: 8px 0;
    font-weight: 400;
}

.main-menu-m .sub-menu-m .sub-menu-m li a:hover {
    color: #08154A;
    padding-left: 10px;
}

/* Mobile menu arrow adjustments for nested levels */
.main-menu-m li .sub-menu-m li {
    position: relative;
}

.main-menu-m li .sub-menu-m li:has(.sub-menu-m)>a::after {
    content: '\f105';
    font-family: 'FontAwesome';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 12px;
}

/* Smooth transitions for mobile nested menus */
.main-menu-m .sub-menu-m .sub-menu-m {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.main-menu-m .sub-menu-m li.active .sub-menu-m {
    max-height: 500px;
}/* F
ix for TreeVallei mega menu positioning when header is sticky */
.main-nav.sticky .treevallei-mega-menu {
  position: absolute !important;
  z-index: 1000 !important;
  top: 100% !important;
  left: 0 !important;
  transform: translateY(0) !important;
}

/* Ensure sticky TreeVallei mega-menu appears correctly on hover */
.main-nav.sticky .treevallei-mega-menu-item:hover .treevallei-mega-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}