@use '~@epam/promo/assets/styles/colors' as *;
@use '~@epam/promo/assets/styles/fonts' as *;

@mixin control-focus($width: 2px, $offset: 2px) {
    outline: $blue auto $width;
    outline-offset: $offset;
}

.layout {
    margin: 0 auto;
    background-color: #F5F6FA;

    .benefits {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        max-width: 1200px;
        width: 100%;
        margin: 0 auto;
        padding: 60px 0;

        .wrapper {
            width: inherit;

            .header {
                font-size: 30px;
                line-height: 36px;
                padding: 0;
                margin-bottom: 24px;
            }

            .content {
                display: flex;
                justify-content: space-between;

                .actions-wrapper {
                    display: flex;
                    flex-direction: column;

                    .actions-container {
                        display: flex;
                        flex-direction: column;
                    }

                    .reason {
                        display: flex;
                        height: 60px;
                        width: 408px;
                        list-style-type: none;
                        padding-left: 12px;
                        border-left: 6px solid transparent;
                        box-sizing: border-box;
                        cursor: pointer;

                        &:focus-visible {
                            @include control-focus();
                        }

                        &-active {
                            border-left: 6px solid $blue;
                            background-color: white;
                        }

                        & div {
                            align-self: center;
                        }
                    }
                }

                .pointWrapper {
                    list-style-type: none;
                }

                .point {
                    position: relative;
                    margin-left: 80px;
                    margin-bottom: 24px;
                    padding-left: 20px;
                    line-height: 36px;
                    padding-top: 0;
                    padding-bottom: 0;

                    &::before {
                        position: absolute;
                        content: '';
                        width: 9px;
                        height: 9px;
                        border-radius: 50%;
                        top: 14px;
                        left: 0;
                        background-color: $blue;
                    }

                    &:last-child {
                        margin-bottom: 0;
                    }
                }
            }
        }
    }

    @media (max-width: 1280px) {
        .benefits {
            max-width: 732px;
            padding: 48px 0;

            .wrapper {
                .header {
                    margin-bottom: 18px;
                }

                .content {
                    flex-direction: column;

                    .actions-wrapper {
                        margin-bottom: 24px;

                        .actions-container {
                            display: flex;
                            flex-direction: row;
                            border-bottom: 1px solid #CED0DB;
                            justify-content: space-between;
                        }

                        .reason {
                            height: 48px;
                            width: auto;
                            padding-right: 12px;
                            border-left: 0;
                            border-bottom: 3px solid transparent;
                            margin-bottom: -1px;

                            .reason-caption {
                                font-size: 14px;
                                line-height: 24px;
                                font-family: $font-sans-semibold;
                                color: $gray80;
                            }

                            &-active {
                                border-left: 0;
                                border-bottom: 3px solid $blue;
                                background-color: transparent;

                                .reason-caption {
                                    color: $blue;
                                }
                            }
                        }
                    }

                    .point {
                        margin-left: 0;
                        margin-bottom: 18px;
                        line-height: 30px;
                        font-size: 22px;

                        &::before {
                            top: 10px;
                        }
                    }
                }
            }
        }
    }

    @media (max-width: 768px) {
        .benefits {
            max-width: none;
            padding: 30px 0;
            margin: 0 12px;
            width: inherit;

            .wrapper {
                width: 100%;

                .header {
                    font-size: 24px;
                    line-height: 30px;
                    margin-bottom: 12px;
                }

                .content {
                    flex-direction: column;

                    .actions-wrapper {
                        margin-bottom: 12px;
                        overflow: auto;

                        .actions-container {
                            min-width: 664px;
                            display: flex;
                            flex-direction: row;
                            border-bottom: 1px solid #CED0DB;
                            justify-content: space-between;
                        }

                        .reason {
                            height: 48px;
                            width: auto;
                            padding-right: 12px;
                            border-left: 0;
                            border-bottom: 3px solid transparent;
                            margin-bottom: -1px;

                            .reason-caption {
                                font-size: 14px;
                                line-height: 24px;
                                font-family: $font-sans-semibold;
                                color: $gray80;
                            }

                            &-active {
                                border-left: 0;
                                border-bottom: 3px solid $blue;
                                background-color: transparent;

                                .reason-caption {
                                    color: $blue;
                                }
                            }
                        }
                    }

                    .point {
                        margin-left: 0;
                        margin-bottom: 12px;
                        padding-left: 12px;
                        line-height: 24px;
                        font-size: 16px;

                        &::before {
                            width: 6px;
                            height: 6px;
                            top: 10px;
                        }
                    }
                }
            }
        }
    }
}
