.module {
    border-bottom: 1px solid #E0E0E0;
    transition: background 0.3s ease;

    &:has(.module__head[open]) {
        background: #FAFAFA;

        .module__actions {
            display: flex;
            padding-top: 24px;
        }
    }

    &:hover {
        .module__actions {
            display: flex;
        }
    }

    .module-badge {
        padding: 8px 16px;
        font-size: 22px;
    }

    .module-progress+.module-progress {
        margin-top: 24px;
    }
}

.module--good .module-progress__bar {
    background: rgba(var(--green), 0.5);

    span {
        background: rgb(var(--green));
    }
}

.module--average .module-progress__bar {
    background: rgba(var(--orange), 0.5);

    span {
        background: rgb(var(--orange));
    }
}

.module--bad .module-progress__bar {
    background: rgba(var(--red), 0.5);

    span {
        background: rgb(var(--red));
    }
}

.module--paid {
    .module__summary {
        h3 {
            color: #BDBDBD;
        }
    }

    .module-badge {
        background: #BDBDBD;
    }

    .module__description {
        color: #BDBDBD;
    }

    .module__score,
    .module__details {
        display: none;
    }
}

.module__head {
    transition: background 0.3s ease;

    &[open] {
        summary::after {
            transform: rotate(180deg) translateY(50%);
        }
    }
}

.module__summary {
    cursor: pointer;
    padding: 24px;
    display: grid;
    grid-template-columns: 360px 1fr;
    align-items: center;
    justify-content: space-between;
    gap: 100px;
    font-family: var(--sfPro);
    line-height: 130%;
    position: relative;

    h3 {
        margin: 0;
        padding-right: 64px;
        font-weight: 600;
        font-size: 22px;
        color: var(--black);
    }

    &::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 24px;
        transform: translateY(-50%);
        display: inline-block;
        background: url('../images/icon-arrow-down.svg') no-repeat center center;
        background-color: #F2F2F2;
        background-size: 24px;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        transition: transform 0.3s ease;
    }
}

.module__stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}


.module__score {
    border-radius: 100px;
    padding: 7px 12px;
    background: rgb(var(--green));
    font-family: var(--futuraPT);
    font-weight: 400;
    font-size: 18px;
    color: #FFF;
}

.module__score--good {
    background: rgb(var(--green));
}

.module__score--average {
    background: rgb(var(--orange));
}

.module__score--bad {
    background: rgb(var(--red));
}

.module__content {
    padding: 0 24px;
    display: grid;
    grid-template-columns: 360px 1fr;
    justify-content: space-between;
    gap: 24px 100px;
    font-family: var(--sfPro);
    line-height: 130%;
}

.module__description {
    grid-column: 2/3;
    font-weight: 300;
    font-size: 19px;
    line-height: 140%;
    color: var(--black);

    ul {
        margin: 0;
        padding: 0;
        list-style: disc;

        li {
            margin-left: 16px;
            margin-top: 12px;

            &::marker {
                font-weight: 600;
            }
        }
    }

    p {
        margin: 0;
        font-weight: 600;
        line-height: 130%;
    }
}

.module__actions {
    margin-left: 484px;
    padding: 0 24px 24px 0;
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

@media screen and (width < 1630px) {

    .module__summary,
    .module__content {
        column-gap: 40px;
    }

    .module__actions {
        margin-left: 424px;
    }
}

@media screen and (width < 1330px) {

    .module__summary,
    .module__content {
        grid-template-columns: 260px 1fr;
    }

    .module__actions {
        margin-left: 324px;
    }
}

@media screen and (width < 1020px) {
    .module {

        &:has(.module__head[open]) {
            .module__actions {
                padding-top: 16px;
            }
        }

        .module-badge {
            position: absolute;
            top: 16px;
            left: 74px;
            padding: 0;
            background: transparent;
            border-radius: 0;
            font-weight: 400;
            font-size: 20px;
            color: var(--black);
        }
    }

    .module--paid {
        .module__summary {
            h3 {
                color: #828282;
            }
        }

        .module-badge {
            background: transparent;
            color: #828282;
        }

        .module__score {
            display: flex;
            background: #BDBDBD;
        }

        .module__content {
            color: #828282;
        }
    }

    .module__head {
        &[open] {
            summary::after {
                transform: rotate(180deg) translateY(0);
            }
        }
    }

    .module__summary {
        padding: 16px;
        grid-template-columns: 48px 1fr;
        align-items: flex-start;
        column-gap: 10px;

        h3 {
            padding-top: 22px;
            padding-right: 0;
        }

        &::after {
            top: 16px;
            right: 16px;
            transform: translateY(0);
            width: 24px;
            height: 24px;
            background-color: transparent;
        }
    }

    .module__score {
        font-size: 0;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;

        span {
            font-size: 18px;
        }
    }

    .module__content {
        grid-template-columns: 1fr;
        row-gap: 16px;
    }

    .module__details {
        display: none;
    }

    .module__description {
        grid-column: auto;
    }

    .module__actions {
        margin-left: 0;
        padding: 0 16px 16px 16px;
        grid-column: auto;
        justify-content: center;
    }
}

@media screen and (width < 825px) {
    .module {
        border-radius: 10px;
        border: 1px solid #C4D5DF;

        &:has(.module__head[open]) {
            background: #FFDF050D;

            .module__actions {
                padding-top: 10px;
            }

            .module__description {
                margin-top: 2px;
            }
        }

        .module-badge {
            top: 12px;
            left: 68px;
            font-weight: 500;
            font-size: 15px;
        }
    }

    .module+.module {
        margin-top: 12px;
    }

    .module__summary {
        padding: 10px;
        font-family: var(--futuraPT);
        line-height: 120%;

        h3 {
            font-size: 15px;
            font-weight: 400;
        }
    }

    .module__score {
        font-weight: 500;

        span {
            font-size: 15px;
        }
    }

    .module__content {
        padding: 0 10px 10px;
        font-family: var(--futuraPT);
        line-height: 120%;
    }

    .module__actions {
        padding: 0 10px 10px 10px;
    }

    .module__description {
        margin-left: 58px;
        font-weight: 400;
        font-size: 15px;
        line-height: 120%;

        ul {
            li {
                margin-top: 8px;
            }
        }

        p {
            font-weight: 500;
            line-height: 120%;
        }
    }
}

@media screen and (max-width: 575px) {
    .module {

        .module-continue,
        .module-unlock,
        .module-repeat {
            width: 100%;
        }
    }
}

/* Темы внутри модуля (choose_theme style) */
.module__themes {
    margin-top: 24px;

    > p {
        margin: 0 0 16px;
        font-weight: 600;
        font-size: 19px;
        line-height: 130%;
        color: var(--black);
    }

    .module-slim {
        /* Убираем бордер-радиус внутри модуля на десктопе для единообразия */
    }
}

@media screen and (width < 825px) {
    .module__themes {
        > p {
            font-size: 15px;
            font-weight: 500;
        }
    }
}