﻿#fix2.boxProduct {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.title-sepcs h2 {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

    .title-sepcs h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40px;
        height: 3px;
        background-color: #007bff;
        border-radius: 2px;
    }

.top-box-comments {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px dashed #dee2e6;
}

    .top-box-comments h3 {
        font-size: 15px;
        color: #495057;
        margin: 0;
        font-weight: 500;
    }

.title-new-comment {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f3f5;
    margin-bottom: 20px;
}

    .title-new-comment .float-left,
    .title-new-comment .float-right {
        float: none !important;
    }

.left-title-comment h3 {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.comment-filter.sort-newest {
    display: inline-block;
    background: #007bff !important;
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,123,255,0.15);
}

    .comment-filter.sort-newest:hover {
        background: #0056b3 !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,123,255,0.25);
    }

/* CHỈNH SỬA TẠI ĐÂY: KHU VỰC THÊM SCROLL KHI QUÁ DÀI */
#rate-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px; /* Chiều cao tối đa trước khi xuất hiện scroll, bạn có thể chỉnh lại tùy ý */
    overflow-y: auto; /* Tự động hiện thanh cuộn dọc khi dài vượt mức */
    padding-right: 6px; /* Tạo khoảng trống nhỏ để thanh cuộn không đè vào nội dung */
}

    /* Tùy biến thanh cuộn mượt và thanh lịch hơn (Chạy trên Chrome, Safari, Edge) */
    #rate-reviews-list::-webkit-scrollbar {
        width: 6px;
    }

    #rate-reviews-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    #rate-reviews-list::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

        #rate-reviews-list::-webkit-scrollbar-thumb:hover {
            background: #999;
        }

.view-comments-item {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin: 0 !important;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 8px;
}

.img-thumb {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .img-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.img-member-thumb {
    background: #e7f5ff;
    color: #007bff;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    border: 1px solid #d0ebff;
    margin-bottom: 0 !important;
}

.name-member.user-normal {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #212529;
    font-size: 15px;
    padding: 0;
    margin: 0;
}

.content-comments, .relate-comment {
    grid-column: 1 / span 2;
}

.content-comments {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin: 4px 0 !important;
    white-space: pre-line;
}

.view-comments-item .relate-comment:has(.fa-star, [class*="star"]) {
    color: #ffc107;
    font-size: 13px;
}

.view-comments-item .relate-comment:last-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px !important;
    font-size: 13px;
    border-top: 1px dashed #f1f3f5;
    padding-top: 10px;
}

.relate-com-item.rep-comment, .relate-com-item.like-comment a.review-like {
    color: #007bff !important;
    text-decoration: none !important;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.15s ease;
}

    .relate-com-item.rep-comment:hover,
    .relate-com-item.like-comment a.review-like:hover {
        color: #0056b3 !important;
        text-decoration: underline !important;
    }

.relate-com-item.like-comment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6c757d;
}

    .relate-com-item.like-comment i {
        font-size: 14px;
    }

    .relate-com-item.like-comment span[id^="like_cmt_"] {
        background: #f1f3f5;
        padding: 2px 6px;
        border-radius: 10px;
        font-size: 11px;
        font-weight: 600;
        color: #495057;
    }

.time-comment {
    margin-left: auto;
    color: #868e96;
    font-size: 12px;
}

.view-comments-item.level-2 {
    margin-left: 40px !important;
    background: #f8f9fa;
    border-left: 3px solid #dee2e6;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

    .view-comments-item.level-2 .img-member-thumb {
        background: #e9ecef;
        color: #495057;
        border-color: #ced4da;
    }

    .view-comments-item.level-2::before {
        content: "↳";
        position: absolute;
        left: -24px;
        top: 24px;
        color: #adb5bd;
        font-size: 18px;
    }

    .view-comments-item.level-2 .time-comment {
        margin-left: auto;
    }

@media (max-width: 576px) {
    #fix2.boxProduct {
        padding: 12px !important;
    }

    .view-comments-item {
        padding: 12px !important;
        column-gap: 8px !important;
    }

        .view-comments-item.level-2 {
            margin-left: 16px !important;
            padding-left: 12px !important;
        }

            .view-comments-item.level-2::before {
                display: none !important;
            }

        .view-comments-item .relate-comment:last-child {
            justify-content: flex-start !important;
            gap: 12px !important;
        }

    .time-comment {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 4px !important;
    }

    .title-new-comment {
        gap: 8px !important;
        padding-bottom: 12px !important;
        margin-bottom: 12px !important;
    }

    .comment-filter.sort-newest {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }

    /* Trên mobile có thể thu hẹp chiều cao khung cuộn lại một chút nếu muốn */
    #rate-reviews-list {
        max-height: 400px;
    }
}
