

.product__reviews--header {
  position: relative;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.product__reviews--header__title {
  width: 100%;
  margin-bottom: 0;
}

.actions__newreviews--btn {
  margin-right: auto;  
}

@media only screen and (max-width: 575px) {
  .actions__newreviews--btn {
    margin-right: 0;
    margin-top: 1rem;
  }
}


@media only screen and (min-width: 768px) {
  .product__reviews--header {
    padding-bottom: 2.5rem;
    margin-bottom: 3.5rem;
  }
}

@media only screen and (max-width: 575px) {
  .product__reviews--header {
    text-align: center;
  }
}

@media only screen and (max-width: 575px) {
  .reviews__ratting {
    justify-content: center;
  }
}

.reviews__summary--caption {
  color: var(--secondary-color);
  margin-inline-start: 1.2rem;
}


.reviews__comment--area {
  padding: 0 2rem;
  margin-bottom: 3rem;
  overflow-x: hidden; /* جلوگیری از اسکرول افقی ناخواسته */
}

@media only screen and (max-width: 767px) {
  .reviews__comment--area {
    padding: 0;
  }
}

/* textarea و input فرم اصلی (بالای صفحه) */
.reviews__comment--reply__textarea {
  width: 100%;
  height: 100px;
  resize: none;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

@media only screen and (min-width: 768px) {
  .reviews__comment--reply__textarea {
    height: 150px;
  }
}

.reviews__comment--reply__textarea:focus {
  border-color: var(--secondary-color);
}

/* ===== سیستم جدید کارت کامنت ===== */

.comment-item-container {
  margin-bottom: 20px;
  width: 100%;
}

.comment-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all .3s ease;
  position: relative;
}

.comment-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.comment-card.is-admin {
  background: #fff8f8;
  border-right: 4px solid var(--secondary-color) !important;
}

/* آواتار */
.avatar-circle {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: #555;
  margin-left: 12px;
  flex-shrink: 0;
}

/* اطلاعات کاربر */
.user-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.admin-badge {
  background: var(--secondary-color);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 6px;
}

.comment-date {
  font-size: 12px;
  color: #888;
}

/* متن کامنت */
.comment-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.9;
  color: #444;
  word-wrap: break-word;
}

/* دکمه پاسخ */
.reply-toggle {
  display: inline-flex;
  align-items: center;
  background-color: #f8f9fa;
  color: #666;
  border: 1px solid var(--border-color);
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.reply-toggle:hover {
  background-color: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

/* ===== فرم پاسخ (اصلاح شده و بزرگ) ===== */
.reply-form-wrapper {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
  width: 100%;
}

.reply-form-wrapper textarea {
  width: 100% !important;
  min-height: 120px !important; /* بزرگتر شدن کادر پاسخ */
  padding: 15px !important;
  font-size: 14px !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  margin-bottom: 10px;
}

.btn-submit-reply {
  background: var(--secondary-color);
  color: #fff;
  border: none;
  padding: 10px 25px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel-reply {
  background: #eee;
  color: #444;
  border: none;
  padding: 10px 25px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ===== ساختار درختی (جلوگیری از بیرون‌زدگی) ===== */

.comment-replies {
  padding-right: 35px; /* ایجاد تو رفتگی بصری */
  border-right: 2px solid #f1f1f1;
  margin-right: 15px;
  margin-top: 10px;
}

/* حذف تورفتگی اضافی برای لایه‌های خیلی عمیق در مانیتور کوچک */
.comment-level-4 .comment-replies, 
.comment-level-5 .comment-replies {
  padding-right: 15px;
  border-right: 1px solid #eee;
}

/* موبایل */
@media (max-width: 768px) {
  .comment-replies {
    padding-right: 15px;
    margin-right: 5px;
  }
  
  .avatar-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .comment-card {
    padding: 15px;
  }
}

/* فاصله دکمه ها */
.gap-2 {
  gap: 10px;
}

/* دکمه لغو کلی */
.cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 0 25px;
  background-color: #f0f0f0 !important;
  color: #444 !important;
  border: 1px solid #ddd !important;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
}



