/* ============================================================
   MYS Header Redesign — scoped to #header
   Brand color: #21a341
   Font: Roboto (loaded via Google Fonts in parent layout)
   Bootstrap 5.2.3 base, extended below
   ============================================================ */

/* ---------- Base header ---------- */
#header {
    background-color: #ffffff;
    padding: 0 24px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1050;
    border-bottom: 1px solid #e8f0eb;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    font-family: 'Roboto', sans-serif;
}

#header .navbar {
    padding: 0;
    min-height: 68px;
}

/* ---------- Brand logo ---------- */
#header .navbar-brand {
    padding: 10px 0;
    margin-right: 24px;
    flex-shrink: 0;
}

#header .navbar-brand img {
    width: 210px;
    max-width: 100%;
    height: auto;
}

/* ---------- Toggler ---------- */
#header .navbar-toggler {
    border: 1.5px solid #21a341;
    background: transparent;
    color: #21a341;
    padding: 6px 10px;
    border-radius: 6px;
}

#header .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(33,163,65,0.2);
}

#header .navbar-toggler i,
#header .navbar-toggler .fas {
    color: #21a341;
    font-size: 18px;
    line-height: 1;
}

/* ---------- Primary nav links ---------- */
#header .navbar-nav > .nav-item > .nav-link,
#header .navbar-nav > .nav-item > a.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: #333333;
    padding: 0 13px;
    line-height: 68px;
    letter-spacing: 0.2px;
    white-space: nowrap;
    position: relative;
    transition: color 0.18s;
    display: block;
}

#header .navbar-nav > .nav-item > .nav-link::after {
    display: none; /* hide Bootstrap caret */
}

/* Green underline bar on active / hover */
#header .navbar-nav > .nav-item > .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 13px;
    right: 13px;
    height: 3px;
    background-color: #21a341;
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.18s ease;
}

#header .navbar-nav > .nav-item:hover > .nav-link::before,
#header .navbar-nav > .nav-item.active > .nav-link::before {
    transform: scaleX(1);
}

#header .navbar-nav > .nav-item:hover > .nav-link,
#header .navbar-nav > .nav-item.active > .nav-link {
    color: #21a341;
    font-weight: 600;
}

/* ---------- Auth / CTA buttons in nav ---------- */
#header .navbar-nav > .nav-item .btn-info,
#header .navbar-nav > .nav-item .btn-mys-login {
    background-color: #21a341;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 22px;
    letter-spacing: 0.3px;
    line-height: 1.5;
    transition: background-color 0.18s, box-shadow 0.18s;
    display: inline-block;
    text-decoration: none;
}

#header .navbar-nav > .nav-item .btn-info:hover,
#header .navbar-nav > .nav-item .btn-mys-login:hover {
    background-color: #178a34;
    box-shadow: 0 3px 10px rgba(33,163,65,0.28);
    color: #fff;
}

/* ---------- Tools & Resources standard dropdown ---------- */
#header .mys-std-dropdown {
    position: relative;
}

#header .mys-std-dropdown .mys-std-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e3ede7;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    min-width: 260px;
    padding: 10px 0;
    z-index: 2000;
    margin-top: 0;
    overflow: hidden;
}

#header .mys-std-dropdown:hover .mys-std-menu {
    display: block;
}

#header .mys-std-menu li {
    list-style: none;
}

#header .mys-std-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, padding-left 0.15s;
}

#header .mys-std-menu li a:hover {
    background-color: #f0faf3;
    color: #21a341;
    padding-left: 22px;
}

#header .mys-std-menu li a:hover i {
    color: #21a341;
}

#header .mys-std-menu li a i {
    width: 18px;
    text-align: center;
    color: #21a341;
    font-size: 14px;
    flex-shrink: 0;
}

/* Sub-group header inside standard dropdown — same style as mega menu subhead */
#header .mys-std-menu .mys-std-subgroup {
    font-size: 10px;
    font-weight: 600;
    color: #21a341;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 6px 14px 4px;
    padding: 3px 0 3px 8px;
    border-left: 2px solid #21a341;
    background: #f0faf3;
    border-radius: 0 4px 4px 0;
    cursor: default;
}

/* Nested sub-links (Calculator sub-items) */
#header .mys-std-menu .mys-std-sublink a {
    padding-left: 22px;
    font-size: 13px;
    color: #444;
    font-weight: 400;
}

/* ============================================================
   Products Mega Menu
   ============================================================ */
#header .mys-mega-wrapper {
    position: static;
}

#header .mys-mega-panel {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 3px solid #21a341;
    border-bottom: 1px solid #e3ede7;
    box-shadow: 0 10px 32px rgba(0,0,0,0.10);
    z-index: 1999;
    padding: 24px 40px 20px;
}

#header .mys-mega-wrapper:hover .mys-mega-panel {
    display: block;
}

/* 7-column grid: Loans | Insurance | Equity | Debt | Gold | Properties | Fin.Planning */
#header .mys-mega-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr 1.5fr 1fr 0.8fr 0.9fr;
    gap: 0 20px;
    align-items: start;
}

/* Column heading */
#header .mys-mega-col-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #21a341;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid #e3ede7;
    white-space: nowrap;
}

#header .mys-mega-col-head i {
    font-size: 14px;
}

/* Sub-heading within a column (e.g., Mutual Funds, Govt Schemes) */
#header .mys-mega-subhead {
    font-size: 10px;
    font-weight: 600;
    color: #21a341;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 0 4px 0;
    padding: 3px 0 3px 8px;
    border-left: 2px solid #21a341;
    background: #f0faf3;
    border-radius: 0 4px 4px 0;
}

/* Column divider */
#header .mys-mega-col + .mys-mega-col {
    border-left: 1px solid #f0f4f1;
    padding-left: 18px;
}

/* Override style.css rule that hides nested ul inside .collapse */
#header .mys-mega-panel ul,
#header .mys-std-menu,
#header .mys-user-menu {
    display: block !important;
    position: static !important;
    min-width: unset !important;
    box-shadow: none !important;
    border: none !important;
}
/* Re-apply hide/show for the panels themselves */
#header .mys-mega-panel { display: none !important; position: absolute !important; }
#header .mys-mega-wrapper:hover .mys-mega-panel { display: block !important; }
#header .mys-std-menu { display: none !important; position: absolute !important; box-shadow: 0 8px 28px rgba(0,0,0,0.11) !important; border: 1px solid #e3ede7 !important; }
#header .mys-std-dropdown:hover .mys-std-menu { display: block !important; }
#header .mys-user-menu { display: none !important; position: absolute !important; box-shadow: 0 8px 28px rgba(0,0,0,0.11) !important; border: 1px solid #e3ede7 !important; }
#header .mys-user-dropdown:hover .mys-user-menu { display: block !important; }

/* Plain links in a column */
#header .mys-mega-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

#header .mys-mega-links li a {
    display: block;
    font-size: 13px;
    color: #444;
    font-weight: 400;
    padding: 5px 0 5px 4px;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s, padding-left 0.15s;
}

#header .mys-mega-links li a:hover,
#header .mys-mega-links li a.mys-active {
    color: #21a341;
    font-weight: 600;
    padding-left: 8px;
}

#header .mys-mega-links li a.mys-active {
    background: #f0faf3;
    border-radius: 4px;
    padding: 5px 8px;
}

/* Financial Planning column — pill CTA */
#header .mys-fp-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background-color: #f0faf3;
    border: 1.5px solid #21a341;
    color: #21a341;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    margin-top: 10px;
    white-space: nowrap;
}

#header .mys-fp-link:hover,
#header .mys-fp-link.active {
    background-color: #21a341;
    color: #ffffff;
}

/* ============================================================
   User Profile Dropdown
   ============================================================ */
#header .mys-user-dropdown {
    position: relative;
}

#header .mys-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0 10px;
    height: 68px;
    text-decoration: none;
    border: none;
    background: none;
}

#header .mys-user-trigger img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #21a341;
    object-fit: cover;
    flex-shrink: 0;
}

#header .mys-user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

#header .mys-user-info .mys-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    text-transform: capitalize;
}

#header .mys-user-info .mys-user-phone {
    font-size: 12px;
    color: #777;
    line-height: 1.3;
}

#header .mys-user-caret {
    color: #555;
    font-size: 13px;
    margin-left: 4px;
    transition: transform 0.18s;
}

#header .mys-user-dropdown:hover .mys-user-caret {
    transform: rotate(180deg);
}

#header .mys-user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #e3ede7;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.11);
    padding: 8px 0;
    z-index: 2000;
}

#header .mys-user-dropdown:hover .mys-user-menu {
    display: block;
}

#header .mys-user-menu li {
    list-style: none;
}

#header .mys-user-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f4f1;
    transition: background-color 0.15s, color 0.15s;
}

#header .mys-user-menu li:last-child a {
    border-bottom: none;
}

#header .mys-user-menu li a:hover {
    background-color: #21a341;
    color: #ffffff;
}

#header .mys-user-menu li a:hover i {
    color: #ffffff;
}

#header .mys-user-menu li a i {
    width: 16px;
    text-align: center;
    color: #21a341;
    font-size: 14px;
    flex-shrink: 0;
}

#header .mys-user-menu .mys-menu-divider {
    height: 1px;
    background-color: #e8ede9;
    margin: 4px 12px;
}

/* ============================================================
   Search (d-none by design, kept in place)
   ShareThis positioning
   ============================================================ */
#header .search-li .dropdown-menu {
    min-width: 340px;
    right: 0;
    left: auto;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.11);
    border: 1px solid #e3ede7;
    padding: 16px;
    margin-top: 4px;
}

/* Bottom nav row (auth + share) */
#header .mys-mobile-bottom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#header .sharethis-inline-share-buttons {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

/* ============================================================
   Mobile (< 992px) — collapse styles
   ============================================================ */
@media (max-width: 991.98px) {
    #header {
        padding: 0 16px;
    }

    #header .navbar {
        min-height: 60px;
    }

    #header .navbar-brand img {
        width: 160px;
    }

    #header .navbar-collapse {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    #header .mys-mega-panel {
        position: static !important;
        top: auto;
        width: 100%;
        border-top: none;
        border-left: 3px solid #21a341;
        box-shadow: none !important;
        padding: 10px 12px;
        display: none !important;
        background: #fafcfb;
    }

    #header .mys-mega-wrapper:hover .mys-mega-panel {
        display: none !important;
    }

    /* 2-col grid on tablet, 1-col on small phone */
    #header .mys-mega-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px 16px;
    }

    #header .mys-mega-col + .mys-mega-col {
        border-left: none;
        padding-left: 0;
        margin-top: 0;
    }

    /* Light separator between columns on mobile */
    #header .mys-mega-col {
        border-bottom: 1px solid #eef3ef;
        padding-bottom: 8px;
    }

    #header .mys-mega-col:last-child {
        border-bottom: none;
    }

    #header .mys-mega-col-head {
        font-size: 11px;
        padding-bottom: 6px;
        margin-bottom: 6px;
    }

    #header .mys-mega-links li a {
        font-size: 12.5px;
        padding: 4px 0 4px 4px;
    }

    #header .mys-mega-subhead {
        font-size: 9px;
        margin: 6px 0 2px 0;
        padding: 2px 0 2px 6px;
    }

    #header .mys-fp-link {
        margin-top: 6px;
        font-size: 12px;
        padding: 7px 12px;
    }

    /* Standard dropdown on mobile */
    #header .mys-std-dropdown .mys-std-menu,
    #header .mys-std-dropdown:hover .mys-std-menu {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        border-left: 3px solid #21a341 !important;
        border-radius: 0;
        padding: 4px 0 4px 10px;
        display: none !important;
        background: #fafcfb;
    }

    /* User dropdown on mobile */
    #header .mys-user-dropdown .mys-user-menu,
    #header .mys-user-dropdown:hover .mys-user-menu {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        border-left: 3px solid #21a341 !important;
        border-radius: 0;
        display: none !important;
    }

    #header .mys-user-trigger {
        height: auto;
        padding: 12px 0;
    }

    /* Nav link height on mobile */
    #header .navbar-nav > .nav-item > .nav-link {
        line-height: 1.4;
        padding: 12px 4px;
        border-bottom: 1px solid #f0f4f1;
    }

    #header .navbar-nav > .nav-item:last-child > .nav-link {
        border-bottom: none;
    }

    #header .navbar-nav > .nav-item > .nav-link::before {
        display: none;
    }

    /* Active state on mobile */
    #header .navbar-nav > .nav-item.active > .nav-link {
        color: #21a341;
        font-weight: 600;
        background: #f0faf3;
        border-radius: 6px;
    }

    /* Admin Dashboard / Login + Share — single row on mobile */
    #header .mys-mobile-bottom-row {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        border-top: 1px solid #f0f4f1;
    }

    #header .mys-mobile-bottom-row .btn-info,
    #header .mys-mobile-bottom-row .btn-mys-login {
        flex: 1;
        text-align: center;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 14px;
    }

    #header .mys-mobile-bottom-row .sharethis-inline-share-buttons {
        margin: 0;
        flex-shrink: 0;
    }

    /* Mobile toggles for mega/std dropdowns */
    .mys-mobile-toggle {
        cursor: pointer;
    }

    #header .mys-mega-panel.mys-open,
    #header .mys-std-menu.mys-open,
    #header .mys-user-menu.mys-open {
        display: block !important;
    }
}

/* Small phones — single column */
@media (max-width: 575.98px) {
    #header .mys-mega-grid {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }
}
