/* Top Header */
.top-header {
    background: #61386e;
    padding: 3px 0;
    font-size: 14px;
    color: #fff;
    border-bottom: 1px solid #eee;
}

.small,
small i {
    color: #fff;
    font-size: 17px;
}

.middle-header {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.middle-header .logo img {
    height: 100%;
}

.middle-header .upper-right {
    position: relative;
}

.middle-header .info-box {
    position: relative;
    text-align: left;
    padding-top: 3px;
    padding-bottom: 0px;
    font-size: 16px;
    margin-left: 30px;
    padding-left: 52px;
    border-left: 1px solid #ccc;
}

.middle-header .info-box ul li {
    position: relative;
    line-height: 1.6em;
    font-weight: 300;
    margin: 0;
    color: #7c7c80;
    font-size: 14px;
    text-transform: capitalize;
}

/* Navbar */
.navbar {
    padding: 0;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0px 2px 11px #0000001f;
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background-color: #61386e;
    font-weight: 600;
}
.navbar-nav li .nav-link {
    position: relative;
    display: block;
    font-weight: 500;
    border-right: 1px dotted #ccc;
    padding: 15px 28px 15px !important;
    text-align: center;
    line-height: 30px;
    letter-spacing: 0px;
    color: #555;
    font-size: 15px;
    text-transform: capitalize;
    transition: all 500ms ease;
    -moz-transition: all 500ms ease;
    -webkit-transition: all 500ms ease;
    -ms-transition: all 500ms ease;
    -o-transition: all 500ms ease;
}

.navbar-nav li:last-child .nav-link {
    border-right: none;
}

.navbar-nav li .nav-link:hover {
    color: #fff !important;
    background-color: #61386e;
}

.dropdown-menu {
    display: none;
    width: auto;
    z-index: 9999;
    line-height: 30px;
    border-top: 3px solid #084d7e;
    border-radius: 0px;
    box-shadow: 0px 4px 5px #00000080;
    padding: 0;
}

.dropdown-item {
    display: block;
    border-bottom: 1px dotted #ccc;
    width: 100%;
    padding: 5px 15px;
    font-size: 14px;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    color: #555;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border-radius: 0;
}

.dropdown-item:hover {
    color: #61386e;
}

/* =====================
   Mega Menu (Desktop)
   ===================== */
/* Allow the dropdown parent to not clip the mega menu */
.mega-dropdown {
    position: static !important;
    overflow: visible !important;
}

/* Force a full-width, viewport-level dropdown for mega menu */
.dropdown-menu.mega-menu {
    position: fixed !important;
    top: auto; /* JS will set exact offset below navbar */
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 0 !important;
    box-shadow: none !important; /* flat style */
    background: #fff !important;
    z-index: 1050 !important;

    /* Appear animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease-out,
        transform 0.28s cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
    will-change: transform, opacity;
}

/* When Bootstrap toggles .show, animate in */
.dropdown-menu.mega-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Keep navbar above the mega menu trigger area */
#mainNavbar {
    position: relative;
    z-index: 1100;
}

/* Inner container centered and constrained */
.mega-menu .mega-menu-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 28px; /* more compact */
    max-height: 70vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Grid of items */
.mega-menu .mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px; /* tighter grid gap */
}

@media (min-width: 1400px) {
    .mega-menu .mega-menu-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .mega-menu .mega-menu-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .mega-menu .mega-menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .mega-menu .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .mega-menu .mega-menu-content {
        padding: 20px;
    }
}

/* Item styling */
.mega-menu .mega-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px; /* compact padding */
    /* background: #f8fafc; */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #2d3748;
    min-height: 64px; /* compact height */
    transition: transform 0.7s ease, color 0.7s ease, border-color 0.7s ease;
    will-change: transform;
    position: relative;
    overflow: hidden; /* for gradient overlay */
}

/* gradient overlay for smooth background transition */
.mega-menu .mega-menu-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #61386e 0%, #4a2755 100%);
    opacity: 0;
    transition: opacity 0.7s ease;
    z-index: 0;
}

.mega-menu .mega-menu-item:hover {
    color: #fff;
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(97, 56, 110, 0.24);
}

.mega-menu .mega-menu-item:hover::before {
    opacity: 1;
}

.mega-menu .mega-menu-icon {
    width: 40px; /* smaller icon wrapper */
    height: 40px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* flatter */
    transition: transform 0.7s ease, background 0.7s ease;
    z-index: 1; /* above overlay */
}

.mega-menu .mega-menu-icon img {
    max-width: 26px; /* smaller icon */
    max-height: 26px;
    object-fit: contain;
    transition: transform 0.7s ease, filter 0.7s ease;
}

.mega-menu .mega-menu-item:hover .mega-menu-icon {
    transform: translateY(-1px) rotate(2deg);
}

.mega-menu .mega-menu-item:hover .mega-menu-icon img {
    transform: scale(1.06);
    filter: brightness(1) contrast(1.02);
}

.mega-menu .mega-menu-title {
    /* font-weight: 600; */
    font-size: 14px; /* smaller text */
    line-height: 1.35;
    position: relative;
    z-index: 1; /* above overlay */
}

.nav-link:focus-visible {
    box-shadow: none !important;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .dropdown-menu.mega-menu,
    .dropdown-menu.mega-menu.show,
    .mega-menu .mega-menu-item,
    .mega-menu .mega-menu-icon,
    .mega-menu .mega-menu-icon img {
        transition: none !important;
    }
}

/* Sticky Navbar */
.sticky-nav {
    position: fixed;
    top: 0;
    height: 60px;
    width: 100%;
    z-index: 999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Sticky Logo */
.navbar-brand {
    padding: 0;
}
.navbar-brand img {
    height: auto;
    width: 150px;
    transition: all 0.3s ease;
}

.sticky-nav .navbar-brand {
    display: block;
    /* show when sticky */
}

.mobile-toggle1 {
    display: none;
}

/* Mobile */
@media (max-width: 991px) {
    .navbar-brand {
        display: block !important;
        /* always visible in mobile */
    }

    .middle-header {
        display: none;
    }

    /* hide middle header in mobile */
}

/* Mobile Sidebar Menu */
@media (max-width: 991px) {
    .navbar-brand {
        display: block !important; /* always visible in mobile */
    }
    .middle-header {
        display: none;
    } /* hide middle header in mobile */
    .navbar-collapse {
        display: none !important; /* hide bootstrap collapse */
    }
    .mobile-toggle {
        display: block;
        background: #fff;
        border: none;
        font-size: 28px;
    }
    .navbar {
        display: none;
    }

    .mobile-toggle1 {
        position: fixed;
        z-index: 9999;
        width: 100%;
        top: 0;
        display: block;
        background: #fff !important;
        border: none;
        padding: 10px 15px;
        box-shadow: 0px 2px 5px #0000004f;
        transition: all 0.3s ease;
    }

    .mobile-toggle2 button svg {
        font-size: 24px;
        margin-top: 22px;
        cursor: pointer;
        background-color: #fff !important;
    }

    .mobile-toggle1 .logo {
        float: right;
    }
}
/* Mobile menu hidden by default */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    color: #2b2b2b;
    padding: 20px;
    transition: right 0.3s ease-in-out;
    z-index: 9999;
    overflow: hidden; /* keep header fixed and body scrollable */
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.16); /* separation from page */
}

.mobile-menu.open {
    right: 0;
}

/* Also support .active for current JS */
.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
}

.mobile-menu ul li {
    margin: 0;
    border-bottom: 1px solid #ededed;
}

.mobile-menu ul li a {
    display: block;
    padding: 14px 22px; /* more spacing */
    color: #2b2b2b;
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mobile-menu .mobile-close {
    font-size: 26px;
    cursor: pointer;
    display: block;
    text-align: right;
}

/* Keep header compact and body scrollable */
.mobile-menu-header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid #eee;
}
.mobile-menu-body {
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding-bottom: 12px;
}

/* Base submenu hidden */
.mobile-menu ul .submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: none; /* let the page scroll, not inner panel */
    overflow: visible;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    transition: all 0.3s ease-in-out;
}

/* Submenu items */
.mobile-menu ul .submenu li a {
    display: block;
    padding: 10px 18px 10px 28px; /* indent child items */
    color: #2b2b2b;
    margin: 0;
    font-size: 12.5px;
    text-transform: none;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #f3f3f3;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Remove border on last item */
.mobile-menu ul .submenu li:last-child a {
    border-bottom: none;
}

/* When submenu is active/open */
.mobile-menu ul .submenu.open,
.mobile-menu ul .submenu.active {
    display: block;
    transition: all 0.3s ease-in-out;
}

/* Right-aligned caret like the reference */
.mobile-menu .dropdown-toggle {
    position: relative;
    padding-right: 36px;
}
.mobile-menu .dropdown-toggle::after {
    display: block;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    margin-left: 0;
    content: "";
    border-top: 0.35em solid;
    border-right: 0.35em solid transparent;
    border-bottom: 0;
    border-left: 0.35em solid transparent;
}
.mobile-menu .dropdown-toggle[aria-expanded="true"]::after,
.mobile-menu .dropdown-toggle.active::after {
    transform: translateY(-50%) rotate(180deg);
}

@media only screen and (max-width: 678px) {
    .mobile-toggle1 {
        /* position: fixed; */
        z-index: 9999;
        width: 100%;
        top: 0;
        display: block;
        background: #fff !important;
        border: none;
        padding: 10px 15px;
        box-shadow: 0px 2px 5px #0000004f;
        transition: all 0.3s ease;
    }

    .mobile-toggle2 button svg {
        font-size: 24px;
        margin-top: 22px;
        cursor: pointer;
        background-color: #fff !important;
    }

    .mobile-toggle1 .logo {
        float: right;
    }
    .mobilemargin-top {
        margin-top: 150px !important;
    }
}
