/**
 * Mega Menu Styles
 * For Fasilitas & Layanan dropdown
 */

/* Mega Menu Container */
.nav-menu .menu-item-has-children {
    position: relative;
    z-index: 1;
}

/* Override header-nav a display for menu items with children */
.nav-menu .menu-item-has-children > a {
    display: inline-block !important;
}

.nav-menu .menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.nav-menu .menu-item-has-children:hover > a::after,
.nav-menu .menu-item-has-children.mega-menu-open > a::after {
    transform: rotate(180deg);
}

/* Mega Menu Dropdown */
.mega-menu-dropdown {
    position: fixed;
    top: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateX(-50%) translateY(-10px);
    z-index: 99999;
}

.menu-item-has-children:hover .mega-menu-dropdown,
.menu-item-has-children.mega-menu-open .mega-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Mega Menu Grid */
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Mega Menu Column */
.mega-menu-column {
    padding-right: 24px;
}

.mega-menu-column:not(:last-child) {
    border-right: 1px solid #e5e7eb;
}

.mega-menu-column:last-child {
    padding-right: 0;
}

/* Mega Menu Heading */
.mega-menu-heading {
    font-size: 14px;
    font-weight: 600;
    color: #00a651;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-menu-heading svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Mega Menu List */
.mega-menu-dropdown .mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
    align-items: stretch !important;
}

.mega-menu-dropdown .mega-menu-list li {
    margin-bottom: 0;
    display: block;
    width: 100%;
}

.mega-menu-dropdown .mega-menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
}

.mega-menu-dropdown .mega-menu-list a:hover {
    background: #f0f9ff;
    color: #00a651;
    padding-left: 16px;
}

.mega-menu-dropdown .mega-menu-list a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #00a651;
    opacity: 0.7;
}

.mega-menu-dropdown .mega-menu-list a:hover svg {
    opacity: 1;
}

/* Featured Item */
.mega-menu-featured {
    background: linear-gradient(135deg, #00a651 0%, #00c65e 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
}

.mega-menu-featured h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: white;
}

.mega-menu-featured p {
    font-size: 13px;
    margin: 0 0 16px 0;
    opacity: 0.9;
    line-height: 1.5;
}

.mega-menu-featured a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #00a651;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.mega-menu-featured a:hover {
    transform: scale(1.05);
}

/* Hide default submenu for mega menu items */
.nav-menu > .menu-item-has-children .sub-menu {
    display: none !important;
}

/* Ensure mega menu dropdown is properly positioned */
.nav-menu > .menu-item-has-children {
    position: relative;
}

/* Responsive */
@media (max-width: 1200px) {
    .mega-menu-dropdown {
        width: 95%;
        max-width: 1000px;
        padding: 32px;
    }
    
    .mega-menu-grid {
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    /* Hide mega menu on mobile completely */
    .mega-menu-dropdown {
        display: none !important;
    }
    
    /* Hide arrow indicator on mobile */
    .nav-menu .menu-item-has-children > a::after {
        display: none;
    }
    
    /* Mobile menu submenu styling */
    .mobile-menu .menu-item-has-children .sub-menu {
        display: block !important;
        position: static;
        background: rgba(0, 166, 81, 0.05);
        padding: var(--space-2) 0;
        margin: var(--space-2) 0;
        border-radius: 8px;
    }
    
    .mobile-menu .menu-item-has-children .sub-menu li {
        border-bottom: none;
    }
    
    .mobile-menu .menu-item-has-children .sub-menu li a {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-sm);
        color: var(--color-gray-600);
    }
    
    .mobile-menu .menu-item-has-children .sub-menu li a:hover {
        background: rgba(0, 166, 81, 0.1);
        color: var(--color-primary);
    }
}
