/* ═══════════════════════════════════════════════════════════
   بخش نظرات محصول - Product Reviews Section
   ═══════════════════════════════════════════════════════════ */

.product-reviews-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    direction: rtl;
}

/* ─────────────────────────────────────────────────────────
   هدر بخش نظرات
   ───────────────────────────────────────────────────────── */

.reviews-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reviews-header-right {
    display: flex;
    gap: 20px;
}

.reviews-title {
    font-weight: 600;
    color: #0f4f59;
    margin: 0;
}

.reviews-summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-number {
    font-size: 18px;
    font-weight: 700;
    color: #0f4f59;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars .star {
    color: #d1d5db;
    transition: color 0.2s;
}

.rating-stars .star.filled {
    color: #fbbf24;
}

.reviews-count {
    color: #6b7280;
}

.submit-review-btn {
    padding: 10px 32px;
    background: #e8f5f3;
    color: #0f4f59;
    border: 1px solid #0f4f59;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.review-wrapper {
    margin-bottom: 14px;
}

.admin-review {
    border-color: rgba(15, 79, 89, 0.18);
}

/* ─────────────────────────────────────────────────────────
   هدر نظر
   ───────────────────────────────────────────────────────── */

.review-header .user-header-content {
    position: relative;
    top: 25px;
    right: 0;
    left: 0;
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 16px;
    width: 92%;
    margin: auto;
    z-index: 100;
}

.review-header .admin-header-content {
    position: relative;
    top: 0;
    right: 0;
    left: 0;
    background: #0f4f59;
    padding: 15px 20px;
    border-radius: 16px;
    width: 92%;
    margin: auto;
    z-index: 100;
}

.user-header-content,
.admin-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.user-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.admin-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .12);
}

.admin-brand {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.review-header .user-header-content .review-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 13px;
}

.review-header .admin-header-content .review-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255);
    font-size: 13px;
}

.review-header .user-header-content .review-date svg {
    width: 15px;
    height: 15px;
    opacity: .7;
    color: #666;
}

.review-header .admin-header-content .review-date svg {
    width: 15px;
    height: 15px;
    opacity: .7;
    color: rgba(255, 255, 255);
}

/* ─────────────────────────────────────────────────────────
   بدنه نظر
   ───────────────────────────────────────────────────────── */

.review-body {
    background: #fff;
    padding: 50px 30px 0px 30px;
    border: 1px solid #d9d9d9;
    border-radius: 35px;
    position: relative;
    margin-top: -20px;
    z-index: 1; /* fix: جلوگیری از غیرقابل کلیک شدن دکمه‌های پاسخ */
}

.review-rating {
    order: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 12px;
    width: fit-content;
}

.review-rating .star-icon-single {
    width: 22px;
    height: 22px;
    color: #f59e0b;
    filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3));
    flex-shrink: 0;
}

.review-rating .rating-value {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    line-height: 1;
    margin-top: 8px;
}

.review-rating .star {
    display: none;
}

.review-text {
    order: 2;
    font-size: 14px;
    line-height: 2;
    color: #374151;
}

.review-text p {
    margin: 0;
}

.pros-cons-display {
    display: flex;
    gap: 14px;
}

.pros-list,
.cons-list {
    padding: 18px;
    border-radius: 16px;
    position: relative;
}

.pros-list strong,
.cons-list strong {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
}

.pros-list strong {
    color: #047857;
}

.cons-list strong {
    color: #dc2626;
}

.pros-list strong::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #10b981;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.cons-list strong::before {
    content: "✕";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 900;
    flex-shrink: 0;
}

.pros-list ul,
.cons-list ul {
    margin: 0;
    padding-right: 20px;
    list-style: none;
}

.pros-list li,
.cons-list li {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.9;
    position: relative;
    padding-right: 18px;
}

.pros-list li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: #10b981;
    font-weight: 900;
    font-size: 16px;
}

.cons-list li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: #ef4444;
    font-weight: 900;
    font-size: 16px;
}

.pros-list li:last-child,
.cons-list li:last-child {
    margin-bottom: 0;
}

.review-footer {
    display: flex;
    flex-direction: row-reverse;
    align-items: end;
    margin-top: 0;
    justify-content: space-between;
    padding-top: 18px;
}

.reply-btn {
    background: transparent;
    color: #0f4f59;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

/* ─────────────────────────────────────────────────────────
   پاسخ‌ها
   ───────────────────────────────────────────────────────── */

.review-replies {
    margin-top: 18px;
    padding-right: 0;
}

.reply-item-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 14px;
}

.reply-item-wrapper > svg {
    flex-shrink: 0;
    margin-top: 18px;
    width: 32px;
    height: 32px;
}

.reply-item-wrapper .review-box {
    flex: 1;
}

/* ─────────────────────────────────────────────────────────
   مودال
   ───────────────────────────────────────────────────────── */

.review-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    text-align: center;
}

.review-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.review-modal-content {
    position: relative;
    width: 470px;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 40px auto;
    background: #fff;
    border-radius: 24px;
    padding: 15px 25px;
    z-index: 2;
    animation: modalFade .3s ease;
    text-align: right;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-modal-close {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    transition: all .25s ease;
}

.review-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.review-modal-header {
    padding-bottom: 13px;
    margin-bottom: 20px;
    border-bottom: 1px solid #d9d9d9;
}

.review-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #0f4f59;
}

/* ─────────────────────────────────────────────────────────
   کارت محصول مودال
   ───────────────────────────────────────────────────────── */

.modal-product-card {
    align-items: center;
    border-radius: 8px;
    box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.1);
    display: flex;
    margin-top: 5px;
    padding: 12px;
    background: #fff;
    color: #000;
    margin-bottom: 25px;
    gap: 10px;
}

.modal-product-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

.modal-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-product-title {
    margin: 0;
    font-size: 12px;
    line-height: 1.9;
    font-weight: 500;
    color: #111827;
}

/* ─────────────────────────────────────────────────────────
   فرم
   ───────────────────────────────────────────────────────── */

.review-form .form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.review-form input,
.review-form textarea {
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: all .25s ease;
    background: #fff;
}

.review-form textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.review-form input:focus,
.review-form textarea:focus {
    outline: none;
    border-color: #0f4f59;
    box-shadow: 0 0 0 4px rgba(15, 79, 89, .08);
}

/* ─────────────────────────────────────────────────────────
   امتیازدهی ستاره‌ای
   ───────────────────────────────────────────────────────── */

.rating-group > label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* wrapper برای ستاره‌ها + لیبل‌های زیر */
.star-rating-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 6px;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    color: #d1d5db;
    transition: all .2s;
    margin-bottom: 0;
    font-weight: normal;
}

.star-rating-input label svg {
    width: 36px; /* بزرگتر از قبل */
    height: 36px;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #fbbf24;
}

/* لیبل‌های زیر ستاره‌ها */
.star-labels {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 14px;
    font-size: 11px;
    color: #6b7280;
    width: 100%;
}

.star-labels span {
    width: 36px;
    text-align: center;
}

/* ─────────────────────────────────────────────────────────
   بخش پیشنهاد محصول
   ───────────────────────────────────────────────────────── */

.recommendation-section {
    margin: 4px 0 20px;
    text-align: right;
}

.recommendation-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px;
}

.recommendation-options {
    display: flex;
    flex-direction: row-reverse;
    gap: 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.recommendation-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    font-weight: normal;
    margin-bottom: 0;
}

.recommendation-options input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #0f4f59;
}

/* ─────────────────────────────────────────────────────────
   نقاط قوت / ضعف فرم
   ───────────────────────────────────────────────────────── */

.pros-cons-group > label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.pros-cons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.pros-cons-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pros-cons-item input {
    flex: 1;
}

.pros-cons-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    transition: all .25s ease;
}

.pros-cons-input:focus {
    outline: none;
    border-color: #0f4f59;
    box-shadow: 0 0 0 4px rgba(15, 79, 89, .08);
}

.remove-item-btn,
.remove-pros-cons-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-item-btn:hover,
.remove-pros-cons-btn:hover {
    background: #dc2626;
    color: #fff;
}

.add-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed #0f4f59;
    background: #f0f9f9;
    color: #0f4f59;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
}

.add-item-btn:hover {
    background: #0f4f59;
    color: #fff;
}

/* ─────────────────────────────────────────────────────────
   دکمه ثبت + چک‌باکس ناشناس
   ───────────────────────────────────────────────────────── */

.btn-submit {
    order: 2;
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0f4f59;
    color: #fff;
}


.anonymous-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.anonymous-checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #0f4f59;
}



















/* ─── Modal Header ─── */
.modal-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-bottom: 13px;
    margin-bottom: 16px;
    border-bottom: 1px solid #d9d9d9;
}

.modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #0f4f59;
    flex: 1;
    text-align: right;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: #374151;
    line-height: 1;
    padding: 0;
    transition: all .2s;
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ─── Product Info ─── */
.product-info {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    margin-bottom: 25px;
    direction: rtl;
}

.product-name {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    line-height: 1.8;
    flex: 1;
}

.product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.product-thumb--placeholder {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.emoji-rating {
  display: flex;
  gap: 40px;
  justify-content: center;
  align-items: flex-end;
  padding: 8px 0;
}

.emoji-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.emoji-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease;
  position: relative;
}

.emoji-wrap svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  transition: filter 0.25s ease;
}

/* hover */
.emoji-item:hover .emoji-wrap {
  transform: scale(1.25) translateY(-4px);
}
.emoji-item:hover .emoji-wrap svg {
  filter: drop-shadow(0 6px 12px rgba(255, 204, 77, 0.6));
}

/* label text */
.emoji-item span {
  font-size: 11px;
  font-weight: 600;
  color: #0e0202;
  transition: color 0.2s ease;
  letter-spacing: 0.3px;
}

/* selected state */
.emoji-item input:checked ~ .emoji-wrap {
  transform: scale(1.3) translateY(-6px);
  animation: bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.emoji-item input:checked ~ .emoji-wrap svg {
  filter: drop-shadow(0 8px 16px rgba(255, 204, 77, 0.7));
}
.emoji-item input:checked ~ span {
  color: #0f4f59;
  font-weight: 700;
}

/* color per rating */
.emoji-item[data-value="1"] input:checked ~ span { color: #e74c3c; }
.emoji-item[data-value="2"] input:checked ~ span { color: #e67e22; }
.emoji-item[data-value="3"] input:checked ~ span { color: #f39c12; }
.emoji-item[data-value="4"] input:checked ~ span { color: #27ae60; }
.emoji-item[data-value="5"] input:checked ~ span { color: #0f4f59; }

@keyframes bounce {
  0%   { transform: scale(1) translateY(0); }
  50%  { transform: scale(1.4) translateY(-10px); }
  100% { transform: scale(1.3) translateY(-6px); }
}

/* ─── Recommendation ─── */
.rec-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 10px;
}

.rec-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rec-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.rec-options input[type="radio"] {
    accent-color: #0f4f59;
}

/* ─── Actions ─── */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.submit-btn {
    order: 2;
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0f4f59;
    color: #fff;
}

.submit-btn:hover { background: #0a3840; }

.anonymous-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.anonymous-check input {
    accent-color: #0f4f59;
    width: 16px;
    height: 16px;
}

.required { color: #dc2626; }

.rating-hint {
    font-weight: 600;
    margin-top: 35px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}


/* جلوگیری از اسکرول خارج از مودال */
body.modal-open {
    overflow: hidden !important;
}

.review-modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* استایل اسکرول‌بار داخل modal-body */
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.modal-body::-webkit-scrollbar-track {
    background: #e2e2e2;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #0f4f59;
    border-radius: 10px;
}

.modal-body {
    padding: 5px 10px;
}

/* ─────────────────────────────────────────────────────────
   حالت بدون نظر
   ───────────────────────────────────────────────────────── */

.no-reviews {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 10px 30px;
}

.no-reviews p {
    font-size: 15px;
    color: #666;
    margin: 0;
}
