:root {
    --text-main: #23254e;
    --text-body: #3f4064;
    --text-muted: #81858b;
    --text-subtle: #a1a3a8;
    --primary-red: #ef394e;
    --primary-red-hover: #d32f2f;
    --star-gold: #fbc02d;
    --buyer-bg: #e8f5e9;
    --buyer-color: #2e7d32;
    --border-color: #f0f0f1;
    --icon-color: #76777a;
    --ai-box-bg: #f4f8fe;
    --ai-box-border: #e2ecf9;
    --tag-border: #e0e0e2;
    --icon-pos-green: #10b981;
    --icon-neg-red: #ef394e;
}

*{
    font-family: var(--kaman-font-family, 'Dana2', sans-serif);
}

.woocommerce-reviews-wrapper {
    width: 100%;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* گرید اصلی */
.reviews-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
}

/* ستون راست (ثابت و استیکی) */
.reviews-sidebar-summary {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
}

.reviews-main-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 24px;
}

.overall-score-box {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.overall-score-number {
    font-size: 38px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
}

.overall-score-scale {
    font-size: 13px;
    color: var(--text-muted);
}

.overall-rating-stars {
    display: flex;
    flex-direction: row;
    direction: rtl;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
}

.overall-rating-stars svg {
    width: 18px;
    height: 18px;
}

.total-reviews-count {
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-bottom: 24px;
}

.add-review-prompt {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.6;
}

.btn-add-review {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-review:hover {
    background: #fff0f2;
}

/* ستون چپ */
.reviews-main-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* باکس هوش مصنوعی */
.ai-summary-card {
    background: var(--ai-box-bg);
    border: 1px solid var(--ai-box-border);
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 28px;
}

.ai-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ai-badge-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-icon-bubble {
    width: 28px;
    height: 28px;
    background: #1976d2;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.ai-badge-title h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.ai-badge-title span {
    display: block;
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: 2px;
}

/* متن هوش مصنوعی در حالت پیش‌فرض (محدود به ۲ خط همراه با ۳ نقطه) */
.ai-summary-text {
    font-size: 13px;
    line-height: 2.1;
    color: var(--text-body);
    text-align: justify;
    margin-bottom: 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* تعداد خطوط در حالت بسته */
    transition: all 0.3s ease;

}

/* حالت باز شده متن با کلاس داینامیک */
.ai-summary-card.is-expanded .ai-summary-text {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* استایل دکمه مشاهده بیشتر */
.ai-tags-top-bar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.btn-ai-view-more {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-body);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 5px;
    padding: 0;
    transition: color 0.2s ease;
}

.btn-ai-view-more:hover {
    color: var(--primary-red);
}

.ai-tags-top-bar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}



/* لیست تگ‌های هوش مصنوعی مطابق فیگما */
.ai-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 8px;
    margin-bottom: 16px;
}

.ai-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #ffffff;
    border: 1px solid var(--tag-border);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 12.5px;
    color: var(--text-body);
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.ai-tag:hover {
    border-color: #c5c7cb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ai-tag-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
}

.ai-tag-icon svg {
    width: 100%;
    height: 100%;
}

.ai-disclaimer {
    font-size: 11.5px;
    color: var(--text-subtle);
}

/* نوار مرتب‌سازی دیدگاه‌ها */
/* ظرف اصلی نوار مرتب‌سازی: چیدمان دوطرفه space-between */
.reviews-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

/* بخش سمت راست */
.sort-right-side {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* تیتر مرتب‌سازی همراه با آیکون قیف */
.sort-heading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.sort-filter-icon {
    stroke: #111827;
    flex-shrink: 0;
}

/* لیست تب‌های مرتب‌سازی */
.sort-nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 14px;
}

.sort-nav-item button {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 13px;
    font-weight: 500;
    color: #81858b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.sort-nav-item button:hover {
    color: #111827;
}

/* تب فعال (رنگ قرمز طبق طرح دیجی‌کالا) */
.sort-nav-item.active button {
    color: #ef4056; /* یا متغیر var(--primary-red) */
    font-weight: 700;
}

/* استایل شمارنده دیدگاه‌ها در سمت چپ */
.reviews-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #81858b;
    font-weight: 500;
    white-space: nowrap;
}

.reviews-count-badge .count-num {
    font-weight: 600;
    font-feature-settings: "ss01"; /* برای خوانایی اعداد فارسی در فونت‌های استاندارد */
}

.sort-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.sort-heading svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sort-nav-list {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sort-nav-item button {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.sort-nav-item button:hover {
    color: var(--primary-red);
}

.sort-nav-item.active button {
    color: var(--primary-red);
    font-weight: 700;
}

/* لیست کارت‌های دیدگاه همراه با اسکرول مستقل */
.commentlist {
    list-style: none;
    padding: 0 6px 0 0;
    margin: 0;
    max-height: 600px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.commentlist::-webkit-scrollbar {
    width: 5px;
}
.commentlist::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.commentlist::-webkit-scrollbar-thumb {
    background: #c5c7cb;
    border-radius: 4px;
}
.commentlist::-webkit-scrollbar-thumb:hover {
    background: #a1a3a8;
}

.comment-card {
    width: 100%;
    padding: 24px 10px;
    border-bottom: 1px solid var(--border-color);
}

.comment-card:last-child {
    border-bottom: none;
}

/* هدر دیدگاه */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-icon {
    width: 28px;
    height: 28px;
    color: #d1d2d7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.buyer-badge {
    background-color: var(--buyer-bg);
    color: var(--buyer-color);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.comment-date {
    font-size: 13px;
    color: var(--text-subtle);
    white-space: nowrap;
}

/* امتیاز ستاره‌ای */
.rating-stars {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 14px;
    direction: rtl;
    align-items: center;
}

.rating-stars svg {
    width: 16px;
    height: 16px;
}

.star-filled {
    fill: var(--star-gold);
}

.star-empty {
    fill: #e0e0e2;
}

/* متن دیدگاه و دکمه باز/بسته */
.comment-content {
    margin-bottom: 14px;
}

.comment-text {
    font-size: 13.5px;
    line-height: 2.1;
    color: var(--text-main);
    text-align: justify;
    word-spacing: -0.5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    padding: 5px;
}

.comment-content.is-expanded .comment-text {
    display: block;
    -webkit-line-clamp: unset;
    padding: 20px;
}

.btn-toggle-readmore {
    display: none;
    align-items: center;
    gap: 4px;
    color: var(--primary-red);
    font-size: 13px;
    font-weight: 700;
    background: none;
    border: none;
    margin-top: 6px;
    cursor: pointer;
    padding: 0;
}

.btn-toggle-readmore svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    transition: transform 0.3s ease;
    transform: rotate(0deg);

    display: inline-block;
}
.btn-toggle-readmore[aria-expanded="true"] svg,
.ai-summary-card.is-expanded .btn-toggle-readmore svg {
    transform: rotate(180deg);
}
.comment-content.is-expanded .btn-toggle-readmore svg {
    transform: rotate(180deg);
}

/* فوتر دیدگاه */
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.product-meta-attributes {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight:bold;
}

.meta-vendor {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-vendor svg {
    width: 16px;
    height: 16px;
    fill: var(--icon-color);
}

.color-swatch-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.meta-color {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* لایک و دیس‌لایک */
.feedback-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.feedback-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-subtle);
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.feedback-btn:hover {
    color: var(--text-main);
}

.feedback-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* دکمه بارگذاری نظرات بیشتر */
.load-more-container {
    padding-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-red);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
}

.btn-load-more[aria-disabled="true"] {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.btn-load-more svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}



/* وقتی دکمه باز است، فلش برعکس می‌شود */
.btn-toggle-readmore[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* ریسپانسیو */
@media (max-width: 820px) {
    .reviews-layout-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .reviews-sidebar-summary {
        position: static;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 24px;
    }
    .commentlist {
        max-height: none;
        overflow-y: visible;
    }
}


.comment-content .btn-toggle-readmore svg {
    transition: transform 0.25s ease;
    transform-origin: center;
    transform: rotate(0deg);
}

/* وضعیت باز: چرخش ۱۸۰ درجه فلش */
.comment-content.is-expanded .btn-toggle-readmore svg {
    transform: rotate(180deg);
}


/* Overlay */
.review-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    direction: rtl;
    padding: 16px;
    box-sizing: border-box;
}

.review-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.review-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(15px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.review-modal-overlay.is-active .review-modal-container {
    transform: translateY(0);
}

/* Header */
.review-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.review-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #2b2b2b;
    margin: 0;
}

.review-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #8c8c8c;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.review-modal-close:hover {
    color: #ef4056;
}

/* Body / Form */
.review-modal-form {
    padding: 18px 20px;
}

/* Product Info */
.review-product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.review-product-title {
    font-size: 13px;
    line-height: 1.6;
    color: #3f3f3f;
    font-weight: 500;
}

.review-product-thumb img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #f2f2f2;
}

.review-modal-divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 16px 0 14px 0;
}

/* بخش امتیازدهی - چیدمان تک ردیفه */
.review-rating-section {
    display: flex;
    align-items: center;
    justify-content: space-between; /* متن سمت راست، ستاره‌ها سمت چپ */
    gap: 12px;
    width: 100%;
    margin: 40px 0px;

}

.rating-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap; /* جلوگیری از شکستن متن در صورت کمبود فضا */
}

/* کانتینر ستاره‌ها */
.star-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 10px; /* فاصله مناسب و جمع‌وجور بین ستاره‌ها */
}

.star-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.star-icon {
    width: 20px;
    height: 20px;
    stroke: #d1d5db;
    stroke-width: 2;
    fill: #ffffff;
    transition: stroke 0.2s, fill 0.2s, transform 0.15s;
}

.star-item:hover .star-icon,
.star-item.active .star-icon {
    stroke: #f59e0b;
    fill: #f59e0b;
}

.star-item:hover {
    transform: scale(1.1);
}

.star-text {
    font-size: 10px;
    color: #71717a;
    user-select: none;
    line-height: 1;
}

/* Form Inputs */
.review-inputs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-field-label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.review-input,
.review-textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1f2937;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.review-input:focus,
.review-textarea:focus {
    border-color: #ef4056;
    box-shadow: 0 0 0 3px rgba(239, 64, 86, 0.12);
}

.review-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Custom Checkbox */
.custom-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: #4b5563;
}

.custom-checkbox-container input {
    accent-color: #ef4056;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Submit Button */
.review-modal-footer {
    margin-top: 18px;
}

.btn-submit-review {
    width: 100%;
    background-color: #990000; /* مطابق با رنگ تیره دکمه در تصویر */
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-submit-review:hover {
    background-color: #800000;
}

.btn-submit-review:active {
    transform: scale(0.99);
}



/* کارت محصول */
.review-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}
.review-product-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}
.review-product-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.5;
    margin-bottom: 6px;
}
.review-product-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #777;
}
.color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #000;
    border-radius: 50%;
    margin-left: 4px;
}

/* بخش امتیازدهی */
.review-rating-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.rating-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
}
.star-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}
.star-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    gap: 4px;
}
.star-icon {
    width: 22px;
    height: 22px;
    fill: #e0e0e0;
    stroke: #e0e0e0;
    transition: all 0.2s;
}
.star-text {
    font-size: 11px;
    color: #888;
}
.star-item.active .star-icon,
.star-item.hover .star-icon {
    fill: #f59e0b;
    stroke: #f59e0b;
}
.star-item.active .star-text {
    color: #f59e0b;
    font-weight: 700;
}

/* فیلدهای ورودی */
.review-field-group {
    position: relative;
    margin-bottom: 16px;
}
.review-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}
.review-input, .review-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background-color: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.review-input:focus, .review-textarea:focus {
    outline: none;
    border-color: #2563eb;
}
.char-counter {
    font-size: 11px;
    color: #94a3b8;
    text-align: left;
    margin-top: 4px;
}

/* باکس آپلود مطابق طرح */
.upload-dropzone.initial-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background-color: #f8f9fa;
    border: 1.5px dashed #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.upload-dropzone.initial-box:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}
.upload-icon-wrapper {
    margin-bottom: 6px;
}
.upload-custom-icon {
    width: 44px;
    height: 44px;
}
.upload-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2px;
}
.upload-subtitle {
    margin: 20px;
    font-size: 11.5px;
    color: #6b7280;
}
.upload-notice {
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 8px;
    margin-bottom: 16px;
}

/* گالری تصاویر آپلود شده */
.upload-gallery {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.gallery-items-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.gallery-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-item-remove {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.gallery-add-box {
    width: 64px;
    height: 64px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f8fafc;
    gap: 2px;
}
.gallery-add-box .add-text {
    font-size: 10.5px;
    color: #475569;
}

/* ارسال ناشناس */
.review-anonymous-wrapper {
    margin: 14px 0 20px;
}
.custom-checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
}

/* دکمه ثبت */
.btn-submit-review {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #ef4056; /* رنگ برند */
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
}
.btn-submit-review:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.checkbox-label-text{
    font-weight: 600;
}




/* استایل نمایش تصاویر در کارت نظر */
.comment-attachments-gallery {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.comment-attachment-thumbnail {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.comment-attachment-thumbnail:hover {
    transform: scale(1.05);
    border-color: #0086ff;
}

/* انیمیشن ظاهر شدن کارت جدید */
@keyframes newCommentHighlight {
    0% {
        opacity: 0;
        transform: translateY(-16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-card.just-added {
    animation: newCommentHighlight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* برای جهت فلش به سمت چپ */
.btn-load-more svg polyline {
    transform: rotate(180deg); /* چرخش ۱۸۰ درجه‌ای */
    transform-origin: center;   /* مرکز چرخش */
}


/* لایت‌باکس تصاویر دیدگاه‌ها */
#commentLightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgb(12 17 26 / 92%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    font-family: inherit;
    transition: opacity 180ms ease, visibility 180ms ease;
}

#commentLightbox,
#commentLightbox * {
    box-sizing: border-box;
}

#commentLightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* جهت شبکه صریح است تا جای فلش‌ها ثابت بماند. */
#commentLightbox .lightbox-content {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    grid-template-rows: 48px minmax(0, 1fr) 40px;
    align-items: center;
    justify-items: center;
    column-gap: 18px;
    row-gap: 14px;
    width: min(100%, 1000px);
    max-width: 100%;
    max-height: none;
    direction: ltr;
    transform: none;
}

#commentLightbox .lightbox-image {
    grid-column: 2;
    grid-row: 2;
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    margin: 0;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
    user-select: none;
}

/* کنترل‌ها داخل شبکه هستند؛ فاصله منفی ندارند. */
#commentLightbox .lightbox-btn {
    position: static;
    inset: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 22%);
    border-radius: 14px;
    background: rgb(255 255 255 / 10%);
    color: #fff;
    box-shadow: 0 4px 14px rgb(0 0 0 / 15%);
    cursor: pointer;
    transform: none;
    touch-action: manipulation;
    transition:
            background-color 160ms ease,
            border-color 160ms ease,
            box-shadow 160ms ease;
}

#commentLightbox .lightbox-btn svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

#commentLightbox .lightbox-btn:hover:not(:disabled) {
    background: rgb(255 255 255 / 20%);
    border-color: rgb(255 255 255 / 45%);
    box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
    transform: none;
}

#commentLightbox .lightbox-btn:active:not(:disabled) {
    background: rgb(255 255 255 / 28%);
    transform: none;
}

#commentLightbox .lightbox-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

#commentLightbox .lightbox-btn:disabled {
    opacity: .35;
    cursor: default;
}

/* بستن، بالا سمت چپ */
#commentLightbox .lightbox-close {
    grid-column: 1;
    grid-row: 1;
}

#commentLightbox .lightbox-close:hover {
    background: #b60000;
    border-color: #b60000;
}

/* در رابط فارسی: قبلی سمت راست، بعدی سمت چپ */
#commentLightbox .lightbox-prev {
    grid-column: 3;
    grid-row: 2;
}

#commentLightbox .lightbox-next {
    grid-column: 1;
    grid-row: 2;
}

#commentLightbox .lightbox-counter {
    grid-column: 2;
    grid-row: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 36px;
    margin: 0;
    padding: 6px 16px;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 999px;
    background: rgb(0 0 0 / 30%);
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
    direction: rtl;
}

#commentLightbox .lightbox-counter:empty {
    visibility: hidden;
}

/* موبایل: کنترل‌ها زیر تصویر */
@media (max-width: 600px) {
    #commentLightbox {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    #commentLightbox .lightbox-content {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        grid-template-rows: 48px minmax(0, 1fr) 48px;
        column-gap: 12px;
        row-gap: 16px;
    }

    #commentLightbox .lightbox-image {
        grid-column: 1 / -1;
        grid-row: 2;
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
        border-radius: 12px;
    }

    #commentLightbox .lightbox-next {
        grid-column: 1;
        grid-row: 3;
    }

    #commentLightbox .lightbox-prev {
        grid-column: 3;
        grid-row: 3;
    }

    #commentLightbox .lightbox-counter {
        grid-column: 2;
        grid-row: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    #commentLightbox,
    #commentLightbox .lightbox-btn {
        transition: none;
    }
}

/* تنظیم تراز و چیدمان دکمه ادامه/بستن */
.btn-toggle-readmore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* آیکون فلش */
.btn-toggle-readmore svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
    transform-origin: center;
}

/* ۱. حالت اولیه (متن "ادامه"): فلش اشاره به سمت چپ */
.btn-toggle-readmore svg {
    transform: rotate(0deg); /* یا در صورت نیاز بسته به آیکون پیش‌فرض rotate(180deg) */
}

/* ۲. حالت باز شده (متن "بستن"): فلش اشاره به سمت راست */
.btn-toggle-readmore.is-expanded svg,
.btn-toggle-readmore[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.comment-content.is-expanded .btn-toggle-readmore svg {
    transform: rotate(180deg);
}


/* ترتیب امتیاز: ۱ سمت راست، ۵ سمت چپ */
#productReviewForm .star-rating-wrapper {
    display: flex;
    flex-direction: row;
    direction: rtl;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#productReviewForm .star-rating-wrapper .star-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    order: 0;
    gap: 4px;
    cursor: pointer;
}

/* ستاره انتخاب‌نشده، حتی هنگام هاور، خاکستری بماند */
#productReviewForm .star-item:not(.active) .star-icon,
#productReviewForm .star-item:not(.active) .star-icon polygon {
    fill: #e5e7eb;
    stroke: #9ca3af;
}

#productReviewForm .star-item:not(.active) .star-text {
    color: #888;
    font-weight: 400;
}

/* فقط امتیاز انتخاب‌شده زرد شود */
#productReviewForm .star-item.active .star-icon,
#productReviewForm .star-item.active .star-icon polygon {
    fill: #f5a623;
    stroke: #f5a623;
}

#productReviewForm .star-item.active .star-text {
    color: #996000;
    font-weight: 700;
}


/* Dynamic AI review summary */

.ai-summary-card .ai-summary-text {
    text-align: start;
    overflow-wrap: anywhere;
}

.ai-summary-card .ai-tags-top-bar[hidden] {
    display: none !important;
}

.ai-summary-card .ai-tag-icon--positive {
    color: var(--icon-pos-green, #15803d);
}

.ai-summary-card .ai-tag-icon--negative {
    color: var(--icon-neg-red, #b91c1c);
}

.ai-summary-card .btn-ai-view-more {
    min-height: 44px;
    padding-inline: 6px;
}

.ai-summary-card .btn-ai-view-more:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.ai-summary-card .ai-tag {
    max-width: 100%;
}

.ai-summary-card .ai-tag > span[dir="auto"] {
    overflow-wrap: anywhere;
}
