/* ================================================================
   MEGA MENU — Premium SaaS Design
   File: mega-menu.css

   Layout model (both types use the same info-panel width):
     Type 1: [Sidebar 22% | L3 2-col flex:1 | Info Panel 240px]
     Type 2: [Sidebar 22% | L2 2-col flex:1 | Info Panel 240px]

   Uses ONLY existing CSS custom properties from webyansh.min.css.
   ================================================================ */

/* ---------------------------------------------------------------
   Override inner container constraints for mega layouts
   --------------------------------------------------------------- */
.nav_2_dropdown_mega_scroll.is-desktop:has(.mega-menu-wrap) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible !important;
}

.nav_2_dropdown_mega_contain.is-desktop:has(.mega-menu-wrap) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-width: 100% !important;
}

/* ---------------------------------------------------------------
   Mega Menu Outer Wrapper
   --------------------------------------------------------------- */
.mega-menu-wrap {
    display: flex;
    min-height: 460px;
    width: 100%;
    background: var(--_theme---white);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(26, 26, 26, 0.05),
        0 4px 6px -1px rgba(26, 26, 26, 0.04),
        0 20px 56px -4px rgba(26, 26, 26, 0.16);
    overflow: hidden;
    animation: megaMenuFadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes megaMenuFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.997); }
    to   { opacity: 1; transform: translateY(0)   scale(1);     }
}

/* Strip list styles inside mega menu */
.mega-menu-wrap ul,
.mega-menu-wrap li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

/* ================================================================
   TYPE 1: THREE-LEVEL MEGA MENU
   Layout: [Sidebar L2 | L3 two-column grid | Info Panel]
   ================================================================ */

/* ---- Left Sidebar (Level 2 Items) ---- */
.mega-sidebar {
    width: 22%;
    min-width: 185px;
    max-width: 220px;
    background: var(--swatch--gray-50);
    border-right: 1px solid var(--swatch--gray-200);
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.mega-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    color: var(--swatch--dark);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.mega-sidebar-item:hover,
.mega-sidebar-item.is-active {
    background: var(--_theme---white);
    color: var(--swatch--brand);
    box-shadow: 0 1px 6px rgba(26, 26, 26, 0.07);
}

.mega-sidebar-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--swatch--gray-200);
    transition: background 0.2s ease;
}

.mega-sidebar-item:hover .mega-sidebar-icon,
.mega-sidebar-item.is-active .mega-sidebar-icon {
    background: rgba(255, 77, 0, 0.1);
}

.mega-sidebar-icon svg,
.mega-sidebar-item > svg {
    width: 15px;
    height: 15px;
    color: var(--swatch--gray-600);
    transition: color 0.2s ease;
    flex-shrink: 0;
    display: block;
    max-width: 100%;
}

.mega-sidebar-item:hover .mega-sidebar-icon svg,
.mega-sidebar-item.is-active .mega-sidebar-icon svg {
    color: var(--swatch--brand);
}

/* The arrow chevron appended by PHP ($svgArrowRight) */
.mega-sidebar-item > svg:last-child {
    width: 13px;
    height: 13px;
    opacity: 0.35;
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: currentColor;
}

.mega-sidebar-item:hover > svg:last-child,
.mega-sidebar-item.is-active > svg:last-child {
    opacity: 0.85;
    transform: translateX(2px);
}

.mega-sidebar-text {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    font-family: var(--_typography---font--primary-family);
    color: inherit;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ---- Level 3 Column — 2-column grid layout ---- */
.mega-col-l3 {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--swatch--gray-200);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.mega-l3-panel {
    display: none;
    width: 100%;
    /* Two-column grid for L3 items */
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    align-content: start;
    animation: megaPanelSlide 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.mega-l3-panel.is-active {
    display: grid;
}

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

@keyframes megaMenuFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.997); }
    to   { opacity: 1; transform: translateY(0)   scale(1);     }
}

.mega-l3-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    color: var(--swatch--dark);
    text-decoration: none !important;
    font-family: var(--_typography---font--primary-family);
    border: 1px solid transparent;
    min-width: 0;
}

.mega-l3-item:hover,
.mega-l3-item.is-active {
    background: rgba(255, 77, 0, 0.06);
    color: var(--swatch--brand);
    border-color: rgba(255, 77, 0, 0.12);
}

.mega-l3-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--swatch--gray-50);
    border: 1px solid var(--swatch--gray-200);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.mega-l3-item:hover .mega-l3-icon,
.mega-l3-item.is-active .mega-l3-icon {
    background: rgba(255, 77, 0, 0.08);
    border-color: rgba(255, 77, 0, 0.2);
}

.mega-l3-icon svg {
    width: 13px;
    height: 13px;
    color: var(--swatch--gray-600);
    transition: color 0.18s ease;
    flex-shrink: 0;
    display: block;
    max-width: 100%;
}

.mega-l3-item:hover .mega-l3-icon svg,
.mega-l3-item.is-active .mega-l3-icon svg {
    color: var(--swatch--brand);
}

.mega-l3-text {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Hide the arrow inside L3 items in 2-col grid (not needed) */
.mega-l3-arrow {
    display: none;
}

/* ================================================================
   SHARED INFO PANEL — exact same width/behaviour for BOTH types
   ================================================================ */
.mega-panel {
    /* Fixed width so both Type 1 and Type 2 look identical */
    width: 240px;
    min-width: 220px;
    max-width: 260px;
    flex-shrink: 0;
    background: var(--swatch--dark);
    padding: 26px 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--swatch--light);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.mega-panel::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,77,0,0.18) 0%, transparent 68%);
    pointer-events: none;
}

.mega-panel::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,77,0,0.1) 0%, transparent 68%);
    pointer-events: none;
}

.mega-panel-content {
    position: relative;
    z-index: 1;
}

.mega-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    background: rgba(255, 77, 0, 0.12);
    border: 1px solid rgba(255, 77, 0, 0.28);
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--swatch--brand);
    margin-bottom: 14px;
    font-family: var(--_typography---font--primary-family);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mega-panel-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--swatch--brand);
    flex-shrink: 0;
    animation: megaDotPulse 2.2s ease infinite;
}

@keyframes megaDotPulse {
    0%, 100% { opacity: 1;    transform: scale(1);    }
    50%       { opacity: 0.4; transform: scale(0.75); }
}

.mega-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 7px;
    font-family: var(--_typography---font--primary-family);
}

.mega-panel-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.55;
    margin-bottom: 16px;
    font-family: var(--_typography---font--primary-family);
}

.mega-panel-points {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-panel-point {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--_typography---font--primary-family);
    font-weight: 450;
    line-height: 1.3;
}

.mega-panel-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 77, 0, 0.18);
    border: 1px solid rgba(255, 77, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-panel-check svg {
    width: 8px;
    height: 8px;
    color: var(--swatch--brand);
    display: block;
    flex-shrink: 0;
}

.mega-panel-cta {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.mega-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    background: var(--swatch--brand);
    color: #ffffff !important;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    font-family: var(--_typography---font--primary-family);
    transition: background 0.25s ease, color 0.25s ease, gap 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--swatch--brand);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mega-panel-btn:hover {
    background: #ffffff;
    color: var(--swatch--dark) !important;
    border-color: #ffffff;
    text-decoration: none !important;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(255, 77, 0, 0.4);
}

.mega-panel-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: block;
    transition: transform 0.25s ease;
}

.mega-panel-btn:hover svg {
    transform: translateX(2px);
}

/* ================================================================
   TYPE 2: TWO-LEVEL MEGA MENU
   Layout: [Sidebar Parent | 2-col L2 Grid | Info Panel]
   Same min-height, same info-panel width as Type 1
   ================================================================ */
.mega-menu-wrap.mega-type-2 {
    min-height: 340px;
}

/* Left Sidebar: Active parent card */
.mega-t2-sidebar {
    width: 22%;
    min-width: 185px;
    max-width: 220px;
    background: rgba(255, 77, 0, 0.03);
    border-right: 1px solid var(--swatch--gray-200);
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.mega-t2-parent-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--_theme---white);
    border: 1px solid var(--swatch--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.06);
}

.mega-t2-parent-icon svg {
    width: 22px;
    height: 22px;
    color: var(--swatch--brand);
    flex-shrink: 0;
    display: block;
}

.mega-t2-parent-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--swatch--dark);
    font-family: var(--_typography---font--primary-family);
    line-height: 1.2;
    margin-bottom: 6px;
}

.mega-t2-parent-desc {
    font-size: 0.72rem;
    color: var(--swatch--gray-500);
    font-family: var(--_typography---font--primary-family);
    line-height: 1.45;
}

/* Center: 2-column grid of L2 items */
.mega-t2-center {
    flex: 1;
    min-width: 0;
    padding: 20px 16px;
    border-right: 1px solid var(--swatch--gray-200);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-content: start;
    overflow-y: auto;
    box-sizing: border-box;
}

.mega-t2-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--swatch--dark);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    font-family: var(--_typography---font--primary-family);
    min-width: 0;
}

.mega-t2-item:hover {
    background: var(--swatch--gray-50);
    border-color: var(--swatch--gray-200);
    color: var(--swatch--brand);
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.05);
}

.mega-t2-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--swatch--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--swatch--gray-200);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.mega-t2-item:hover .mega-t2-icon {
    background: rgba(255, 77, 0, 0.08);
    border-color: rgba(255, 77, 0, 0.2);
}

.mega-t2-icon svg {
    width: 15px;
    height: 15px;
    color: var(--swatch--gray-600);
    transition: color 0.2s ease;
    flex-shrink: 0;
    display: block;
    max-width: 100%;
}

.mega-t2-item:hover .mega-t2-icon svg {
    color: var(--swatch--brand);
}

.mega-t2-text {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
    color: inherit;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.mega-t2-arrow {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    opacity: 0.3;
    color: currentColor;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: block;
}

.mega-t2-item:hover .mega-t2-arrow {
    opacity: 0.85;
    transform: translateX(2px);
}

/* ================================================================
   DESKTOP RESPONSIVE — covers 1366px → 2560px
   No horizontal scroll. Proportions scale smoothly.
   ================================================================ */

/* --- 1366px – 1439px (smallest common desktop) --- */
@media (min-width: 1025px) and (max-width: 1439px) {
    .mega-panel {
        width: 200px;
        min-width: 190px;
        max-width: 210px;
        padding: 20px 15px 18px;
    }

    .mega-panel-title    { font-size: 1rem; }
    .mega-panel-desc     { font-size: 0.68rem; margin-bottom: 12px; }
    .mega-panel-point    { font-size: 0.68rem; gap: 7px; }
    .mega-panel-points   { gap: 6px; }
    .mega-panel-btn      { font-size: 0.72rem; padding: 9px 12px; }

    .mega-sidebar {
        width: 20%;
        min-width: 170px;
        max-width: 195px;
        padding: 14px 8px;
    }
    .mega-sidebar-text   { font-size: 0.78rem; }

    .mega-col-l3         { padding: 14px 12px; }
    .mega-l3-panel       { gap: 4px; }
    .mega-l3-item        { padding: 8px 9px; gap: 8px; }
    .mega-l3-text        { font-size: 0.75rem; }
    .mega-l3-icon        { width: 24px; height: 24px; }

    .mega-t2-sidebar {
        width: 20%;
        min-width: 170px;
        max-width: 195px;
        padding: 20px 14px;
    }
    .mega-t2-center      { padding: 14px 12px; gap: 4px; }
    .mega-t2-item        { padding: 9px 10px; }
    .mega-t2-text        { font-size: 0.75rem; }
    .mega-t2-icon        { width: 28px; height: 28px; }
    .mega-t2-parent-title { font-size: 0.95rem; }

    .mega-menu-wrap      { min-height: 420px; }
    .mega-menu-wrap.mega-type-2 { min-height: 300px; }
}

/* --- 1440px – 1535px --- */
@media (min-width: 1440px) and (max-width: 1535px) {
    .mega-panel {
        width: 220px;
        min-width: 210px;
        max-width: 230px;
    }
}

/* --- 1536px – 1679px --- */
@media (min-width: 1536px) and (max-width: 1679px) {
    .mega-panel {
        width: 230px;
        min-width: 220px;
        max-width: 245px;
    }
}

/* --- 1680px – 1919px --- */
@media (min-width: 1680px) and (max-width: 1919px) {
    .mega-panel {
        width: 245px;
        min-width: 230px;
        max-width: 260px;
    }
    .mega-panel-title    { font-size: 1.1875rem; }
}

/* --- 1920px and above --- */
@media (min-width: 1920px) {
    .mega-panel {
        width: 260px;
        min-width: 240px;
        max-width: 280px;
    }
    .mega-panel-title    { font-size: 1.25rem; }
    .mega-sidebar        { min-width: 210px; max-width: 250px; }
    .mega-t2-sidebar     { min-width: 210px; max-width: 240px; }
    .mega-l3-item        { padding: 11px 13px; }
    .mega-l3-text        { font-size: 0.875rem; }
    .mega-t2-item        { padding: 13px 14px; }
    .mega-t2-text        { font-size: 0.875rem; }
}

/* --- 2560px (2K) --- */
@media (min-width: 2560px) {
    .mega-panel {
        width: 300px;
        min-width: 280px;
        max-width: 320px;
    }
    .mega-panel-title    { font-size: 1.375rem; }
    .mega-sidebar        { min-width: 240px; max-width: 280px; }
    .mega-t2-sidebar     { min-width: 240px; max-width: 280px; }
}

/* --- Mobile: hide mega menu entirely below 1025px --- */
@media (max-width: 1024px) {
    .mega-menu-wrap {
        display: none !important;
    }
}
