﻿/* Mega Menu Styles - Full Width Grid Layout */

/* Header must be position relative for dropdown positioning */
header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
}

/* Dropdown (Mega Menu) - Attached to header with overlap */
.dropdown {
    position: absolute !important;
    top: calc(100% - 20px) !important; /* Overlap with nav item */
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    margin: 0 !important;
    background: #000;
    padding: 3rem 4rem;
    padding-top: 3rem; /* Extra top padding to compensate for overlap */
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    justify-content: center;
    gap: 1.5rem 2rem;
    z-index: 50; /* Below header but above content */
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

/* Center the mega grid and cap its width on very wide screens */
@media (min-width: 1500px) {
    .dropdown { padding-left: calc((100vw - 1400px) / 2) !important; padding-right: calc((100vw - 1400px) / 2) !important; }
}

/* Show dropdown on hover or when active */
.nav-item:hover .dropdown,
.nav-item.dropdown-active .dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Nav item link positioning for bridge */
.nav-item > a {
    position: relative;
    display: block;
    /* padding: 1rem 0; */
}

/* Invisible bridge between nav item and dropdown */
.nav-item > a::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    right: -20px;
    height: 40px;
    background: transparent;
}

/* Mega Item styles */
.mega-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
    text-decoration: none;
}

.mega-item:hover .mega-image {
    transform: scale(1.05);
    border-color: #fff;
}

.mega-image {
    width: 100%;
    height: 110px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    transition: transform 0.5s;
    border: 1px solid #333;
}

.mega-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: #fff;
}

.mega-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.dropdown a {
    color: #fff;
    text-decoration: none;
    display: block;
    transition: 0.3s;
}

.dropdown a:hover {
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dropdown {
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        text-align: left !important;
        min-width: auto !important;
        border: none !important;
        pointer-events: auto !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .nav-item:hover .dropdown,
    .nav-item.dropdown-active .dropdown {
        display: block !important;
    }
    
    .mega-item {
        flex-direction: column !important;
        padding: 1rem 0 !important;
        gap: 0.3rem !important;
        align-items: flex-start !important;
        border-bottom: 1px solid rgba(255,255,255,0.15) !important;
    }
    
    .mega-item:last-child {
        border-bottom: none !important;
    }
    
    .mega-image {
        display: none !important;
    }
    
    .mega-text {
        text-align: left !important;
        width: 100% !important;
    }
    
    .mega-title {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #fff !important;
        opacity: 1 !important;
        text-shadow: none !important;
    }
    
    .mega-desc {
        display: block !important;
        font-size: 0.85rem !important;
        color: rgba(255, 255, 255, 0.6) !important;
        margin-top: 4px !important;
        line-height: 1.5 !important;
        opacity: 1 !important;
    }
    
    /* Force white text in mobile menu regardless of page theme */
    .dropdown a,
    .dropdown .mega-text,
    .dropdown .mega-title,
    .dropdown .mega-desc {
        color: #fff !important;
    }
    
    .dropdown .mega-desc {
        color: rgba(255, 255, 255, 0.6) !important;
    }
}
