/* Mega Menu Styles */

/* Make gh-head the positioning context */
.gh-head {
    position: relative;
}

.gh-head-menu .nav li.has-mega-menu {
    position: static;
}

.gh-head-menu .nav li.has-mega-menu>a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mega-menu-arrow {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.gh-head-menu .nav li.has-mega-menu:hover .mega-menu-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Transparency & Layout - Elegant & Subtle */
.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    top: 100%;
    background: rgba(255, 255, 255, 0.85);
    /* 降低不透明度，增強透明感 */
    /* More opaque, cleaner background */
    backdrop-filter: blur(12px);
    /* 增加模糊度 */
    -webkit-backdrop-filter: blur(12px);
    padding: 40px 0 50px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s ease;
    z-index: 1000;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Softer shadow */
}

/* Show on hover */
.gh-head-menu .nav li.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Fix Hover Gap: Add an invisible bridge */
.gh-head-menu .nav li.has-mega-menu>a {
    position: relative;
    z-index: 1001;
}

.gh-head-menu .nav li.has-mega-menu>a::after {
    content: '';
    position: absolute;
    left: -20px;
    /* Wider hit area */
    right: -20px;
    top: 50%;
    height: 60px;
    /* Extends down to meet the menu */
    background: transparent;
    cursor: default;
}

.mega-menu-inner {
    width: 100%;
    padding: 0 max(4vmin, 40px);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.mega-column {
    background: rgba(255, 255, 255, 0.2);
    /* Subtle, light background */
    padding: 0;
    border-radius: 8px;
    /* Softer corners */
    box-shadow: none;
    /* Remove shadow for cleaner look */
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    /* Subtle border */
    transition: all 0.2s ease;
}

.mega-column:hover {
    transform: translateY(-1px);
    /* Minimal lift */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    /* Very subtle shadow on hover */
    background: rgba(255, 255, 255, 0.6);
}

.mega-column h3 {
    font-size: 1.2rem;
    font-weight: 600;
    /* Lighter weight */
    letter-spacing: 0.05em;
    /* Less spacing */
    text-transform: uppercase;
    margin: 0;
    padding: 20px 24px 18px;
    color: #333;
    /* Softer color */
    position: relative;
    background: rgba(250, 250, 250, 0.5);
    /* Very light, subtle background */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    /* Subtle border */
}

.mega-column ul {
    list-style: none;
    padding: 24px 24px 28px;
    margin: 0;
    flex-grow: 1;
}

.mega-column ul li {
    margin-bottom: 0;
    position: relative;
}

.mega-column ul li:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Override global uppercase using specific selector */
.gh-head-menu .nav .mega-menu .mega-column ul li a {
    display: block;
    font-size: 1.3rem;
    /* Slightly smaller */
    color: #666;
    /* Softer text color */
    text-decoration: none;
    line-height: 1.5;
    padding: 10px 12px;
    /* Simplified padding */
    transition: all 0.2s ease;
    position: relative;
    text-transform: none !important;
    /* Force override */
    font-weight: 400;
    /* Lighter weight */
    background: transparent;
}

.mega-column ul li a::before {
    content: "";
    position: absolute;
    left: 12px;
    /* Closer to edge */
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    /* Thinner line */
    background: #999;
    /* Softer color */
    transition: width 0.2s ease;
    opacity: 0;
}

/* Consistent specificity for hover state */
.gh-head-menu .nav .mega-menu .mega-column ul li a:hover {
    color: #000;
    padding-left: 28px;
    /* Less movement */
    background: rgba(0, 0, 0, 0.02);
    /* Very subtle background */
}

.gh-head-menu .nav .mega-menu .mega-column ul li a:hover::before {
    width: 8px;
    /* Smaller line */
    opacity: 1;
    left: 12px;
}

/* Mobile: Reset mega menu for sidebar display */
@media (max-width: 991px) {

    /* Hide mega menu by default on mobile (will be shown via JS toggle) */
    .mega-menu {
        display: none;
        /* Remove !important to allow JS toggle */
        position: static;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        box-shadow: none;
    }

    .gh-head-menu .nav li.has-mega-menu {
        position: relative;
    }

    /* Hide mega menu arrow on mobile */
    .mega-menu-arrow {
        display: none !important;
    }
}