/* =========================================================
   Tabbed mega menu (include/manubar.php)
   Desktop: left tabs, right icon grid, bottom CTA strip.
   Mobile:  same markup, rendered by the theme accordion.
   ========================================================= */

/* ---------- Desktop (.main-menu is only visible at xl) ---------- */
.th-header .menu-area .th-container { position: relative; }
.th-header .main-menu { position: static; }
.main-menu > ul > li.swt-mega-li { position: static; }

.main-menu ul.swt-mega {
    --swt-tabs: 290px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 24px);
    max-width: 1240px;
    height: 540px;
    padding: 18px 0;
    list-style: none;
    text-align: left;
    background: var(--white-color, #fff);
    border-radius: 0 0 16px 16px;
    border-bottom: 3px solid var(--theme-color);
    box-shadow: 0 24px 60px rgba(10, 36, 75, .14);
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    z-index: 99;
    overflow: hidden;
}

/* left column background */
.main-menu ul.swt-mega::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--swt-tabs);
    background: var(--smoke-color, #F2F5FA);
}

.main-menu ul li:hover > ul.swt-mega,
.main-menu ul li:focus-within > ul.swt-mega {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* tabs */
.main-menu ul.swt-mega > li.swt-tab {
    display: block;
    position: static;
    width: var(--swt-tabs);
    margin: 0 !important;
    padding: 0 14px;
}

.main-menu ul.swt-mega > li.swt-tab > a {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    padding: 11px 14px;
    margin: 6px 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--title-color);
    transition: background .2s, color .2s, box-shadow .2s;
}

.main-menu ul.swt-mega > li.swt-tab > a .swt-ic {
    width: 20px;
    font-size: 17px;
    text-align: center;
    color: var(--theme-color);
}

.main-menu ul.swt-mega > li.swt-tab > a:after {
    content: "\f105" !important;
    font-family: var(--icon-font);
    font-weight: 300;
    margin-left: auto !important;
    opacity: 0;
    transition: opacity .2s, transform .2s;
}

.main-menu ul.swt-mega > li.swt-tab.active > a {
    background: var(--white-color, #fff);
    color: var(--theme-color);
}

.main-menu ul.swt-mega > li.swt-tab.active > a:after {
    opacity: 1;
    transform: translateX(3px);
}

/* panels */
.main-menu ul.swt-mega ul.swt-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--swt-tabs);
    right: 0;
    margin: 0;
    padding: 26px 30px 118px;
    list-style: none;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
    gap: 4px 14px;
    overflow-y: auto;
}

.main-menu ul.swt-mega > li.swt-tab.active > ul.swt-panel {
    display: grid;
    animation: swtFade .25s ease;
}

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

.main-menu ul.swt-panel > li {
    display: block;
    margin: 0 !important;
    padding: 0;
}

.main-menu ul.swt-panel > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.35;
    color: var(--title-color);
    transition: background .2s, color .2s;
}

.main-menu ul.swt-panel > li > a:after,
.main-menu ul.swt-panel > li > a:before { display: none !important; }

.main-menu ul.swt-panel .swt-ico {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 17px;
    color: var(--theme-color);
    background: rgba(11, 89, 219, .08);
    transition: background .2s, color .2s;
}

.main-menu ul.swt-panel > li > a:hover {
    background: var(--smoke-color, #F2F5FA);
    color: var(--theme-color);
}

.main-menu ul.swt-panel > li > a:hover .swt-ico {
    background: var(--theme-color);
    color: #fff;
}

/* CTA strip */
.main-menu ul.swt-panel > li.swt-cta {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 22px;
    border-radius: 14px;
    background: linear-gradient(100deg, var(--title-color) 0%, var(--theme-color) 100%);
}

.main-menu .swt-cta-text strong {
    display: block;
    font-family: var(--title-font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.main-menu .swt-cta-text span {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .8);
}

.main-menu ul.swt-panel > li.swt-cta > a.swt-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 15px;
    line-height: 1.2;
    color: var(--title-color);
    background: #fff;
    border-radius: 30px;
    white-space: nowrap;
}

.main-menu ul.swt-panel > li.swt-cta > a.swt-cta-btn { transition: background .25s, color .25s; }
.main-menu ul.swt-panel > li.swt-cta > a.swt-cta-btn:hover {
    color: #fff;
    background: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}

@media (max-width: 1399px) {
    .main-menu ul.swt-mega { --swt-tabs: 270px; }
    .main-menu ul.swt-mega > li.swt-tab { padding: 0 10px; }
    .main-menu ul.swt-mega > li.swt-tab > a { font-size: 14px; padding: 9px 12px; gap: 10px; white-space: nowrap; }
    .main-menu ul.swt-panel > li > a { font-size: 14px; }
}

/* ---------- Mobile accordion (.th-mobile-menu) ---------- */
.th-mobile-menu .swt-cta,
.th-mobile-menu .swt-ic { display: none !important; }

.th-mobile-menu .swt-panel .swt-ico {
    display: inline-block;
    width: 22px;
    margin-right: 6px;
    text-align: center;
    color: var(--theme-color);
}

.th-mobile-menu .swt-panel > li > a:before { display: none; }

/* keep brand casing (Vue.js, NodeJS, iOS) */
.main-menu ul.swt-mega a,
.th-mobile-menu ul.swt-mega a { text-transform: none; }

.th-mobile-menu .swt-panel > li > a { display: flex; align-items: flex-start; }
.th-mobile-menu .swt-panel .swt-ico { flex: 0 0 22px; }

/* mobile: no extra indent for tab list and link list */
.th-mobile-menu ul.swt-mega,
.th-mobile-menu ul.swt-panel { padding: 0; }

/* CLS fix: the HTML streams in and the browser can paint the header before every menu item has arrived.
   The menu is right-aligned, so each late item pushed the earlier ones left (desktop CLS).
   Reserve the final width up front. If you rename or add top-level menu items, re-measure these widths
   (width of "header nav.main-menu > ul" after fonts load). */
@media (min-width: 1200px) and (max-width: 1399px) { .th-header .main-menu > ul { min-width: 523px; } }
@media (min-width: 1400px) and (max-width: 1500px) { .th-header .main-menu > ul { min-width: 571px; } }
@media (min-width: 1501px)                         { .th-header .main-menu > ul { min-width: 555px; } }
