/* =========================================================
   HEADER
========================================================= */

.site-header {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 120px;

    background: rgba(238, 242, 243, 0.50) !important;

    border-bottom: 1px solid #3535A7;

    z-index: 9999;
}

.header-inner {
    width: min(100% - 70px, 1480px);
    height: 120px;

    margin: 0 auto;

    display: flex;
    align-items: center;

    gap: 30px;
}


/* =========================================================
   LOGO
========================================================= */

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-logo img {
    display: block;
    width: 250px;
    height: auto;
    /* max-height: 120px; */
    object-fit: contain;
}


/* =========================================================
   MAIN NAVIGATION
========================================================= */

.main-navigation {
    margin-left: auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 31px;
}

.nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    height: 120px;

    color: #273264;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;

    white-space: nowrap;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

/* Hover pill is drawn by a pseudo-element, so the link's own box
   (height / padding) never changes on hover = no flicker, no reflow. */
.nav-link {
    isolation: isolate;
}

.nav-link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -10px;
    right: -10px;
    height: 40px;

    transform: translateY(-50%);
    border-radius: 25px;
    background-color: #1B1B53;

    opacity: 0;
    z-index: -1;
    pointer-events: none;

    transition: opacity 0.2s ease;
}

.nav-link:hover,
.nav-item.has-mega-menu:hover > .nav-link {
    color: #A5F0FA;
}

.nav-link:hover::before,
.nav-item.has-mega-menu:hover > .nav-link::before {
    opacity: 1;
}

.nav-link.active {
    color: #1727ff;
}


/* =========================================================
   LANGUAGE SWITCHER
========================================================= */

.language-switcher {
    position: relative;
    flex-shrink: 0;
}

.language-toggle {
    min-width: 94px;
    height: 38px;

    padding: 0 12px;

    border: 0;
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.75);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    color: #273264;

    font-family: inherit;
    font-size: 13px;
    font-weight: 500;

    cursor: pointer;
}

.language-current {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.language-flag {
    font-size: 16px;
    line-height: 1;
}

.language-arrow {
    font-size: 18px;
    line-height: 1;
    transform: translateY(-2px);

    transition: transform 0.2s ease;
}

.language-switcher.open .language-arrow {
    transform: rotate(180deg) translateY(2px);
}


/* =========================================================
   LANGUAGE DROPDOWN
========================================================= */

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    width: 150px;

    padding: 7px;

    background: #ffffff;

    border: 1px solid rgba(20, 35, 70, 0.12);
    border-radius: 8px;

    box-shadow:
        0 12px 30px rgba(20, 35, 70, 0.12);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.language-switcher.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    width: 100%;
    min-height: 36px;

    padding: 7px 9px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 5px;

    color: #273264;

    font-size: 13px;
    font-weight: 400;

    text-decoration: none;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.language-option:hover {
    background: #f1f4f6;
    color: #1727a0;
}

.language-option .language-flag {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}


/* =========================================================
   MOBILE MENU
========================================================= */

.mobile-menu-toggle {
    display: none;

    width: 42px;
    height: 42px;

    padding: 8px;

    border: 0;
    background: transparent;

    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;

    width: 25px;
    height: 2px;

    margin: 5px auto;

    background: #273264;

    transition: 0.2s ease;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .header-inner {
        width: min(100% - 40px, 1180px);
        gap: 20px;
    }

    .site-logo img {
        width: 190px;
    }

    .main-navigation {
        gap: 20px;
    }

    .nav-link {
        font-size: 12px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 850px) {

    .site-header {
        height: 75px;
    }

    .header-inner {
        width: calc(100% - 30px);
    }

    .site-logo img {
        width: 185px;
        max-height: 62px;
    }

    .main-navigation {
        position: absolute;

        top: 75px;
        left: 15px;
        right: 15px;

        padding: 15px;

        background: #ffffff;

        border-radius: 0 0 8px 8px;

        box-shadow: 0 12px 30px rgba(20, 35, 70, 0.12);

        display: none;
        flex-direction: column;
        align-items: stretch;

        gap: 0;
    }

    .main-navigation.mobile-open {
        display: flex;
    }

    .nav-link {
        height: auto;
        min-height: 45px;

        padding: 10px 12px;

        border-bottom: 1px solid #eef0f2;
    }

    .nav-link:last-child {
        border-bottom: 0;
    }

    .language-switcher {
        margin-left: auto;
    }

    .mobile-menu-toggle {
        display: block;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .header-inner {
        width: calc(100% - 20px);
    }

    .site-logo img {
        width: 155px;
    }

    .language-toggle {
        min-width: 82px;
        padding: 0 9px;
    }

    .mobile-menu-toggle {
        width: 38px;
    }

}

/* =========================================================
   SERVICES MEGA MENU
========================================================= */

.nav-item.has-mega-menu {
    position: static;
}

.services-mega-menu {
    position: absolute;

    top: 100%;
    left: 0;
    right: 0;

    width: calc(100% - 0px);
    min-height: 548px;

    padding: 0;

    background: #ffffff;

    border-radius: 0 0 18px 18px;

    box-shadow:
        0 18px 45px rgba(20, 35, 70, 0.15);

    display: flex;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-8px);

    /* Short close delay = forgiving when the cursor drifts; no delay on open */
    transition:
        opacity 0.2s ease 0.1s,
        visibility 0s linear 0.3s,
        transform 0.2s ease 0.1s;

    will-change: opacity, transform;

    overflow: hidden;

    z-index: 9998;
}


/* Open when Services is hovered */

.nav-item.has-mega-menu:hover .services-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0);
}


/* =========================================================
   LEFT IMAGE
========================================================= */

.services-image {
    width: 25%;

    min-width: 300px;

    height: 548px;

    overflow: hidden;

    border-radius:  25px;

    flex-shrink: 0;
}

.services-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   SERVICES LIST
========================================================= */

.services-list {
    flex: 1;

    display: grid;
    grid-template-columns: 1fr 1fr;

    column-gap: 70px;

    padding: 35px 55px 35px 38px;
}


/* Each column */

.services-column {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


/* =========================================================
   SERVICE ITEM
========================================================= */

.services-column a {
    height: 35px;

    display: flex;
    align-items: center;

    text-decoration: none;

    color: #17266b;

    position: relative;

    transition: transform 0.15s ease;
}


/* Number circle */

.service-number {
    width: 35px;
    height: 35px;

    min-width: 35px;

    border-radius: 50%;

    background: #171b64;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    font-size: 12px;
    font-weight: 400;

    position: relative;
    z-index: 2;
}


/* Gray pill */

.service-name {
    height: 35px;

    flex: 1;

    margin-left: -1px;

    padding: 0 20px;

    border-radius: 18px;

    background: #e7e8eb;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #17266b;

    font-size: 12px;
    font-weight: 400;

    line-height: 1.1;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


/* Hover */

.services-column a:hover {
    transform: translateX(3px);
}

.services-column a:hover .service-name {
    background: #dfe1e5;
    color: #111b75;
}


/* =========================================================
   SERVICES NAV LINK
========================================================= */

.services-link {
    cursor: pointer;
}


/* Keep menu open when moving from Services to dropdown */

.nav-item.has-mega-menu {
    height: 100%;
    display: flex;
    align-items: center;
}


/* =========================================================
   DESKTOP SIZING
========================================================= */

@media (max-width: 1100px) {

    .services-list {
        column-gap: 30px;
        padding: 30px 30px;
    }

    .service-name {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 11px;
    }

    .services-image {
        min-width: 260px;
        width: 26%;
    }

}


/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 850px) {

    .nav-item.has-mega-menu {
        display: block;
        height: auto;
    }

    .services-mega-menu {
        position: static;

        width: 100%;
        min-height: auto;

        display: none;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: none;

        border-radius: 0;

        box-shadow: none;

        overflow: visible;
    }

    .nav-item.has-mega-menu:hover .services-mega-menu {
        display: flex;
    }

    .services-image {
        display: none;
    }

    .services-list {
        width: 100%;

        display: flex;
        flex-direction: column;

        padding: 10px 0;

        gap: 8px;
    }

    .services-column {
        gap: 8px;
    }

    .service-name {
        justify-content: flex-start;
    }

}

/* =========================================================
   FIX SERVICES MEGA MENU HOVER
   ========================================================= */

.nav-item.has-mega-menu {
    position: static;
}

/* Mega Menu Position */
.services-mega-menu {
    top: 100%;
    z-index: 9998;
}

/* Keep menu visible while hovering over Services or dropdown */
.nav-item.has-mega-menu:hover .services-mega-menu,
.nav-item.has-mega-menu:focus-within .services-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}