.legal-mega-nav-container {
    --nav-bg: #0a0a0a;
    --panel-bg: #111111;
    --border-color: #333333;
    --text-color: #ffffff;
    --text-muted: #888888;
    --accent-color: #ffffff;

    width: 100%;
    display: flex;
    overflow: hidden;
    background-color: var(--nav-bg);
    position: relative;
}

.legal-mega-nav-container.is-fullscreen {
    height: 100vh;
}

.legal-mega-nav-main {
    display: flex;
    width: 100%;
    height: 100%;
}

/* LEFT COLUMN */
.legal-nav-left {
    background-color: var(--nav-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 10;
    flex: 0 0 320px;
}

.cat-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.cat-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* Base focus/active resets to suppress theme default "red" color, 
   but without !important on background to allow Elementor to override it */
.cat-item-btn:focus,
.cat-item-btn:active,
.cat-item-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure list items don't have bullets */
.cat-item {
    list-style: none !important;
}

/* HIGH SPECIFICITY ACTIVE STATE SELECTOR - Logic handled in PHP/Elementor */


.cat-item-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cat-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    /* Visible by default as requested */
    transition: opacity 0.3s ease;
    width: 24px;
    /* Default fallback */
    height: 24px;
    /* Default fallback */
    font-size: 20px;
    /* Default fallback */
}

.cat-item-icon svg,
.cat-item-icon i,
.active-cat-icon svg,
.active-cat-icon i,
.mobile-cat-icon svg,
.mobile-cat-icon i,
.service-item-icon svg,
.service-item-icon i {
    width: 100% !important;
    height: 100% !important;
    fill: currentColor;
    display: block;
    object-fit: contain;
}

/* HOVER ONLY STATE (Arrows only, icons are now persistent) */
.cat-item-label {
    font-size: 18px;
    font-weight: 500;
}

.cat-item-arrow {
    font-size: 16px;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateX(-5px);
}

.cat-item-btn:hover .cat-item-arrow {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* MIDDLE COLUMN */
.legal-nav-middle {
    background-color: var(--panel-bg);
    overflow-y: auto;
    padding: 48px;
    flex: 1 1 auto;
}

.services-header {
    display: flex !important;
    align-items: baseline;
    margin-bottom: 32px;
    width: 100%;
}

.services-title-group {
    display: flex;
    flex-direction: column;
}

.active-cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    width: 100%;
    flex-wrap: nowrap;
}

.active-cat-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.view-all-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.section-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.services-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.service-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 16px !important;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    width: 100%;
    text-align: left;
}

.service-item-label {
    font-size: 18px;
    font-weight: 500;
}

.service-item-icon {
    display: none !important;
    /* Removed from service list items */
}

.service-item-icon svg,
.service-item-icon i {
    width: 100% !important;
    height: 100% !important;
    fill: currentColor;
    object-fit: contain;
}

.service-item-link:hover {
    color: inherit;
}

/* RIGHT COLUMN */
.legal-nav-right {
    position: relative;
    border-left: 1px solid var(--border-color);
    overflow: hidden;
    flex: 0 0 350px;
}

.active-cat-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Ensure image container is definitely visible */
.legal-nav-right.desktop-only {
    background-color: #000;
    display: flex !important;
}

.legal-nav-right-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 1;
    pointer-events: none;
}

/* MOBILE HEADER & FOOTER */
.mobile-nav-header {
    display: none;
}

.mobile-nav-header .mobile-cat-header {
    display: flex !important;
    margin: 0 0 16px 0;
    padding: 0;
    border-bottom: none;
    background: transparent;
    justify-content: flex-start;
}

.mobile-cat-header {
    display: none !important;
}

.mobile-nav-header-top,
.mobile-nav-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-nav-header-bottom {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin-top: 12px;
}

.mobile-cat-header {
    margin: 0 0 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-back-to-site-btn,
.mobile-back-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.mobile-back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.mobile-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-cat-icon svg,
.mobile-cat-icon i {
    width: 100% !important;
    height: 100% !important;
    fill: currentColor;
    object-fit: contain;
}

.mobile-cat-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-color);
}

/* Removed .mobile-footer styles as it's no longer used */

/* ANIMATIONS */
@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

/* SCROLLBAR */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 20px;
}

/* RESPONSIVE */
.desktop-only {
    display: block;
}

.lg-hidden {
    display: none;
}

/* Prevent body scroll when mobile menu is open */
.nav-lock-scroll {
    overflow: hidden !important;
    touch-action: none;
}

/* Mobile & Tablet Specific (< 1025px) */
@media (max-width: 1024.98px) {
    .desktop-only {
        display: none !important;
    }

    .lg-hidden {
        display: block !important;
    }

    .legal-mega-nav-container {
        position: relative;
        overflow: hidden;
        min-height: 400px;
        display: block;
        /* Ensure container behaves as a block */
        height: auto !important;
    }

    .legal-mega-nav-main {
        display: block;
        /* Change from flex to block */
        position: relative;
        width: 100%;
    }

    .legal-nav-left {
        width: 100% !important;
        height: auto !important;
        /* Let content determine height */
        min-height: 500px;
        position: relative !important;
        /* Base layer */
        z-index: 10;
        background-color: var(--nav-bg);
        box-sizing: border-box !important;
        display: block;
        border-right: none;
    }

    .legal-nav-middle {
        width: 100% !important;
        height: 100% !important;
        /* Matches height of .legal-nav-left */
        position: absolute !important;
        /* Overlay layer */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        /* Higher than categories */
        display: block !important;
        transform: translateX(100%);
        visibility: hidden;
        background-color: var(--panel-bg);
        box-sizing: border-box !important;
        padding: 32px 20px;
    }

    .legal-mega-nav-container.is-primed .legal-nav-middle {
        transition: transform 0.3s ease-in-out, visibility 0.3s;
    }

    .legal-nav-right {
        display: none !important;
    }

    .legal-nav-middle.is-visible {
        transform: translateX(0);
        visibility: visible;
    }

    .mobile-nav-header {
        display: flex;
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        background-color: #151515;
        margin: -32px -20px 32px -20px;
        /* Adjusted negative margins to match mobile padding */
        align-items: stretch;
    }

    .mobile-nav-header-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-nav-header-bottom .section-label {
        margin-top: 8px;
        margin-bottom: 0;
    }

    /* Lawhive style for mobile items */
    .cat-item-btn {
        padding: 24px;
    }

    .cat-item-label {
        font-size: 20px;
        font-weight: 600;
    }

    .cat-item-icon {
        font-size: 22px;
    }

}