/* ===========================================================
   NAVBAR & MEGA MENU – FINAL (with clipping fixes)
   =========================================================== */

/* Ensure no overflow clipping */
header, .navbar, .container-fluid, .navbar-collapse {
    overflow: visible !important;
}

.navbar {
    padding: 12px 0;
    background: transparent;
    transition: all .35s ease;
    z-index: 999;
}

    .navbar .container-fluid {
        align-items: center;
    }

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
    transition: .3s;
}

    .navbar-brand img {
        width: 145px;
        height: auto;
        transition: .35s;
    }

    .navbar-brand:hover img {
        transform: scale(1.03);
    }

.navbar-nav {
    align-items: center;
    gap: 10px;
}

    .navbar-nav .nav-item {
        position: relative;
    }

    .navbar-nav .nav-link {
        position: relative;
        color: #ffffff !important;
        font-size: 15px;
        font-weight: 500;
        padding: 12px 16px !important;
        transition: .3s ease;
        letter-spacing: .2px;
    }

        .navbar-nav .nav-link.active {
            color: #64b5f6 !important;
            font-weight: 600;
        }
        .navbar-nav .nav-link::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 4px; /* adjust to align under text */
            height: 2px;
            background: #64b5f6;
            transform: scaleX(0);
            transform-origin: center; /* ? KEY: grows from center, not left */
            transition: transform .3s ease;
        }

        .navbar-nav .nav-link:hover::after,
        .navbar-nav .nav-link.active::after {
            transform: scaleX(1);
        }

        .navbar-nav .nav-link:hover {
            color: #64b5f6 !important;
        }

.dropdown-toggle::after {
    margin-left: .45rem;
    vertical-align: .15rem;
    transition: .3s;
}

.nav-item.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.navbar .btn-primary {
    background: #635BFF;
    border: none;
    border-radius: 40px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    transition: .35s;
}

    .navbar .btn-primary:hover {
        background: #4a42e0;
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(99, 91, 255, .25);
    }

.navbar-toggler {
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
}

    .navbar-toggler:focus {
        box-shadow: none;
    }

.navbar-toggler-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.embossed-logo {
    border-bottom: 3px solid #635BFF;
    padding-bottom: 4px;
}

/* -------- Mega Menu -------- */
.mega-dropdown {
    position: static;
}

.mega-menu {
    width: 100%;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0;
    padding: 20px 25px;
    border: none;
    border-radius: 0 0 12px 12px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(0,0,0,.12);
    display: none;
    border-top: 4px solid #635BFF;
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
    position: absolute;
}

.mega-dropdown:hover .mega-menu {
    display: block;
    animation: megaFade .25s ease;
}

@keyframes megaFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left panel */
.mega-menu img {
    width: 100%;
    border-radius: 12px;
    transition: .35s;
}

    .mega-menu img:hover {
        transform: scale(1.02);
    }

.mega-menu h3 {
    color: #0B2946;
    font-weight: 700;
    margin-top: 15px;
    margin-bottom: 15px;
}

.mega-menu p {
    color: #6c757d;
    line-height: 1.8;
    margin-bottom: 20px;
}

.mega-menu .btn {
    border-radius: 30px;
    padding: 10px 24px;
    font-weight: 600;
}

.mega-menu .btn-primary {
    background: #635BFF;
    border-color: #635BFF;
}

    .mega-menu .btn-primary:hover {
        background: #4a42e0;
        border-color: #4a42e0;
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(99, 91, 255, .25);
    }

.mega-heading {
    color: #0B2946;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 8px;
    position: relative;
}

    .mega-heading::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 60px;
        height: 3px;
        background: #635BFF;
        border-radius: 10px;
    }

/* Mega List – reduced padding */
.mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .mega-list li {
        position: relative;
        overflow: hidden;
        border-radius: 6px;
        transition: all .30s ease;
        margin-bottom: 2px;
    }

        .mega-list li:hover {
            background: #f5f7fa;
        }

        .mega-list li::before {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%) scaleY(0);
            width: 4px;
            height: 70%;
            border-radius: 5px;
            background: #635BFF;
            transition: .30s;
        }

        .mega-list li:hover::before {
            transform: translateY(-50%) scaleY(1);
        }

        .mega-list li a {
            display: flex;
            align-items: center;
            padding: 6px 10px;
            border-radius: 6px;
            font-weight: 500;
            color: #495057;
            text-decoration: none;
            font-size: 14px;
            line-height: 1.3;
            transition: all .30s ease;
        }

        .mega-list li:hover a {
            color: #0B2946;
            transform: translateX(4px);
        }

        .mega-list li a i {
            font-size: 13px;
            margin-right: 8px;
            width: 16px;
            text-align: center;
            color: #635BFF;
            transition: all .30s ease;
        }

        .mega-list li:hover a i {
            color: #4a42e0;
            transform: translateX(3px);
        }

/* Column spacing */
.mega-menu .col-lg-4 {
    padding-left: 18px;
    padding-right: 18px;
}

.mega-menu .border-end {
    border-right: 1px solid #edf2f7 !important;
}

/* Responsive */
@media (max-width: 991.98px) {
    .navbar {
        padding: 12px 0;
    }

    .navbar-collapse {
        margin-top: 15px;
        background: #0B2946;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 15px 35px rgba(0,0,0,.15);
        overflow: visible !important;
    }

    .navbar-nav {
        gap: 0;
    }

        .navbar-nav .nav-item {
            width: 100%;
        }

        .navbar-nav .nav-link {
            padding: 14px 10px !important;
            border-bottom: 1px solid rgba(255,255,255,.08);
        }

            .navbar-nav .nav-link::after {
                display: none;
            }

    .mega-dropdown {
        position: relative;
    }

    .mega-menu {
        position: static !important;
        width: 100%;
        display: block;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 15px 0;
        animation: none;
        border-top: none;
        max-height: none;
        overflow-y: visible;
    }

        .mega-menu .container-fluid {
            padding: 0;
        }

        .mega-menu .row {
            display: block;
        }

        .mega-menu .col-lg-4 {
            width: 100%;
            padding: 0;
            margin-bottom: 30px;
        }

        .mega-menu .border-end {
            border-right: none !important;
            border-bottom: 1px solid #ececec;
            padding-bottom: 20px;
            margin-bottom: 20px;
        }

        .mega-menu img {
            max-width: 100%;
            margin-bottom: 15px;
        }

    .mega-heading {
        margin-top: 15px;
        font-size: 18px;
    }

    .mega-list li {
        margin-bottom: 2px;
    }

        .mega-list li a {
            padding: 4px 6px;
        }

    .navbar .btn-primary {
        width: 100%;
        margin-top: 20px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .mega-menu {
        padding: 25px;
    }

    .mega-heading {
        font-size: 15px;
    }

    .mega-list a {
        font-size: 13px;
    }
}

@media (min-width: 1400px) {
    .mega-menu {
        padding: 30px 40px;
    }

    .mega-heading {
        font-size: 18px;
    }

    .mega-list a {
        font-size: 15px;
    }
}

.navbar.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #0B2946;
    box-shadow: 0 12px 35px rgba(0,0,0,.12);
    z-index: 1050;
    animation: slideDown .35s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.nav-link:focus,
.dropdown-item:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 .2rem rgba(99, 91, 255, .25);
}
/* FORCE FIX – ensure mega-menu opens and isn't clipped */
.mega-dropdown {
    position: static !important;
}

    .mega-dropdown:hover .mega-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

.mega-menu {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    overflow: visible !important; /* prevent clipping */
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(0,0,0,.12);
    border-top: 4px solid #635BFF;
    padding: 20px 25px;
    max-height: 80vh;
    overflow-y: auto; /* scroll if too tall */
}

/* Ensure all parents allow overflow */
header, .navbar, .container-fluid, .navbar-collapse {
    overflow: visible !important;
}

/* On mobile, reset to static */
@media (max-width: 991.98px) {
    .mega-menu {
        position: static !important;
        max-height: none;
        overflow-y: visible;
    }
}