.store-comments {
    --thread-avatar: 40px;
    --thread-indent: 38px;
    --thread-gap: 12px;
    --thread-line: var(--border, rgba(148, 163, 184, .24));
}

.store-comments .store-comments-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    min-width: 0;
}

.store-comments .store-comment-thread {
    min-width: 0;
    /*border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 18px;*/
}

.store-comments .store-comment {
    position: relative;
    display: grid;
    grid-template-columns: var(--thread-avatar) minmax(0, 1fr);
    align-items: start;
    gap: var(--thread-gap);
    padding: 0;
    border: 0;
    min-width: 0;
    scroll-margin-top: calc(var(--header-h, 72px) + 18px);
}

.store-comments .store-comment-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--thread-avatar);
    height: var(--thread-avatar);
    overflow: hidden;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    background: #385275;
}

.store-comments .store-comment-avatar--1 { background: #806229; }
.store-comments .store-comment-avatar--2 { background: #287b73; }
.store-comments .store-comment-avatar--3 { background: #77518d; }
.store-comments .store-comment-avatar--4 { background: #925346; }
.store-comments .store-comment-avatar--5 { background: #3b7195; }

.store-comments .store-comment-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    background: inherit;
}

.store-comments .comment-content {
    min-width: 0;
}

.store-comments .comment-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 9px;
    margin: 1px 0 6px;
    line-height: 1.4;
}

.store-comments .comment-header strong {
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.store-comments .comment-date,
.store-comments .store-comment-parent {
    color: var(--muted2);
    font-size: 12px;
    font-weight: 400;
}

.store-comments .store-comment-parent {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: 100%;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.store-comments .comment-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: normal;
}

.store-comments .comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 9px;
    margin-top: 9px;
}

.store-comments .comment-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 8px;
    min-height: 29px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted2);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.store-comments .comment-actions button:hover,
.store-comments .comment-actions button:focus-visible {
    color: var(--text);
    background: rgba(148, 163, 184, .12);
}

.store-comments .comment-actions .comment-delete:hover { color: #f87171; }
.store-comments .comment-actions svg { width: 16px; height: 16px; flex-shrink: 0; }
.store-comments .store-comment-parent svg { width: 13px; height: 13px; flex-shrink: 0; }
.store-comments .store-comment-parent:hover { color: var(--primary); }

.store-comments .store-comment-replies {
    position: relative;
    display: grid;
    gap: 0;
    margin: 0 0 0 calc(var(--thread-avatar) / 2);
    padding: 0 0 0 var(--thread-indent);
    min-width: 0;
}

.store-comments .store-comment-replies .store-comment {
    padding-top: 20px;
}

.store-comments .store-comment-replies .store-comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: calc(-1 * var(--thread-indent));
    bottom: 0;
    width: 1px;
    background: var(--thread-line);
    pointer-events: none;
}

.store-comments .store-comment-replies .store-comment:last-child::before {
    display: none;
}

.store-comments .store-comment-replies .store-comment::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(-1 * var(--thread-indent));
    width: var(--thread-indent);
    height: calc(20px + var(--thread-avatar) / 2);
    border-left: 1px solid var(--thread-line);
    border-bottom: 1px solid var(--thread-line);
    border-bottom-left-radius: 14px;
    box-sizing: border-box;
    pointer-events: none;
}

.store-comments .store-comment-thread:has(.store-comment-replies) > .store-comment::after {
    content: '';
    position: absolute;
    left: calc(var(--thread-avatar) / 2);
    top: var(--thread-avatar);
    bottom: 0;
    width: 1px;
    background: var(--thread-line);
    pointer-events: none;
}

.store-comments .store-comment:target .comment-content {
    border-radius: 6px;
    animation: store-comment-target 2.2s ease-out;
}

@keyframes store-comment-target {
    from { background-color: rgba(88, 166, 255, .18); }
    to { background-color: transparent; }
}

@media (max-width: 680px) {
    .store-comments { --thread-avatar: 32px; --thread-indent: 17px; --thread-gap: 9px; }
    .store-comments .store-comment-thread { padding: 12px; }
    .store-comments .store-comment-replies .store-comment { padding-top: 17px; }
    .store-comments .store-comment-replies .store-comment::after { height: calc(17px + var(--thread-avatar) / 2); border-bottom-left-radius: 9px; }
    .store-comments .comment-actions button { min-height: 36px; padding-inline: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .store-comments .store-comment:target .comment-content { animation: none; outline: 1px solid var(--primary); }
}
