/* ==========================================================================
   MEGA MENU — Shiftix Theme
   Full-width 3-column enterprise navigation panel
   ========================================================================== */

/* ── 1. Nav item baseline ───────────────────────────────────────────────── */

.mega-nav {
    gap: 0;
}

/* Arrow icon on top-level links */
.mega-arrow {
    font-size: 11px;
    margin-left: 6px;
    display: inline-block;
    transition: transform 0.28s ease;
    vertical-align: middle;
    line-height: 1;
}

.has-mega-menu:hover .mega-arrow,
.has-mega-menu.mega-open .mega-arrow {
    transform: rotate(180deg);
}

/* ── 2. Positioning: li must be static so panel anchors to header ─────── */

.mega-nav li.has-mega-menu {
    position: static !important;
}

/* ── 3. The panel itself ─────────────────────────────────────────────────── */

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    background: #fff;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--accent-color);

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.28s ease,
        visibility 0.28s ease,
        transform 0.28s ease;
}

/* Shown state — triggered by JS class */
.mega-menu.mega-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── 4. Inner flex container ─────────────────────────────────────────────── */

.mega-menu-inner {
    display: flex;
    max-width: 1300px;
    margin: 0 auto;
    min-height: 320px;
    max-height: 480px;
}

/* ── 5. Columns ──────────────────────────────────────────────────────────── */

.mega-col {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    /* Thin, branded scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.mega-col::-webkit-scrollbar {
    width: 4px;
}
.mega-col::-webkit-scrollbar-track {
    background: transparent;
}
.mega-col::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

/* Column 1 — darkest, primary categories */
.mega-col-1 {
    width: 260px;
    min-width: 260px;
    background: #1b2c2e;
    padding: 8px 0;
    flex-shrink: 0;
}

/* Column 2 — slightly lighter, subcategories */
.mega-col-2 {
    width: 270px;
    min-width: 270px;
    background: var(--primary-color);
    padding: 8px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

/* Column 3 — deep level */
.mega-col-3 {
    flex: 1;
    background: #1b2c2e;
    padding: 8px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── 6. Column lists ─────────────────────────────────────────────────────── */

.mega-col > ul,
.mega-col .mega-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Hidden submenu groups (col 2 & 3) */
.mega-col-2 .mega-submenu,
.mega-col-3 .mega-submenu {
    display: none;
}

.mega-col-2 .mega-submenu.active,
.mega-col-3 .mega-submenu.active {
    display: block;
    animation: megaColFade 0.2s ease;
}

@keyframes megaColFade {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── 7. Menu items (shared) ──────────────────────────────────────────────── */

.mega-item {
    position: relative;
}

.mega-item > a,
.mega-item > span {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    text-transform: none !important;
    letter-spacing: 0.01em;
    text-align: left;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        padding-left 0.18s ease !important;
    border-left: 3px solid transparent;
}

.mega-item > a i,
.mega-item > span i {
    font-size: 10px;
    opacity: 0.45;
    flex-shrink: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Hover / active state — col 1 & 2 (dark bg) */
.mega-col-1 .mega-item:hover > a,
.mega-col-1 .mega-item.active > a,
.mega-col-1 .mega-item:hover > span,
.mega-col-1 .mega-item.active > span,
.mega-col-2 .mega-item:hover > a,
.mega-col-2 .mega-item.active > a,
.mega-col-2 .mega-item:hover > span,
.mega-col-2 .mega-item.active > span {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

.mega-col-1 .mega-item:hover > a i,
.mega-col-1 .mega-item.active > a i,
.mega-col-1 .mega-item:hover > span i,
.mega-col-1 .mega-item.active > span i,
.mega-col-2 .mega-item:hover > a i,
.mega-col-2 .mega-item.active > a i,
.mega-col-2 .mega-item:hover > span i,
.mega-col-2 .mega-item.active > span i {
    opacity: 1;
    transform: translateX(2px);
}

/* Col 3 — dark bg, white text */
.mega-col-3 .mega-item > a {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 14px !important;
}

.mega-col-3 .mega-item:hover > a,
.mega-col-3 .mega-item.active > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

/* current-menu-item highlight */
.mega-item.current-menu-item > a,
.mega-item.current-menu-ancestor > a {
    color: var(--accent-color) !important;
}

/* ── 8. Column header labels (optional divider titles) ───────────────────── */

.mega-col-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    padding: 16px 22px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
    pointer-events: none;
    user-select: none;
}

.mega-col-3 .mega-col-label {
    color: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* ── 9. Column visibility rules ──────────────────────────────────────────── */

/* Col 3: hide unless has-col-3 or has-col-5 */
.mega-menu:not(.has-col-3):not(.has-col-5) .mega-col-3 {
    display: none;
}

/* Col 4 & 5: only shown in 5-column panels */
.mega-menu:not(.has-col-5) .mega-col-4,
.mega-menu:not(.has-col-5) .mega-col-5 {
    display: none;
}

/* ── 9b. 5-Column layout overrides ───────────────────────────────────────── */

.mega-menu.has-col-5 .mega-menu-inner {
    max-width: 1400px;
}

/* Narrow col-1 and col-2 to make room for 3 extra columns */
.mega-menu.has-col-5 .mega-col-1 {
    width: 12%;
    min-width: 12%;
}

.mega-menu.has-col-5 .mega-col-2 {
    width: 12%;
    min-width: 12%;
}

/* Col 3 in 5-column mode — fixed width */
.mega-menu.has-col-5 .mega-col-3 {
    flex: 0 0 auto;
    width: 23%;
    min-width: 23%;
    background: #1b2c2e;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* Col 3 text — dark bg needs white text (override light-text defaults) */
.mega-menu.has-col-5 .mega-col-3 .mega-item > a {
    color: rgba(255, 255, 255, 0.72) !important;
    font-size: 14px !important;
}

.mega-menu.has-col-5 .mega-col-3 .mega-item:hover > a,
.mega-menu.has-col-5 .mega-col-3 .mega-item.active > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

.mega-menu.has-col-5 .mega-col-3 .mega-item:hover > a i,
.mega-menu.has-col-5 .mega-col-3 .mega-item.active > a i {
    opacity: 1;
    transform: translateX(2px);
}

.mega-menu.has-col-5 .mega-col-3 .mega-col-label {
    color: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Col 3 submenus in 5-column mode (override — col-3 becomes a switching col) */
.mega-menu.has-col-5 .mega-col-3 .mega-submenu {
    display: none;
}

.mega-menu.has-col-5 .mega-col-3 .mega-submenu.active {
    display: block;
    animation: megaColFade 0.2s ease;
}

/* ── Col 4 ────────────────────────────────────────────────────────────────── */

.mega-col-4 {
    display: flex;
    flex-direction: column;
    width: 23%;
    min-width: 23%;
    background: var(--primary-color);
    padding: 8px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.mega-col-4::-webkit-scrollbar        { width: 4px; }
.mega-col-4::-webkit-scrollbar-track  { background: transparent; }
.mega-col-4::-webkit-scrollbar-thumb  { background: var(--accent-color); border-radius: 2px; }

.mega-col-4 > ul,
.mega-col-4 .mega-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.mega-col-4 .mega-submenu { display: none; }
.mega-col-4 .mega-submenu.active {
    display: block;
    animation: megaColFade 0.2s ease;
}

.mega-col-4 .mega-item > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    text-transform: none !important;
    letter-spacing: 0.01em;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: color 0.18s ease, background 0.18s ease, padding-left 0.18s ease !important;
}

.mega-col-4 .mega-item > a i {
    font-size: 10px;
    opacity: 0.45;
    flex-shrink: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.mega-col-4 .mega-item:hover > a,
.mega-col-4 .mega-item.active > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

.mega-col-4 .mega-item:hover > a i,
.mega-col-4 .mega-item.active > a i {
    opacity: 1;
    transform: translateX(2px);
}

/* ── Col 5 ────────────────────────────────────────────────────────────────── */

.mega-col-5 {
    display: flex;
    flex-direction: column;
    width: 30%;
    min-width: 30%;
    flex: 1;
    background: #f5f7f5;
    padding: 8px 0;
    border-left: 1px solid var(--divider-color);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.mega-col-5::-webkit-scrollbar        { width: 4px; }
.mega-col-5::-webkit-scrollbar-track  { background: transparent; }
.mega-col-5::-webkit-scrollbar-thumb  { background: var(--accent-color); border-radius: 2px; }

.mega-col-5 > ul,
.mega-col-5 .mega-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.mega-col-5 .mega-submenu { display: none; }
.mega-col-5 .mega-submenu.active {
    display: block;
    animation: megaColFade 0.2s ease;
}

.mega-col-5 .mega-item > a {
    color: var(--text-color) !important;
    font-size: 13.5px !important;
}

.mega-col-5 .mega-item:hover > a,
.mega-col-5 .mega-item.active > a {
    color: var(--primary-color) !important;
    background: rgba(25, 35, 36, 0.06) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

.mega-col-5 .mega-col-label {
    color: var(--accent-color);
    border-bottom-color: var(--divider-color);
}

/* ── 10. Responsive — hide mega menu on mobile/tablet ───────────────────── */

@media (max-width: 991px) {
    .mega-menu {
        display: none !important;
    }

    .mega-arrow {
        display: none;
    }
}

/* ── 11. Sticky header adjustment ────────────────────────────────────────── */

/* When header is sticky (fixed), the mega menu still needs top: 100%.
   Because .header-sticky becomes position: fixed, the mega menu
   position: absolute stacks inside it correctly. */
header.main-header .header-sticky.active .mega-menu {
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.18);
}

/* ==========================================================================
   NORMAL DROPDOWN — Same Col-1 design, item-width, not full-width
   ========================================================================== */

/* ── Top-level dropdown li ───────────────────────────────────────────────── */

/* position: static so the dropdown anchors to .header-sticky (same as mega menu).
   Left position is set dynamically by JS to align under the nav item. */
/* .mega-nav li.has-nav-dropdown {
    position: static;
} */

/* Down-arrow on the nav link (mirrors .mega-arrow but static) */
/* .mega-nav li.has-nav-dropdown > a::after {
    content: '\f107';
    font-family: 'FontAwesome';
    font-weight: 900;
    font-size: 12px;
    margin-left: 7px;
    display: inline-block;
    transition: transform 0.25s ease;
} */


.mega-nav > li.has-nav-dropdown > a {
  position: relative;
  padding-right: 28px;
}

.mega-nav > li.has-nav-dropdown > a::after {
  content: "\f107";
  font-family: "FontAwesome";
  font-weight: 900;
  font-size: 12px;

  position: absolute;
  right: -8px;
  top: 55%;
  transform: translateY(-50%);

  display: inline-block;
  transition: transform 0.25s ease;
}

.mega-nav li.has-nav-dropdown.nav-dropdown-open > a::after {
  transform: translateY(-50%) rotate(180deg);
}

.mega-nav > li:nth-child(3) > a,
.mega-nav > li:nth-child(5) > a {
  padding-right: 25px !important;
}

.mega-nav > li:nth-child(3) > a::after,
.mega-nav > li:nth-child(5) > a::after {
  right: 10px;
}

.mega-nav {
  display: flex;
}

.mega-nav > li {
  flex: 0 0 auto;
}
.mega-nav > li.has-mega-menu > a {
  position: relative;
  padding-right: 32px;
}

.mega-nav > li.has-mega-menu > a::after {
  content: "\f107";
  font-family: "FontAwesome";
  font-weight: 900;
  font-size: 12px;

  position: absolute;
  right: -8px;
  top: 55%;
  transform: translateY(-50%);
  transition: transform 0.25s ease;
}

.mega-nav > li.has-mega-menu:hover > a::after,
.mega-nav > li.has-mega-menu.mega-open > a::after {
  transform: translateY(-50%) rotate(180deg);
}
.mega-nav > li:nth-child(2) > a {
  padding-right: 25px !important;
}

.mega-nav > li:nth-child(2) > a::after {
  right: 10px !important;
}

/* ── Root dropdown panel ─────────────────────────────────────────────────── */

/* top: 100% is relative to .header-sticky (same anchor as .mega-menu).
   left is set by JS to align under the hovered nav item. */
.nav-dropdown {
    position: absolute;
    top: 100%;
    min-width: 240px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: var(--primary-color);
    border-top: 3px solid var(--accent-color);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.18);
    z-index: 999;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}

.has-nav-dropdown.nav-dropdown-open > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 18px;
}

/* ── Nested dropdown (fly-out to the right) ──────────────────────────────── */

.nav-dropdown-sub {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: #1b2c2e;
    border-left: 3px solid var(--accent-color);
    box-shadow: 8px 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 999;

    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s ease;
}

.has-nav-dropdown.nav-dropdown-open > .nav-dropdown-sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    margin-top: 18px;
}

/* ── Items — identical to .mega-item > a ─────────────────────────────────── */

.nav-dropdown li,
.nav-dropdown-sub li {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown li > a,
.nav-dropdown-sub li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px;
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    color: rgba(255, 255, 255, 0.72) !important;
    text-transform: none !important;
    letter-spacing: 0.01em;
    text-align: left;
    border-left: 3px solid transparent;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        padding-left 0.18s ease !important;
}

.nav-dropdown li > a i,
.nav-dropdown-sub li > a i {
    font-size: 10px;
    opacity: 0.4;
    flex-shrink: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Hover / active */
.nav-dropdown li:hover > a,
.nav-dropdown li.nav-dropdown-open > a,
.nav-dropdown-sub li:hover > a,
.nav-dropdown-sub li.nav-dropdown-open > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    padding-left: 26px !important;
    border-left-color: var(--accent-color);
}

.nav-dropdown li:hover > a i,
.nav-dropdown li.nav-dropdown-open > a i,
.nav-dropdown-sub li:hover > a i,
.nav-dropdown-sub li.nav-dropdown-open > a i {
    opacity: 1;
    transform: translateX(2px);
}

/* Current page */
.nav-dropdown .current-menu-item > a,
.nav-dropdown-sub .current-menu-item > a {
    color: var(--accent-color) !important;
}

/* ── Hide on mobile ──────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .nav-dropdown,
    .nav-dropdown-sub {
        display: none !important;
    }
}

/* ==========================================================================
   SIDEBAR NAV MENU — 3-level accordion
   ========================================================================== */

/* ── Override legacy sidebar-nav-list styles ─────────────────────────────── */

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ── Top-level items ─────────────────────────────────────────────────────── */

.sidebar-nav-list > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav-list > li > .sidebar-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-nav-list > li > .sidebar-item-row > a {
    flex: 1;
    display: block;
    padding: 13px 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    text-decoration: none;
}

.sidebar-nav-list > li > .sidebar-item-row > a:hover,
.sidebar-nav-list > li.sidebar-open > .sidebar-item-row > a {
    color: var(--accent-color);
}

/* ── Toggle button (chevron) ─────────────────────────────────────────────── */

.sidebar-nav-toggle {
    background: none;
    border: none;
    padding: 10px 4px 10px 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.25s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-nav-toggle:hover {
    color: var(--accent-color);
}

/* Rotate arrow when open */
.sidebar-nav-list li.sidebar-open > .sidebar-item-row .sidebar-nav-toggle {
    transform: rotate(180deg);
    color: var(--accent-color);
}

/* ── Nested list — L1 children ───────────────────────────────────────────── */

.sidebar-nav-list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.32s ease;
}

.sidebar-nav-list li.sidebar-open > .sub-menu {
    max-height: 1200px; /* large enough for any reasonable menu */
}

/* L1 item rows */
.sidebar-nav-list .sub-menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav-list .sub-menu > li:last-child {
    border-bottom: none;
}

.sidebar-nav-list .sub-menu > li > .sidebar-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
}

.sidebar-nav-list .sub-menu > li > .sidebar-item-row > a {
    flex: 1;
    display: block;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
    text-decoration: none;
}

.sidebar-nav-list .sub-menu > li > .sidebar-item-row > a:hover,
.sidebar-nav-list .sub-menu > li.sidebar-open > .sidebar-item-row > a {
    color: rgba(255, 255, 255, 0.95);
}

/* L1 toggle button */
.sidebar-nav-list .sub-menu > li > .sidebar-item-row .sidebar-nav-toggle {
    font-size: 11px;
    padding: 8px 4px 8px 10px;
}

/* ── L2 children ─────────────────────────────────────────────────────────── */

.sidebar-nav-list .sub-menu .sub-menu > li > .sidebar-item-row {
    padding-left: 32px;
}

.sidebar-nav-list .sub-menu .sub-menu > li > .sidebar-item-row > a {
    color: rgba(255, 255, 255, 0.48);
    font-size: 13px;
    padding: 8px 0;
}

.sidebar-nav-list .sub-menu .sub-menu > li > .sidebar-item-row > a:hover {
    color: var(--accent-color);
}

/* L2 items have no further toggle (L3 = leaf level) */

/* ── Current page highlight ──────────────────────────────────────────────── */

.sidebar-nav-list .current-menu-item > .sidebar-item-row > a,
.sidebar-nav-list .current-menu-ancestor > .sidebar-item-row > a,
.sidebar-nav-list .current-menu-parent > .sidebar-item-row > a {
    color: var(--accent-color) !important;
}

/* Auto-expand current ancestor */
.sidebar-nav-list .current-menu-ancestor,
.sidebar-nav-list .current-menu-parent {
    /* sidebar-open added by JS on init */
}
