/* ============================================
   ARISTÉ v11 - Mega Menu Navigation
   Six Domains dropdown with service modules
   ============================================ */

/* Mega Menu Trigger */
.nav-links .has-mega-menu {
    position: relative;
}

.nav-links .has-mega-menu > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-links .has-mega-menu:hover > a::after {
    transform: rotate(-135deg);
    opacity: 1;
}

/* Mega Menu Panel */
.mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(28, 37, 65, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.mega-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.mega-menu-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    background: none;
    border: none;
    color: var(--color-cream);
    font-family: var(--font-display);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, color 0.3s ease;
    padding: 10px;
    z-index: 1001;
}

.mega-menu-close:hover {
    opacity: 1;
    color: var(--color-gold);
}

/* Menu Content Grid */
.mega-menu-content {
    max-width: 1200px;
    width: 90%;
    padding: 2rem 0;
}

.mega-menu-header {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.mega-menu.active .mega-menu-header {
    opacity: 1;
    transform: translateY(0);
}

.mega-menu-header h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-cream);
    margin-bottom: 0.5rem;
}

.mega-menu-header p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--color-gold);
    opacity: 0.8;
}

/* Domains Grid: 3 columns x 2 rows */
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 3rem;
}

/* Individual Domain Column */
.mega-domain {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mega-menu.active .mega-domain:nth-child(1) { transition-delay: 0.15s; }
.mega-menu.active .mega-domain:nth-child(2) { transition-delay: 0.2s; }
.mega-menu.active .mega-domain:nth-child(3) { transition-delay: 0.25s; }
.mega-menu.active .mega-domain:nth-child(4) { transition-delay: 0.3s; }
.mega-menu.active .mega-domain:nth-child(5) { transition-delay: 0.35s; }
.mega-menu.active .mega-domain:nth-child(6) { transition-delay: 0.4s; }

.mega-menu.active .mega-domain {
    opacity: 1;
    transform: translateY(0);
}

/* Domain Title Link */
.mega-domain-title {
    display: block;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(184, 155, 95, 0.2);
    text-decoration: none;
    transition: border-color 0.3s ease;
}

.mega-domain-title:hover {
    border-bottom-color: var(--color-gold);
}

.mega-domain-number {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-gold);
    opacity: 0.7;
    display: block;
    margin-bottom: 0.3rem;
}

.mega-domain-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cream);
    transition: color 0.3s ease;
}

.mega-domain-title:hover .mega-domain-name {
    color: var(--color-gold);
}

/* Service Module Links */
.mega-modules {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-modules li {
    margin-bottom: 0.4rem;
}

.mega-modules a {
    display: block;
    padding: 0.4rem 0;
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--color-cream);
    opacity: 0.55;
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
    position: relative;
}

.mega-modules a:hover {
    opacity: 1;
    color: var(--color-gold);
    padding-left: 8px;
}

.mega-modules a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width 0.3s ease;
    transform: translateY(-50%);
}

.mega-modules a:hover::before {
    width: 5px;
}

/* Footer CTA in mega menu */
.mega-menu-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(184, 155, 95, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.5s, transform 0.4s ease 0.5s;
}

.mega-menu.active .mega-menu-footer {
    opacity: 1;
    transform: translateY(0);
}

.mega-menu-cta {
    display: inline-block;
    padding: 12px 32px;
    border: 1px solid rgba(184, 155, 95, 0.4);
    color: var(--color-cream);
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mega-menu-cta:hover {
    border-color: var(--color-gold);
    background: rgba(184, 155, 95, 0.1);
    color: var(--color-gold);
}

/* ===== MOBILE: Full-screen accordion ===== */
@media (max-width: 968px) {
    .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .mega-menu-content {
        width: 100%;
        padding: 5rem 2rem 2rem;
    }

    .mega-menu-header {
        margin-bottom: 1.5rem;
    }

    .mega-menu-header h2 {
        font-size: 1.2rem;
    }

    .mega-domain {
        border-bottom: 1px solid rgba(184, 155, 95, 0.1);
    }

    .mega-domain-title {
        border-bottom: none;
        padding: 1rem 0;
        margin-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mega-domain-title::after {
        content: '+';
        font-family: var(--font-display);
        font-size: 1.2rem;
        color: var(--color-gold);
        opacity: 0.5;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mega-domain.expanded .mega-domain-title::after {
        content: '−';
        opacity: 1;
    }

    .mega-modules {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
        padding: 0;
    }

    .mega-domain.expanded .mega-modules {
        max-height: 300px;
        padding-bottom: 1rem;
    }

    .mega-modules a {
        font-size: 0.8rem;
        padding: 0.5rem 0 0.5rem 1rem;
    }

    .mega-menu-footer {
        margin-top: 2rem;
    }
}
