/**
 * Mega Menu Styles
 * Minimal custom CSS - most styling done via Tailwind
 * 
 * @package CMth_Child
 */

/* Main navigation link hover effect with bottom border */
.main-navigation > ul > li > a {
    position: relative;
    padding-bottom: 0.5rem;
}

.main-navigation > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--header-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: center;
}

.main-navigation > ul > li > a:hover::after,
.main-navigation > ul > li.current-menu-item > a::after,
.main-navigation > ul > li.current-menu-ancestor > a::after {
    transform: scaleX(1);
}

/* Keep mega menu open when hovering over it */
.mega-menu-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Left panel items */
.mega-menu-left {
    display: block !important;
}

.mega-menu-left > li {
    display: block !important;
    list-style: none !important;
}

.mega-category {
    display: block !important;
}

/* Also show items without children in left panel */
.mega-menu-left > li:not(.mega-category) {
    display: block !important;
}

.mega-category-link {
    display: flex !important;
}

.mega-menu-left a {
    display: flex !important;
}

/* Right panel columns container */
.mega-menu-right {
    position: relative;
}

/* Hide second level columns by default */
.mega-menu-column {
    display: none !important;
    list-style: none;
}

/* Show active column in grid layout */
.mega-menu-column.active {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1.5rem;
    animation: fadeIn 0.2s ease;
}

/* Column list items */
.mega-menu-column li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Active state for left panel categories */
.mega-category-link.active {
    background-color: rgba(255, 107, 53, 0.15) !important;
    color: var(--header-accent) !important;
}

/* Prevent clicks on category links with children */
.mega-category-link[data-has-children="true"][href="#"] {
    cursor: pointer;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - disable mega menu completely on mobile/tablet */
@media (max-width: 1023px) {
    .mega-menu-dropdown,
    .mega-menu-left,
    .mega-menu-right,
    .mega-menu-column {
        display: none !important;
    }
    
    /* Mobile menu uses its own navigation */
    .mobile-navigation {
        display: block !important;
    }
}

