.sf-context-post-comments .sf-reviews-list,
.sf-context-post-comments .sf-replies-children {
  display: flex;
  flex-direction: column;
  gap: var(--sf-space-3, 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sf-context-post-comments .sf-replies-children {
  position: relative;
  padding-left: 1em;
}

.sf-context-post-comments .comment-meta .meta {
  color: var(--sf-color-text, #25242e) !important;
}

.sf-context-comments-footer {
  gap: var(--sf-space-2, 8px);
}

.sf-context-comments-footer__notice,
.sf-context-comments-footer .sf-post-comments-notice {
  margin: 0;
  color: var(--sf-color-text-secondary, #6f6d7d);
  font: 500 13px/1.4 var(--sf-font-body, "DM Sans", sans-serif);
}

.sf-context-comments-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sf-control-size, 44px);
    gap: var(--sf-space-2, 8px);
    align-items: end;

    textarea {
        box-sizing: border-box;
        width: 100%;
        min-height: var(--sf-control-size, 44px);
        max-height: 150px;
        height: auto;
        resize: none;
        field-sizing: content;
        padding: 11px 14px;
        border: 1px solid var(--sf-color-border, #e3e1ea);
        border-radius: 8px;
        background: var(--sf-color-surface, #fff);
        color: var(--sf-color-text, #25242e);
        font: 400 14px / 1.4 var(--sf-font-body);
        scrollbar-color: #ffffff transparent;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
    }

    .sf-context-comments__submit {
        appearance: none;
        position: relative;
        display: grid;
        place-items: center;
        width: var(--sf-control-size, 44px);
        height: var(--sf-control-size, 44px);
        border: 0px;
        border-radius: 50%;
        background: var(--sf-color-action-primary, #3f3c5a);
        color: var(--sf-color-on-action-primary, #fff);
        cursor: pointer;
        font-size: 19px;

        .sf-context-send__icon {
            mask-repeat: no-repeat;
            mask-position: center;
            mask-size: 32px;
            background-color: #f9f8fb;
            mask-image: var(--icon);
            --icon: url(https://starkframe.store/wp-content/themes/starkframe/assets/images/stark-frame/send-g.svg);
            box-sizing: border-box;
            height: 44px;
            width: 44px;
            position: absolute;
            top: 0;
            left: -1px;
        }
    }
}

.sf-context-comments__submit:disabled,
.sf-context-comments-composer textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.sf-context-comments-footer__signin {
  width: 100%;
}

.sf-context-panel__body--comments {
    --sf-context-review-doodle-size: 500px;
    --sf-context-review-doodle-opacity: 0.62;
    background: radial-gradient(circle at 8% 10%, rgb(156 126 255 / 26%), transparent 38%), radial-gradient(circle at 88% 30%, rgb(255 151 173 / 20%), transparent 20%), linear-gradient(150deg, #ffc1c7 14%, #ffd69b 70%);

    .sf-context-post-comments {
        box-sizing: border-box;
        padding: 0 0.75em;
        color: var(--sf-color-text, #25242e);
        background: transparent;

        .sf-context-post-comments__list {
            padding: 1em 0;

            .sf-reviews-list {
                list-style: none;
                display: flex;
                flex-direction: column;
                gap: var(--sf-space-4, 16px);
                padding: 0;
                margin: 0;

                .sf-review {
                    --sf-context-comment-avatar-size: 65px;
                    --sf-context-comment-bubble-gap: 20px;
                    --sf-context-comment-bubble: rgb(255 255 255 / 96%);
                    list-style-type: none;
                    display: flex;
                    flex-direction: column;
                    flex-wrap: nowrap;
                    gap: 1em;

                    .sf-review__content {
                        display: grid;
                        grid-template-columns: min-content minmax(0, 1fr);
                        column-gap: var(--sf-context-comment-bubble-gap);
                        align-items: start;
                        position: relative;
                        overflow: visible;
                        width: 100%;
                        padding: 0;
                        border: 0;
                        border-radius: 0;
                        background: transparent;
                        box-shadow: none;

                        .comment-header {
                            display: flex;
                            flex-direction: row;
                            flex-wrap: nowrap;
                            align-items: center;
                            width: 100%;
                            gap: 0.75em;

                            .sf-review__avatar img {
                                display: block;
                                box-sizing: border-box;
                                width: var(--sf-context-comment-avatar-size);
                                height: var(--sf-context-comment-avatar-size);
                                padding: 0;
                                border: 2px solid rgb(255 255 255 / 78%);
                                background-color: #ffffff62;
                                backdrop-filter: blur(1px);
                                border-radius: 50%;
                                object-fit: cover;
                            }
                        }

                        .sf-review__contain {
                            box-sizing: border-box;
                            display: flex;
                            flex-direction: column;
                            position: relative;
                            gap: 6px;
                            width: auto;
                            min-width: 0;
                            max-width: none;
                            margin: 0;
                            padding: 0.75em 1em 0.5em;
                            color: var(--sf-color-text, #25242e);
                            z-index: 0;
                            border: 1px solid rgb(63 60 90 / 10%);
                            border-radius: 12px;
                            background: var(--sf-context-comment-bubble);
                            box-shadow: -2px 3px 5px 1px #0000001c;

                            .sf-review__text, .sf-review__text p {
                                margin: 0;
                                color: inherit;
                                font: 400 14px / 1.45 var(--sf-font-body);

                                .sf-review__author {
                                    margin-right: 0.35em;
                                    font-family: 'Poppins';
                                    font-weight: 600;
                                }

                                .sf-review__reply-to {
                                    margin-right: 0.35em;
                                    color: #d26b34;
                                    font-family: 'Poppins';
                                    font-weight: 600;
                                }
                            }

                            .sf-comment-message-meta {
                                display: flex;
                                gap: 0.75em;
                                align-items: center;
                                justify-content: space-between;

                                .sf-comment-message-actions {
                                    display: inline-flex;
                                    gap: 2px;
                                    align-items: center;

                                    .sf-comment-action {
                                        appearance: none;
                                        display: inline-flex;
                                        gap: 3px;
                                        align-items: center;
                                        justify-content: center;
                                        box-sizing: border-box;
                                        width: 28px;
                                        min-width: 28px;
                                        height: 28px;
                                        padding: 0;
                                        border: 0;
                                        border-radius: 50%;
                                        background: transparent;
                                        color: #777386;
                                        cursor: pointer;
                                        transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;

                                        &:hover,
                                        &:focus-visible,
                                        &[aria-expanded="true"] {
                                            background: #fff0e4;
                                            color: #d86f37;
                                        }

                                        &:active {
                                            transform: scale(0.92);
                                        }

                                        &:disabled {
                                            cursor: default;
                                            opacity: 0.36;
                                        }

                                        .sf-comment-action__icon {
                                            display: block;
                                            width: 16px;
                                            height: 16px;
                                            background-color: currentColor;
                                            mask-repeat: no-repeat;
                                            mask-position: center;
                                            mask-size: contain;
                                            -webkit-mask-repeat: no-repeat;
                                            -webkit-mask-position: center;
                                            -webkit-mask-size: contain;
                                        }

                                        .sf-comment-action__count {
                                            font: 600 10px / 1 var(--sf-font-body);
                                        }

                                        &.sf-comment-action--like .sf-comment-action__icon {
                                            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.2-4.5-9.4-9C.7 7.2 3.3 3.5 7.2 3.5c2 0 3.7 1.1 4.8 2.7 1.1-1.6 2.8-2.7 4.8-2.7 3.9 0 6.5 3.7 4.6 8.5C19.2 16.5 12 21 12 21Z'/%3E%3C/svg%3E");
                                            -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.2-4.5-9.4-9C.7 7.2 3.3 3.5 7.2 3.5c2 0 3.7 1.1 4.8 2.7 1.1-1.6 2.8-2.7 4.8-2.7 3.9 0 6.5 3.7 4.6 8.5C19.2 16.5 12 21 12 21Z'/%3E%3C/svg%3E");
                                        }

                                        &.sf-comment-action--replies {
                                            width: auto;
                                            padding: 0 6px;
                                            border-radius: 999px;

                                            .sf-comment-action__icon {
                                                mask-image: url(../../../sf-core/shared/design/images/action-comments.svg);
                                                -webkit-mask-image: url(../../../sf-core/shared/design/images/action-comments.svg);
                                            }
                                        }

                                        &.sf-comment-action--reply .sf-comment-action__icon {
                                            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6V2L2 10l8 8v-4.1c5.7 0 9.5 1.8 12 5.6-.8-6.4-4.6-12.5-12-13.5Z'/%3E%3C/svg%3E");
                                            -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 6V2L2 10l8 8v-4.1c5.7 0 9.5 1.8 12 5.6-.8-6.4-4.6-12.5-12-13.5Z'/%3E%3C/svg%3E");
                                        }
                                    }
                                }
                            }

                            .sf-review__published-date {
                                color: var(--sf-color-text-tertiary, #9491a2);
                                font: 500 11px / 1.2 var(--sf-font-body);
                                white-space: nowrap;
                                display: flex;
                                flex-direction: row;
                                justify-content: flex-end;
                            }

                            &::after {
                                content: "";
                                position: absolute;
                                z-index: 0;
                                top: 14px;
                                left: 0;
                                width: 12px;
                                height: 16px;
                                background: var(--sf-context-comment-bubble);
                                clip-path: polygon(100% 0, 100% 100%, 0 0);
                                transform: translate(-10px, 14px);
                            }
                        }
                    }

                    .sf-replies-list-depth-1.sf-replies-children {
                        position: relative;
                        padding-left: 1em !important;
                        display: flex;
                        flex-direction: column;
                        flex-wrap: nowrap;
                        gap: 1em;
                    }

                    .sf-replies-children::before {
                        content: "";
                        width: 3px;
                        height: 100%;
                        background: #fff;
                        position: absolute;
                        border-radius: 8px;
                        left: 0;
                        top: 0;
                    }

                    &.is-focus-comment > .sf-review__content .sf-review__contain {
                        animation: sf-context-comment-focus 1.8s ease;
                    }
                }
            }
        }
    }

    &::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background-image: url(https://starkframe.store/wp-content/plugins/sf-core/shared/design/backgrounds/doodles-1-seamless.png);
        background-repeat: repeat;
        background-position: 18px 12px;
        background-size: contain;
        opacity: var(--sf-context-review-doodle-opacity);
    }
}

.sf-context-reply-target {
    display: flex;
    gap: var(--sf-space-2, 8px);
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-left: 3px solid #ff9a57;
    border-radius: 7px;
    background: #fff6ed;

    .sf-context-reply-target__content {
        display: flex;
        flex-direction: column;
        min-width: 0;

        strong {
            color: #3f3c5a;
            font: 600 12px / 1.35 var(--sf-font-ui, 'Poppins', sans-serif);
        }

        span {
            overflow: hidden;
            color: #777386;
            font: 400 12px / 1.35 var(--sf-font-body, 'DM Sans', sans-serif);
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }

    .sf-context-reply-target__cancel {
        appearance: none;
        position: relative;
        flex: 0 0 28px;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;

        &::before,
        &::after {
            content: "";
            position: absolute;
            top: 13px;
            left: 7px;
            width: 14px;
            height: 2px;
            border-radius: 2px;
            background: #777386;
        }

        &::before {
            transform: rotate(45deg);
        }

        &::after {
            transform: rotate(-45deg);
        }
    }
}

@keyframes sf-context-comment-focus {
    0%, 100% {
        box-shadow: -2px 3px 5px 1px #0000001c;
    }
    35% {
        box-shadow: 0 0 0 3px rgb(255 154 87 / 48%), -2px 3px 5px 1px #0000001c;
    }
}
