/* ========== CHANNEL SOFTECH — SERVICES MEGA MENU ========== */
.cs-mega {
    --mega-rail: 268px;
    --mega-pad: 14px;
    --mega-blue: #0870af;
    --mega-blue-dark: #065a8c;
    --mega-grey: #393939;
    --mega-light: #dff6fc;
    --mega-white: #fcfdfe;
}

.cs-mega__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cs-mega__tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.cs-mega__tab-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 16px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.cs-mega__tab-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- column ---------- */
.cs-mega__heading {
    position: relative;
    margin: 0 0 14px;
    padding-bottom: 11px;
    color: var(--mega-grey);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.cs-mega__heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--mega-blue), #4fb6e3);
}

.cs-mega__links {
    display: grid;
    gap: 2px;
}

.cs-mega__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--mega-grey);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.cs-mega__link-icon {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e9f8fd;
    color: var(--mega-blue);
    font-size: 14px;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.cs-mega__link:hover,
.cs-mega__link:focus-visible,
.cs-mega__link.is-current {
    background: var(--mega-light);
    color: var(--mega-blue);
}

.cs-mega__link:hover .cs-mega__link-icon,
.cs-mega__link:focus-visible .cs-mega__link-icon,
.cs-mega__link.is-current .cs-mega__link-icon {
    background: var(--mega-blue);
    color: #ffffff;
}

.cs-mega__link:focus-visible,
.cs-mega__tab:focus-visible,
.cs-mega__promo:focus-visible {
    outline: 2px solid var(--mega-blue);
    outline-offset: 2px;
}

/* ---------- promo card ---------- */
.cs-mega__promo {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    overflow: hidden;
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(
        155deg,
        var(--mega-blue) 0%,
        var(--mega-blue-dark) 55%,
        var(--mega-grey) 100%
    );
    color: #ffffff;
    text-decoration: none;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.cs-mega__promo::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(223 246 252 / 28%), transparent 70%);
    pointer-events: none;
}

.cs-mega__promo-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: auto;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 11px;
    background: rgb(255 255 255 / 12%);
    font-size: 19px;
}

.cs-mega__promo small {
    margin-top: 26px;
    color: rgb(223 246 252 / 85%);
    font-size: 12.5px;
}

.cs-mega__promo strong {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.cs-mega__promo-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: var(--mega-light);
    font-size: 13px;
    font-weight: 600;
}

.cs-mega__promo-link i {
    transition: transform 0.25s ease;
}

.cs-mega__promo:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgb(8 112 175 / 25%);
}

.cs-mega__promo:hover .cs-mega__promo-link i {
    transform: translateX(3px);
}

/* ========== DESKTOP — tabs left, panel right ========== */
@media (min-width: 1200px) {
    .cs-nav-services-mega {
        width: min(1100px, calc(100vw - 40px));
    }

    .cs-mega {
        position: relative;
        min-height: 352px;
        padding: var(--mega-pad);
        background: linear-gradient(
            120deg,
            var(--mega-white) 0%,
            var(--mega-white) 35%,
            #eef9fd 100%
        );
    }

    /* dark rail behind the tabs */
    .cs-mega::before {
        content: "";
        position: absolute;
        top: var(--mega-pad);
        bottom: var(--mega-pad);
        left: var(--mega-pad);
        width: var(--mega-rail);
        border-radius: 14px;
        background: linear-gradient(165deg, #3f4143 0%, var(--mega-grey) 45%, #262626 100%);
        box-shadow: 0 14px 30px rgb(38 38 38 / 18%);
    }

    .cs-mega__item {
        width: var(--mega-rail);
    }

    .cs-mega__tab {
        position: relative;
        min-height: 64px;
        padding: 14px 18px;
        border-bottom: 1px solid rgb(255 255 255 / 7%);
        color: #f3f6f7;
        font-size: 15px;
        font-weight: 600;
        transition:
            background-color 0.2s ease,
            color 0.2s ease;
    }

    .cs-mega__item:first-child .cs-mega__tab {
        border-radius: 14px 14px 0 0;
    }

    .cs-mega__item:last-child .cs-mega__tab {
        border-bottom: 0;
        border-radius: 0 0 14px 14px;
    }

    .cs-mega__tab-icon {
        background: rgb(255 255 255 / 8%);
        color: #7fd0f0;
    }

    .cs-mega__tab-arrow {
        display: none;
    }

    .cs-mega__item:not(.is-active) .cs-mega__tab:hover {
        background: rgb(255 255 255 / 6%);
    }

    /* active tab + pointer */
    .cs-mega__item.is-active .cs-mega__tab {
        background: linear-gradient(90deg, var(--mega-blue), var(--mega-blue-dark));
        color: #ffffff;
    }

    .cs-mega__item.is-active .cs-mega__tab::after {
        content: "";
        position: absolute;
        top: 50%;
        right: -9px;
        border-top: 9px solid transparent;
        border-bottom: 9px solid transparent;
        border-left: 9px solid var(--mega-blue-dark);
        transform: translateY(-50%);
    }

    .cs-mega__item.is-active .cs-mega__tab-icon {
        background: rgb(255 255 255 / 16%);
        color: #ffffff;
    }

    /* panel */
    .cs-mega__panel {
        position: absolute;
        top: var(--mega-pad);
        right: var(--mega-pad);
        bottom: var(--mega-pad);
        left: calc(var(--mega-pad) + var(--mega-rail) + 22px);
        display: none;
        align-items: stretch;
        gap: 26px;
        padding: 12px 6px 6px 14px;
        animation: csMegaIn 0.22s ease;
    }

    .cs-mega__item.is-active .cs-mega__panel {
        display: flex;
    }

    .cs-mega__col {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        max-width: 300px;
        padding-right: 26px;
    }

    /* vertical accent rail, like a scroll track */
    .cs-mega__col::after {
        content: "";
        position: absolute;
        top: 48px;
        right: 0;
        bottom: 8px;
        width: 4px;
        border-radius: 4px;
        background: linear-gradient(180deg, var(--mega-blue) 0 42%, var(--mega-light) 42% 100%);
    }

    .cs-mega__promo {
        flex: 0 0 214px;
        margin-left: auto;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .cs-mega {
        --mega-rail: 240px;
    }

    .cs-mega__panel {
        gap: 20px;
    }

    .cs-mega__col {
        padding-right: 20px;
    }

    .cs-mega__promo {
        flex-basis: 190px;
    }
}

@keyframes csMegaIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ========== TABLET / MOBILE — accordion in the off-canvas menu ========== */
@media (max-width: 1199.98px) {
    .cs-mega {
        display: grid;
        gap: 8px;
        padding: 10px 0 8px;
    }

    .cs-mega__item {
        overflow: hidden;
        border: 1px solid #e3eef2;
        border-radius: 12px;
        background: #ffffff;
    }

    .cs-mega__tab {
        min-height: 58px;
        padding: 10px 12px;
        color: var(--mega-grey);
        font-size: 15px;
        font-weight: 600;
    }

    .cs-mega__tab-icon {
        background: var(--mega-light);
        color: var(--mega-blue);
    }

    .cs-mega__tab-arrow {
        margin-left: auto;
        color: #7c8285;
        font-size: 13px;
        transition: transform 0.25s ease;
    }

    .cs-mega__item.is-open {
        border-color: #bfe3f2;
    }

    .cs-mega__item.is-open .cs-mega__tab {
        background: linear-gradient(90deg, var(--mega-blue), var(--mega-blue-dark));
        color: #ffffff;
    }

    .cs-mega__item.is-open .cs-mega__tab-icon {
        background: rgb(255 255 255 / 16%);
        color: #ffffff;
    }

    .cs-mega__item.is-open .cs-mega__tab-arrow {
        color: #ffffff;
        transform: rotate(180deg);
    }

    .cs-mega__panel {
        display: none;
        padding: 6px 12px 12px;
        background: linear-gradient(180deg, var(--mega-white), #f1fbfe);
    }

    .cs-mega__item.is-open .cs-mega__panel {
        display: block;
    }

    .cs-mega__heading {
        margin: 12px 0 8px;
        padding-bottom: 8px;
        font-size: 13px;
    }

    .cs-mega__heading::after {
        width: 40px;
        height: 2px;
    }

    .cs-mega__link {
        padding: 7px 6px;
        font-size: 14px;
    }

    /* the off-canvas already has its own contact block */
    .cs-mega__promo {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs-mega__panel {
        animation: none;
    }

    .cs-mega__promo,
    .cs-mega__promo-link i,
    .cs-mega__tab-arrow {
        transition: none;
    }
}
