.why-business-choose-grid {
    padding: 100px 0;
    background: var(--text-icon-white, #fff);

    @media (max-width: 768px) {
        padding: 40px 0;
    }

    .heading-container {
        span {
            color: var(--Fills-Action, #0080ea);
        }
        .distinct--text {
            margin-bottom: 0 !important;

            @media (max-width: 540px) {
                text-align: left;
            }
        }
        margin-bottom: 48px;

        @media (max-width: 768px) {
            margin-bottom: 32px;
        }
    }
}

.why-business-choose-grid .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;

    @media (max-width: 992px) {
        padding: 0 48px;
    }
    @media (max-width: 640px) {
        padding: 0 20px;
    }
}

.why-business-choose-grid__header {
    text-align: center;
    margin-bottom: 80px;

    @media (max-width: 768px) {
        margin-bottom: 60px;
    }
}

.why-business-choose-grid__title {
    color: var(--text-icon-emphasize, #202223);
    font-family: 'Plus Jakarta Sans';
    font-size: 48px;
    font-style: normal;
    font-weight: 800;
    line-height: 56px;
    margin-bottom: 24px;

    @media (max-width: 768px) {
        font-size: 32px;
        line-height: 40px;
        margin-bottom: 16px;
    }

    & span {
        color: var(--Fills-Action, #0080ea);
    }
}

.why-business-choose-grid__subtitle {
    color: var(--text-icon-secondary, #636c7a);
    font-family: Inter;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    max-width: 800px;
    margin: 0 auto;

    @media (max-width: 768px) {
        font-size: 18px;
        line-height: 26px;
    }
}

/* Desktop Layout - 3 columns with specific arrangement */
.why-business-choose-grid__desktop-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.why-business-choose-grid__column--left {
    .why-business-choose-grid__item:nth-child(1) {
        position: relative;

        .why-business-choose-grid__item-image {
            margin-left: -10px;
            margin-right: -10px;
        }
        &::before {
            content: '';
            position: absolute;
            right: 0;
            bottom: 0px;
            width: 100%;
            height: 30px;
            z-index: 2;
            background: linear-gradient(
                180deg,
                rgba(198, 200, 215, 0) 0%,
                rgba(198, 200, 215, 0.24) 100%
            );
        }
        img {
            position: relative;
            bottom: -8px;
        }
    }
    .why-business-choose-grid__item:nth-child(2) {
        img {
            padding-bottom: 29px;
            @media (max-width: 992px) {
                padding-bottom: 7px;
            }
        }
    }
}

.why-business-choose-grid__column--right {
    .why-business-choose-grid__item:nth-child(1) {
        img {
            margin-bottom: -7px;
        }
    }
    .why-business-choose-grid__item:nth-child(2) {
        img {
            padding-bottom: 32px;
        }
    }
}

.why-business-choose-grid__column--center {
    .why-business-choose-grid__item-image {
        position: relative;
        &::before {
            content: '';
            position: absolute;
            right: 0;
            bottom: 0px;
            width: 100%;
            height: 30px;
            z-index: 2;
            background: linear-gradient(
                180deg,
                rgba(198, 200, 215, 0) 0%,
                rgba(198, 200, 215, 0.24) 100%
            );
        }
        img {
            margin-bottom: -6px;

            @media (max-width: 1024px) {
                margin-top: 40px;
            }
            @media (max-width: 992px) {
                margin-top: 47px;
            }
        }
    }
}

/* Mobile/Tablet Masonry Layout */
.why-business-choose-grid__masonry-layout {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    align-items: start;
}

.why-business-choose-grid__masonry-column {
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
}

/* Hide desktop layout and show masonry on smaller screens */
@media (max-width: 968px) {
    .why-business-choose-grid__desktop-layout {
        display: none;
    }

    .why-business-choose-grid__masonry-layout {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

#masonry-item-1 {
    position: relative;
    &::before {
        content: '';
        position: absolute;
        right: 0;
        bottom: 0px;
        width: 100%;
        height: 30px;
        z-index: 2;
        background: linear-gradient(
            180deg,
            rgba(198, 200, 215, 0) 0%,
            rgba(198, 200, 215, 0.24) 100%
        );
    }
    img {
        margin-bottom: -7px;
    }
}

#masonry-item-3 {
    position: relative;
    &::before {
        content: '';
        position: absolute;
        right: 0;
        bottom: 0px;
        width: 100%;
        height: 30px;
        z-index: 2;
        background: linear-gradient(
            180deg,
            rgba(198, 200, 215, 0) 0%,
            rgba(198, 200, 215, 0.24) 100%
        );
    }
    img {
        margin-bottom: -7px;
    }
}

/* Single column on mobile */
@media (max-width: 640px) {
    .why-business-choose-grid__masonry-layout {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .why-business-choose-grid__masonry-column {
        grid-template-columns: 1fr;
        display: contents;
    }

    /* Reorder items: 1, 3, 4, 2, 5 */
    #masonry-item-1 {
        order: 1;
    }
    #masonry-item-3 {
        order: 2;
    }
    #masonry-item-4 {
        order: 3;
    }
    #masonry-item-2 {
        order: 4;
    }
    #masonry-item-5 {
        order: 5;
    }
}

.why-business-choose-grid__column {
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: 100%;

    &--center {
        & .why-business-choose-grid__item {
            height: 100%;
        }
    }
}

.why-business-choose-grid__item {
    background: var(--surface-secondary, #f7f7fc);
    border-radius: 16px;
    padding: 32px 32px 0 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.why-business-choose-grid__item-image {
    text-align: center;

    img {
        width: 100%;
        height: auto;
    }
}

.why-business-choose-grid__item-content {
    flex: 1;
}

.why-business-choose-grid__item-title {
    color: var(--text-icon-emphasize, #202223);
    font-family: Inter;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; /* 133.333% */
    margin-bottom: 12px;

    @media (max-width: 768px) {
        font-size: 18px;
        line-height: 28px;
        margin-bottom: 12px;
    }
}

.why-business-choose-grid__item-text {
    color: var(--text-icon-moderate, #333241);
    font-family: Inter;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 22px; /* 157.143% */
}

#masonry-item-2 {
    img {
        margin-bottom: 20px;
    }
}

#masonry-item-4 {
    img {
        margin-bottom: -30px;
    }
}


#masonry-item-3 {
    @media (max-width: 768px) {
        .why-business-choose-grid__item-title {
            width: 90%;
        }

        img {
            margin-top: 23px;
        }
    }
}

#masonry-item-5 {
    img {
        padding-bottom: 50px;

        @media (max-width: 420px) {
            padding-bottom: 20px;
        }
    }
}