/**
 * Global Comments System - Ultra Premium Design
 * Kontomistrz Theme
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --comment-bg: #FFFFFF;
    --comment-border: rgba(199, 210, 254, 0.5);
    --comment-shadow: 0 2px 12px rgba(6, 5, 31, 0.05);
    --comment-shadow-hover: 0 4px 20px rgba(73, 62, 251, 0.1);
    --comment-radius: 12px;
    --comment-padding: 20px;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    --accent-primary: #493EFB;
    --accent-secondary: #6366F1;
    --accent-orange: #FFA135;
    --accent-light: #EEF2FF;
    --accent-gradient: linear-gradient(135deg, #493EFB 0%, #7C3AED 100%);

    --avatar-bg: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
    --avatar-text: #493EFB;

    --thread-color: linear-gradient(180deg, #818CF8 0%, #A5B4FC 100%);
    --thread-width: 3px;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: 12px;
}

/* ============================================
   1. COMMENT FORM - Ultra Premium
   ============================================ */
.article-comment__form {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFF 100%);
    border: 2px solid var(--comment-border);
    border-radius: 20px;
    padding: 32px;
    margin-top: 48px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(73, 62, 251, 0.08);
}

/* Decorative gradient bar at top */
.article-comment__form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #493EFB, #FFA135, #7C3AED);
    background-size: 200% 100%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Form 2-column layout using rating-form-wrapper */
.article-comment__form .rating-form-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto auto;
    gap: 24px 32px;
}

.article-comment__form .rating-form-wrapper .block-01 {
    grid-column: 1;
    grid-row: 1;
}

.article-comment__form .rating-form-wrapper .block-02 {
    grid-column: 2;
    grid-row: 1 / 3;
}

.article-comment__form .rating-form-wrapper .block-03 {
    grid-column: 1 / -1;
    grid-row: 3;
}

/* Left column - form fields */
.article-comment__form .form-group {
    margin-bottom: 20px;
}

.article-comment__form .form-group:last-child {
    margin-bottom: 0;
}

/* Labels */
.article-comment__form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.article-comment__form label span {
    color: #EF4444;
}

/* Input fields */
.article-comment__form input[type="text"],
.article-comment__form input[type="email"],
.article-comment__form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    background: #FFFFFF;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-comment__form input[type="text"]:hover,
.article-comment__form input[type="email"]:hover,
.article-comment__form textarea:hover {
    border-color: #C7D2FE;
}

.article-comment__form input[type="text"]:focus,
.article-comment__form input[type="email"]:focus,
.article-comment__form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(73, 62, 251, 0.12), 0 0 20px rgba(73, 62, 251, 0.08);
    animation: inputGlow 1.5s ease-in-out infinite;
}

@keyframes inputGlow {
    0%, 100% { box-shadow: 0 0 0 4px rgba(73, 62, 251, 0.12), 0 0 15px rgba(73, 62, 251, 0.05); }
    50% { box-shadow: 0 0 0 4px rgba(73, 62, 251, 0.18), 0 0 25px rgba(73, 62, 251, 0.12); }
}

.article-comment__form input::placeholder,
.article-comment__form textarea::placeholder {
    color: var(--text-muted);
}

/* WYSIWYG Editor wrapper */
.article-comment__form #wp-comment-wrap {
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.article-comment__form #wp-comment-wrap:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(73, 62, 251, 0.12);
}

.article-comment__form .wp-editor-tabs {
    display: none !important;
}

.article-comment__form .mce-toolbar-grp {
    background: #F9FAFB !important;
    border-bottom: 1px solid #E5E7EB !important;
    padding: 8px !important;
}

.article-comment__form .mce-edit-area {
    border: none !important;
}

.article-comment__form .mce-edit-area iframe {
    min-height: 120px !important;
}

.article-comment__form .mce-statusbar {
    display: none !important;
}

/* Right column - Rating section */
.article-comment__form .comment-rating-fields {
    padding: 24px;
    background: linear-gradient(135deg, #F8FAFF 0%, #EEF2FF 100%);
    border-radius: 16px;
    border: 1px solid rgba(199, 210, 254, 0.4);
    height: fit-content;
}

.article-comment__form .comment-rating-fields h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-comment__form .comment-rating-fields h4::before {
    display: none;
}

/* Optional label under h4 */
.article-comment__form .comment-rating-fields .rating-optional {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-style: italic;
}

.article-comment__form .rating-criteria-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-comment__form .rating-criterion-form {
    background: #FFFFFF;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(199, 210, 254, 0.3);
    transition: all 0.2s ease;
}

.article-comment__form .rating-criterion-form:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(73, 62, 251, 0.08);
}

.article-comment__form .rating-criterion-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-comment__form .rating-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-comment__form .rating-stars {
    display: flex;
    gap: 4px;
    cursor: pointer;
}

.article-comment__form .rating-stars svg {
    width: 28px;
    height: 28px;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.article-comment__form .rating-stars svg:hover {
    transform: scale(1.2) rotate(-5deg);
}

.article-comment__form .rating-stars svg path {
    fill: #E5E7EB;
    transition: fill 0.15s ease;
}

.article-comment__form .rating-stars svg.active path {
    fill: var(--accent-orange);
}

.article-comment__form .rating-stars svg:hover path {
    fill: #FFB968;
}

.article-comment__form .rating-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-orange);
    min-width: 45px;
}

/* Footer - consent & submit */
.article-comment__form .form-group-wrapper {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(199, 210, 254, 0.4);
    margin-top: 8px;
}

.article-comment__form .form-consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
}

.article-comment__form .form-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.article-comment__form .form-consent label {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 400;
}

.article-comment__form .form-consent label a {
    color: var(--accent-primary);
    text-decoration: underline;
    font-weight: 500;
}

/* Submit button - Ultra Premium */
.article-comment__form .btn,
.article-comment__form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(73, 62, 251, 0.3);
    position: relative;
    overflow: hidden;
}

.article-comment__form .btn::before,
.article-comment__form button[type="submit"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.article-comment__form .btn:hover::before,
.article-comment__form button[type="submit"]:hover::before {
    left: 100%;
}

.article-comment__form .btn:hover,
.article-comment__form button[type="submit"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(73, 62, 251, 0.45);
    animation: buttonPulse 1s ease infinite;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(73, 62, 251, 0.4); }
    50% { box-shadow: 0 12px 32px rgba(73, 62, 251, 0.55); }
}

.article-comment__form .btn:active,
.article-comment__form button[type="submit"]:active {
    transform: translateY(0) scale(0.98);
    animation: none;
}

/* ============================================
   2. COMMENTS HEADER - Ultra Premium
   ============================================ */
.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
    border-radius: var(--comment-radius);
    margin-bottom: 24px;
    border: 1px solid var(--comment-border);
    box-shadow: var(--comment-shadow);
}

.comments-header__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.comments-header__icon {
    width: 40px;
    height: 40px;
    padding: 8px;
    background: var(--accent-gradient);
    border-radius: 10px;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(73, 62, 251, 0.25);
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.comments-header__count {
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(73, 62, 251, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.comments-header__sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--comment-bg);
    border: 2px solid var(--comment-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comments-header__sort:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-light);
}

.comments-header__sort span {
    font-weight: 700;
    color: var(--accent-primary);
}

/* ============================================
   3. COMMENTS LIST
   ============================================ */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.comments-header {
    margin: 0 auto 20px auto;
    max-width: 1000px;
}

/* Staggered fade-in animation for comments */
.comments-list .review-item {
    animation: fadeSlideIn 0.5s ease-out forwards;
    opacity: 0;
}

.comments-list .review-item:nth-child(1) { animation-delay: 0.05s; }
.comments-list .review-item:nth-child(2) { animation-delay: 0.1s; }
.comments-list .review-item:nth-child(3) { animation-delay: 0.15s; }
.comments-list .review-item:nth-child(4) { animation-delay: 0.2s; }
.comments-list .review-item:nth-child(5) { animation-delay: 0.25s; }
.comments-list .review-item:nth-child(n+6) { animation-delay: 0.3s; }

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   4. COMMENT CARD - Ultra Premium
   ============================================ */
.review-item,
.review-reply-item {
    background: var(--comment-bg);
    border: 1px solid var(--comment-border);
    border-radius: var(--comment-radius);
    padding: var(--comment-padding);
    box-shadow: var(--comment-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Decorative quote - via content wrapper */
.review-content::before {
    content: '"';
    position: absolute;
    bottom: -30px;
    right: 20px;
    font-size: 100px;
    font-family: Georgia, serif;
    color: rgba(199, 210, 254, 0.12);
    line-height: 1;
    pointer-events: none;
}

.review-item:hover,
.review-reply-item:hover {
    box-shadow: var(--comment-shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* Shimmer effect on card hover */
.review-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    z-index: 1;
    pointer-events: none;
}

.review-item:hover::before {
    left: 150%;
}

/* Left accent bar */
.review-item::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.review-item:hover::after {
    opacity: 1;
}

/* Decorative quote - move to separate element via box-shadow trick */

/* ============================================
   5. COMMENT WITH RATINGS - Layout
   ============================================ */
.review-item:not(.no-ratings) {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 8px 32px;
}

.review-item:not(.no-ratings) .review-header {
    grid-column: 1;
    grid-row: 1;
}

.review-item:not(.no-ratings) .review-content {
    grid-column: 1;
    grid-row: 2;
}

.review-item:not(.no-ratings) .review-ratings {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-left: 24px;
    border-left: 2px solid var(--comment-border);
    align-self: start;
}

.review-item:not(.no-ratings) .review-actions {
    grid-column: 1;
    grid-row: 3;
}

.review-item:not(.no-ratings) .review-replies {
    grid-column: 1 / -1;
    grid-row: 4;
}

/* ============================================
   6. AUTHOR SECTION
   ============================================ */
.review-header {
    margin-bottom: 16px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-avatar,
.reply-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--avatar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(73, 62, 251, 0.15);
    position: relative;
}

/* Avatar ring on hover - subtle */
.review-item:hover .author-avatar::after,
.review-reply-item:hover .reply-avatar::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    z-index: -1;
    animation: ringPulse 1.5s ease infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.avatar-letter {
    font-size: 18px;
    font-weight: 700;
    color: var(--avatar-text);
    line-height: 1;
    text-transform: uppercase;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.review-date {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.review-date::before {
    content: "";
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.5;
}

/* ============================================
   7. RATINGS IN COMMENT
   ============================================ */
.review-rating-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rating-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(255, 161, 53, 0.2));
}

.rating-stars svg.star path {
    fill: #E5E7EB;
}

.rating-stars svg.filled path {
    fill: var(--accent-orange);
}

/* Star glow effect */
.rating-stars svg.filled {
    filter: drop-shadow(0 0 6px rgba(255, 161, 53, 0.5));
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 161, 53, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 161, 53, 0.7)); }
}

.rating-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-orange);
}

/* ============================================
   8. CONTENT SECTION
   ============================================ */
.review-content {
    margin-top: 0;
}

.review-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.review-content p:last-of-type {
    margin-bottom: 0;
}

/* ============================================
   9. REPLY BUTTON - Ultra Premium
   ============================================ */
.reply-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent-light) 0%, #E0E7FF 100%);
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reply-button:hover {
    background: var(--accent-gradient);
    color: #FFFFFF;
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(73, 62, 251, 0.3);
}

.reply-button:hover svg path {
    fill: #FFFFFF;
}

.reply-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.reply-button:hover svg {
    transform: rotate(-10deg);
}

/* ============================================
   10. THREADED REPLIES - Ultra Premium
   ============================================ */
.review-replies {
    margin-top: 20px;
    margin-left: 28px;
    padding-left: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Gradient thread line with animated glow */
.review-replies::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--thread-width);
    background: var(--thread-color);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
    animation: threadPulse 3s ease-in-out infinite;
}

@keyframes threadPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(129, 140, 248, 0.2); }
    50% { box-shadow: 0 0 12px rgba(129, 140, 248, 0.5); }
}

/* Connector to card */
.review-reply-item::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 32px;
    width: 20px;
    height: 3px;
    background: #A5B4FC;
    border-radius: 2px;
}

/* Nested replies */
.review-replies .review-replies {
    margin-left: 0;
}

/* Reply cards */
.review-reply-item {
    padding: 20px 24px;
    position: relative;
}

.review-reply-item::after {
    display: none;
}

.review-reply-item .author-avatar,
.review-reply-item .reply-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
}

.review-reply-item .avatar-letter {
    font-size: 17px;
}

.review-reply-item .author-name {
    font-size: 15px;
}

.review-reply-item .review-date {
    font-size: 12px;
}

.review-reply-item .review-content p {
    font-size: 14px;
}

.review-actions {
    margin-top: 12px;
}

/* ============================================
   11. LOAD MORE BUTTON
   ============================================ */
.load-more-comments-wrapper {
    margin-top: 32px;
    text-align: center;
}

.load-more-comments {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--accent-light) 0%, #E0E7FF 100%);
    border: 2px solid var(--comment-border);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-comments:hover {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: #FFFFFF;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(73, 62, 251, 0.35);
}

/* Ripple effect on click */
.load-more-comments {
    position: relative;
    overflow: hidden;
}

.load-more-comments::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.load-more-comments:active::after {
    transform: scale(2.5);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* ============================================
   12. NO COMMENTS
   ============================================ */
.no-reviews {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
    font-size: 16px;
    background: linear-gradient(135deg, #FFFFFF 0%, var(--accent-light) 100%);
    border-radius: var(--comment-radius);
    border: 2px dashed var(--comment-border);
}

/* ============================================
   13. REPLY FORM CONTAINER
   ============================================ */
.review-reply-form-container {
    margin-top: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
    border-radius: 12px;
    border: 1px solid var(--comment-border);
}

/* ============================================
   14. RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .article-comment__form .rating-form-wrapper {
        grid-template-columns: 1fr;
    }

    .article-comment__form .rating-form-wrapper .block-01 {
        grid-column: 1;
        grid-row: 1;
    }

    .article-comment__form .rating-form-wrapper .block-02 {
        grid-column: 1;
        grid-row: 2;
    }

    .article-comment__form .rating-form-wrapper .block-03 {
        grid-column: 1;
        grid-row: 3;
    }

    /* Comment ratings below content on mobile */
    .review-item:not(.no-ratings) {
        grid-template-columns: 1fr;
    }

    .review-item:not(.no-ratings) .review-ratings {
        grid-column: 1;
        grid-row: 3;
        padding-left: 0;
        padding-top: 16px;
        margin-top: 8px;
        border-left: none;
        border-top: 1px solid var(--comment-border);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px 24px;
    }

    .review-item:not(.no-ratings) .review-actions {
        grid-row: 4;
    }

    .review-item:not(.no-ratings) .review-replies {
        grid-row: 5;
    }
}

@media (max-width: 640px) {
    :root {
        --comment-padding: 16px;
        --comment-radius: 10px;
    }

    .article-comment__form {
        padding: 20px;
    }

    .article-comment__form .form-group-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .article-comment__form .btn,
    .article-comment__form button[type="submit"] {
        width: 100%;
    }

    .comments-header {
        padding: 16px;
    }

    .comments-header__title {
        font-size: 17px;
    }

    .comments-header__sort {
        width: 100%;
        justify-content: center;
    }

    .review-replies {
        margin-left: 16px;
        padding-left: 16px;
    }

    .review-reply-item::before {
        left: -16px;
        width: 12px;
    }

    .author-avatar,
    .reply-avatar {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .avatar-letter {
        font-size: 18px;
    }

    .review-item::after {
        font-size: 80px;
        bottom: -10px;
        right: 10px;
    }
}
