/* ============================================================
   VAASTU MAHAJEEVAN
   HEADER.CSS
   Topbar + Main Header + Mega Menu + Mobile Menu
   ============================================================ */

/* ============================================================
   TOP UTILITY BAR
   ============================================================ */

.topbar {
    width: 100%;
    background: var(--navy-950);
    color: var(--muted-light);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
}

.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.topbar-services {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.topbar-services span {
    color: var(--gold-400);
    margin: 0 10px;
}

.topbar-services span:first-child {
    margin-left: 0;
}

.topbar-services i {
    color: rgba(255, 255, 255, 0.35);
    font-style: normal;
}

.topbar-contact {
    display: flex;
    align-items: center;
    gap: 22px;
}

.topbar-contact a {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: var(--muted-light);

    white-space: nowrap;

    transition: color 0.25s ease;
}

.topbar-contact a:hover {
    color: var(--gold-400);
}

.topbar-contact svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ============================================================
   MAIN HEADER
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 500;

    width: 100%;

    background: #fff;

    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);

    border-bottom: 1px solid var(--line);

    transition:
        box-shadow 0.4s ease,
        background 0.3s ease;
}

.site-header.scrolled {
    background: #fff;

    box-shadow: 0 10px 30px rgba(14, 23, 41, 0.07);
}

/* ============================================================
   NAVIGATION ROW
   ============================================================ */

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 82px;

    padding-top: 14px;
    padding-bottom: 14px;

    transition:
        min-height 0.35s var(--ease),
        padding 0.35s var(--ease);
}

.site-header.scrolled .nav-row {
    min-height: 68px;

    padding-top: 9px;
    padding-bottom: 9px;
}

/* ============================================================
   BRAND
   ============================================================ */

.site-header > .container > .brand {
    display: inline-flex;
    align-items: center;

    gap: 13px;

    flex-shrink: 0;
}

.site-header .brand-mark {
    width: 46px;
    height: 46px;

    display: block;

    object-fit: contain;
    flex-shrink: 0;

    transition:
        width 0.35s var(--ease),
        height 0.35s var(--ease);
}

.site-header .brand-logo {
    width: 220px;
    height: 70px;

    display: block;

    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.site-header.scrolled .brand-mark {
    width: 40px;
    height: 40px;
}

.site-header .brand-text {
    min-width: 0;
}

.site-header .brand-text .brand-name {
    font-family: var(--font-display);

    font-size: 1.36rem;
    font-weight: 700;

    line-height: 1.05;

    color: var(--ink);

    white-space: nowrap;
}

.site-header .brand-text .brand-tag {
    margin-top: 3px;

    font-size: 0.66rem;
    line-height: 1.2;

    letter-spacing: 0.09em;
    text-transform: uppercase;

    color: var(--gold-600);

    font-weight: 700;

    white-space: nowrap;
}

/* ============================================================
   DESKTOP MAIN NAV
   ============================================================ */

.main-nav {
    display: flex;
    align-items: center;

    gap: 2px;

    margin-left: auto;
    margin-right: 20px;
}

.main-nav > a,
.nav-mega-trigger {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 10px 13px;

    border: 0;
    background: transparent;

    font-family: var(--font-body);

    font-size: 0.88rem;
    font-weight: 600;

    color: var(--ink);

    white-space: nowrap;

    cursor: pointer;

    transition:
        color 0.25s ease,
        background 0.25s ease;
}

.main-nav > a::after,
.nav-mega-trigger::after {
    content: "";

    position: absolute;

    left: 13px;
    right: 13px;
    bottom: 3px;

    height: 2px;

    background: var(--gold-500);

    transform: scaleX(0);

    transform-origin: center;

    transition: transform 0.3s var(--ease);
}

.main-nav > a:hover,
.nav-mega-trigger:hover {
    color: var(--ink);
}

.main-nav > a:hover::after,
.nav-mega-trigger:hover::after,
.nav-mega.is-open .nav-mega-trigger::after {
    transform: scaleX(1);
}

/* ============================================================
   LEGAL SERVICES TRIGGER
   ============================================================ */

.nav-mega {
    position: static;
}

.nav-mega-trigger {
    gap: 6px;
}

.mega-arrow {
    width: 14px;
    height: 14px;

    transition: transform 0.3s var(--ease);
}

.nav-mega:hover .mega-arrow,
.nav-mega.is-open .mega-arrow {
    transform: rotate(180deg);
}

/* ============================================================
   MEGA MENU
   ============================================================ */

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(169, 132, 63, 0.18);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 22px 55px rgba(14, 30, 54, 0.13);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity 0.28s ease,
        transform 0.28s var(--ease),
        visibility 0.28s ease;
}

.nav-mega:hover .mega-menu,
.nav-mega.is-open .mega-menu {
    opacity: 1;

    visibility: visible;

    pointer-events: auto;

    transform: translateY(0);
}

/* ============================================================
   MEGA INNER
   ============================================================ */

.mega-inner {
    width: min(1240px, calc(100% - 40px));

    margin: 0 auto;

    padding: 16px 0 18px;

    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    align-items: start;

    column-gap: 18px;

    row-gap: 10px;
}

/* ============================================================
   MEGA INTRO
   ============================================================ */

.mega-intro {
    padding-right: 24px;

    border-right: 1px solid var(--line);
}

.mega-kicker {
    display: inline-block;

    margin-bottom: 10px;

    font-size: 0.68rem;
    font-weight: 800;

    letter-spacing: 0.14em;

    color: var(--gold-600);
}

.mega-intro h3 {
    margin: 0 0 12px;

    font-family: var(--font-display);

    font-size: 1.65rem;
    line-height: 1.08;

    color: var(--ink);
}

.mega-intro p {
    margin: 0 0 20px;

    max-width: 300px;

    font-size: 0.82rem;

    line-height: 1.65;

    color: var(--muted);
}

.mega-view-all {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-size: 0.78rem;

    font-weight: 800;

    color: var(--ink);

    transition:
        color 0.25s ease,
        gap 0.25s ease;
}

.mega-view-all span {
    color: var(--gold-600);

    font-size: 1rem;
}

.mega-view-all:hover {
    color: var(--gold-600);
    gap: 12px;
}

/* ============================================================
   MEGA COLUMNS
   ============================================================ */

.mega-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.mega-heading {
    margin-bottom: 10px;

    padding: 0 10px 10px;

    border-bottom: 1px solid var(--line);

    color: var(--ink);

    font-size: 0.72rem;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.mega-column > a {
    display: flex;

    flex-direction: column;

    gap: 3px;

    padding: 8px 8px;

    margin: 0 -8px;

    border-radius: 8px;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.mega-column > a:hover {
    background: rgba(169, 132, 63, 0.07);
    box-shadow: inset 0 0 0 1px rgba(169, 132, 63, 0.12);
    transform: translateX(3px);
}

.mega-column strong {
    color: var(--ink);

    font-size: 0.79rem;

    font-weight: 700;

    line-height: 1.32;
}

.mega-column > a:hover strong {
    color: var(--gold-600);
}

.mega-column > a span {
    color: var(--muted);

    font-size: 0.67rem;

    line-height: 1.4;
}

/* ============================================================
   MEGA BOTTOM
   ============================================================ */

.mega-bottom {
    grid-column: 1 / -1;

    margin-top: 12px;

    padding-top: 12px;

    border-top: 1px solid var(--line);

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;
}

.mega-bottom > div {
    display: flex;

    align-items: baseline;

    gap: 10px;
}

.mega-bottom-label {
    color: var(--ink);

    font-size: 0.8rem;

    font-weight: 800;
}

.mega-bottom-text {
    color: var(--muted);

    font-size: 0.72rem;
}

/* ============================================================
   HEADER ACTIONS
   ============================================================ */

.nav-actions {
    display: flex;

    align-items: center;

    gap: 12px;

    flex-shrink: 0;
}

.nav-cta {
    display: inline-flex;
}

/* ============================================================
   HAMBURGER
   ============================================================ */

.hamburger {
    display: none;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background: var(--navy-950);

    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 5px;

    flex-shrink: 0;

    cursor: pointer;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.hamburger:hover {
    background: var(--navy-800);
}

.hamburger span {
    display: block;

    width: 18px;
    height: 2px;

    background: var(--gold-400);

    border-radius: 2px;

    transition:
        transform 0.3s var(--ease),
        opacity 0.2s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   TABLET / MOBILE HEADER
   ============================================================ */

@media (max-width: 1080px) {
    .main-nav {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-menu {
    position: fixed;

    inset: 0;

    z-index: 1000;

    width: 100%;
    height: 100dvh;

    background: var(--navy-950);

    display: flex;
    flex-direction: column;

    padding: max(22px, env(safe-area-inset-top)) 28px
        max(28px, env(safe-area-inset-bottom));

    overflow-y: auto;

    overscroll-behavior: contain;

    transform: translateY(-100%);

    visibility: hidden;

    pointer-events: none;

    transition:
        transform 0.5s var(--ease),
        visibility 0.5s ease;
}

.mobile-menu.open {
    transform: translateY(0);

    visibility: visible;

    pointer-events: auto;
}

/* ============================================================
   MOBILE MENU TOP
   ============================================================ */

.mobile-menu-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    margin-bottom: 32px;
}

.mobile-menu .brand {
    display: inline-flex;

    align-items: center;

    gap: 13px;

    flex-shrink: 0;
}

.mobile-menu .brand-mark {
    width: 46px;
    height: 46px;

    object-fit: contain;
    flex-shrink: 0;
}

.mobile-menu .brand-logo {
    width: 200px;
    height: 64px;

    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.mobile-menu .brand-text {
    min-width: 0;
}

.mobile-menu .brand-text .brand-name {
    font-family: var(--font-display);

    font-size: 1.36rem;

    font-weight: 700;

    line-height: 1.05;

    color: var(--white);

    white-space: nowrap;
}

/* ============================================================
   MOBILE CLOSE
   ============================================================ */

.mobile-menu-close {
    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.08);

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    color: var(--gold-400);

    cursor: pointer;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.14);

    transform: rotate(90deg);
}

.mobile-menu-close svg {
    width: 19px;
    height: 19px;
}

/* ============================================================
   MOBILE NAV
   ============================================================ */

.mobile-nav {
    display: flex;

    flex-direction: column;

    width: 100%;
}

.mobile-nav > a,
.mobile-nav-toggle {
    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    padding: 15px 4px;

    border: 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.09);

    background: transparent;

    color: var(--white);

    font-family: var(--font-display);

    font-size: clamp(1.25rem, 5vw, 1.5rem);

    font-weight: 600;

    line-height: 1.2;

    text-align: left;

    cursor: pointer;

    transition:
        color 0.25s ease,
        padding-left 0.25s ease;
}

.mobile-nav > a:hover,
.mobile-nav-toggle:hover {
    color: var(--gold-400);

    padding-left: 9px;
}

.mobile-nav > a small,
.mobile-nav-toggle small {
    color: var(--gold-400);

    font-family: var(--font-body);

    font-size: 0.7rem;

    font-weight: 700;

    letter-spacing: 0.08em;

    flex-shrink: 0;
}

/* ============================================================
   MOBILE LEGAL DROPDOWN
   ============================================================ */

.mobile-nav-dropdown {
    width: 100%;
}

.mobile-nav-toggle {
    position: relative;
}

.mobile-nav-right {
    display: flex;

    align-items: center;

    gap: 12px;
}

.mobile-nav-arrow {
    width: 17px;
    height: 17px;

    color: var(--gold-400);

    transition: transform 0.3s var(--ease);
}

.mobile-nav-dropdown.is-open .mobile-nav-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    max-height: 0;

    overflow: hidden;

    opacity: 0;

    transition:
        max-height 0.45s var(--ease),
        opacity 0.25s ease;
}

.mobile-nav-dropdown.is-open .mobile-submenu {
    max-height: 650px;

    opacity: 1;
}

.mobile-submenu a {
    display: flex;

    align-items: center;

    padding: 12px 8px 12px 18px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.055);

    color: rgba(255, 255, 255, 0.72);

    font-family: var(--font-body);

    font-size: 0.86rem;

    line-height: 1.35;

    transition:
        color 0.25s ease,
        padding-left 0.25s ease;
}

.mobile-submenu a::before {
    content: "";

    width: 5px;
    height: 5px;

    margin-right: 10px;

    border-radius: 50%;

    background: var(--gold-500);

    opacity: 0.8;
}

.mobile-submenu a:hover {
    color: var(--gold-400);

    padding-left: 23px;
}

/* ============================================================
   MOBILE FOOTER
   ============================================================ */

.mobile-menu-footer {
    display: flex;

    flex-direction: column;

    gap: 12px;

    margin-top: auto;

    padding-top: 30px;
}

.mobile-menu-footer > a:not(.btn) {
    display: flex;

    align-items: center;

    color: var(--muted-light);

    font-size: 0.9rem;

    line-height: 1.4;

    transition: color 0.25s ease;
}

.mobile-menu-footer > a:not(.btn):hover {
    color: var(--gold-400);
}

.mobile-menu-footer .btn {
    margin-top: 8px;
}

/* ============================================================
   TOPBAR MOBILE
   ============================================================ */

@media (max-width: 860px) {
    .topbar {
        display: none;
    }
}

/* ============================================================
   SMALL DEVICES
   ============================================================ */

@media (max-width: 560px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-row {
        min-height: 70px;

        padding-top: 10px;
        padding-bottom: 10px;
    }

    .site-header.scrolled .nav-row {
        min-height: 62px;

        padding-top: 8px;
        padding-bottom: 8px;
    }

    .site-header .brand-mark,
    .site-header.scrolled .brand-mark {
        width: 40px;
        height: 40px;
    }

    .site-header .brand-logo {
        width: 190px;
        height: 60px;
    }

    .site-header .brand-text .brand-name {
        font-size: 1.18rem;
    }

    .site-header .brand-text .brand-tag {
        display: none;
    }

    .hamburger {
        width: 40px;
        height: 40px;
    }

    .mobile-menu {
        padding-left: 20px;
        padding-right: 20px;
    }

    .mobile-menu-top {
        margin-bottom: 25px;
    }

    .mobile-menu .brand-mark {
        width: 40px;
        height: 40px;
    }

    .mobile-menu .brand-logo {
        width: 180px;
        height: 58px;
    }

    .mobile-menu .brand-text .brand-name {
        font-size: 1.18rem;
    }

    .mobile-menu-close {
        width: 40px;
        height: 40px;
    }

    .mobile-nav > a,
    .mobile-nav-toggle {
        padding-top: 13px;
        padding-bottom: 13px;

        font-size: 1.28rem;
    }

    .mobile-submenu a {
        font-size: 0.82rem;
    }
}

/* ============================================================
   VERY SMALL DEVICES
   ============================================================ */

@media (max-width: 380px) {
    .site-header .brand-text .brand-name {
        font-size: 1.06rem;
    }

    .mobile-menu .brand-text .brand-name {
        font-size: 1.06rem;
    }

    .mobile-nav > a,
    .mobile-nav-toggle {
        font-size: 1.18rem;
    }
}

/* Updated service-focused mega menu: three balanced service-list columns */
.mega-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mega-column {
    min-width: 0;
}
.mega-column > a {
    padding-top: 7px;
    padding-bottom: 7px;
}
@media (max-width: 900px) {
    .mega-inner {
        width: min(100% - 32px, 760px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 22px;
    }
    .mega-bottom {
        grid-column: 1 / -1;
    }
}
@media (max-width: 560px) {
    .mega-inner {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   FOUR-COLUMN SERVICES MEGA MENU — RESPONSIVE
   ============================================================ */
.mega-inner {
    width: min(1400px, calc(100% - 40px));
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 22px;
    align-items: start;
}
.mega-column {
    min-width: 0;
}
.mega-heading {
    font-size: 0.68rem;
    line-height: 1.4;
    min-height: 34px;
}
.mega-column > a {
    padding: 7px 8px;
    margin-left: -8px;
    margin-right: -8px;
}
.mega-column strong {
    font-size: 0.78rem;
    line-height: 1.35;
}
.mega-column > a span {
    font-size: 0.66rem;
    line-height: 1.4;
}
.mega-bottom {
    grid-column: 1 / -1;
}
@media (max-width: 1100px) {
    .mega-inner {
        width: min(960px, calc(100% - 32px));
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 28px;
        row-gap: 22px;
    }
    .mega-heading {
        min-height: 0;
    }
}
@media (max-width: 700px) {
    .mega-menu {
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
    }
    .mega-inner {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
        row-gap: 18px;
        padding-top: 22px;
        padding-bottom: 20px;
    }
    .mega-column > a {
        padding-top: 9px;
        padding-bottom: 9px;
    }
    .mega-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .mega-bottom > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}
@media (max-width: 560px) {
    .mega-inner {
        width: calc(100% - 28px);
    }
}

/* ============================================================
   MOBILE: SHOW ALL DESKTOP SERVICES IN THE NAV MENU
   ============================================================ */
.mobile-nav-dropdown.is-open .mobile-submenu {
    max-height: 65vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.mobile-submenu a {
    min-height: 42px;
    overflow-wrap: anywhere;
}
@media (max-width: 700px) {
    .mobile-menu {
        overflow-y: auto;
    }
    .mobile-nav-dropdown.is-open .mobile-submenu {
        max-height: 45vh;
    }
}

/* Bootstrap dropdowns used by the shared frontend navigation. */
.site-header .nav-link.dropdown-toggle::after {
    display: none;
}

.site-header .nav-dropdown-icon {
    margin-left: 5px;
    font-size: 0.68rem;
    transition: transform 180ms ease;
}

.site-header .dropdown.show .nav-dropdown-icon {
    transform: rotate(180deg);
}

.site-header .dropdown-menu {
    min-width: 210px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(50, 20, 14, 0.14);
}

.site-header .dropdown-item,
.site-header .dropdown-item-text {
    padding: 9px 12px;
    border-radius: 5px;
    color: var(--ink);
    font-family: var(--body);
    font-size: 0.84rem;
    line-height: 1.45;
    white-space: normal;
}

.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus {
    color: var(--maroon);
    background: var(--cream);
}

@media (min-width: 992px) {
    .site-header .nav-item.dropdown:hover > .dropdown-menu,
    .site-header .nav-item.dropdown:focus-within > .dropdown-menu {
        display: block;
    }

    .site-header .dropdown-menu {
        margin-top: 0;
    }
}

@media (max-width: 991px) {
    .site-header .dropdown-menu {
        margin: 0 0 8px 10px;
        border: 0;
        border-left: 2px solid var(--gold);
        border-radius: 0;
        box-shadow: none;
    }
}
