/*
 * Bahareman article comment experience (1.6.10)
 * Presentation only: native comment reply, form fields, data and pagination logic stay intact.
 * Deliberately scoped to the article #comments container, not WooCommerce product review UI.
 */
#comments.bmfb-comments {
  --bmfb-cx-ink: #142b3a;
  --bmfb-cx-muted: #607586;
  --bmfb-cx-line: #e0ebf0;
  --bmfb-cx-teal: #099c96;
  direction: rtl;
  text-align: right;
  background: linear-gradient(180deg, #f8fcfd 0%, #fff 240px) !important;
  border: 1px solid #e3edf1 !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 45px rgba(25, 57, 76, .045) !important;
}

#comments.bmfb-comments > .bmfb-comments-title {
  margin: 0 0 22px !important;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--bmfb-cx-line);
  color: var(--bmfb-cx-ink) !important;
  font-size: clamp(19px, 2.1vw, 27px) !important;
  font-weight: 850;
  line-height: 1.65;
}

/* Native reply tree and real comment IDs are never changed. */
#comments.bmfb-comments .commentlist,
#comments.bmfb-comments .comment-list {
  min-width: 0;
}
#comments.bmfb-comments .bmpolish-comment-card {
  padding: clamp(15px, 1.8vw, 23px) !important;
  border: 1px solid var(--bmfb-cx-line) !important;
  border-radius: 19px !important;
  background: #fff !important;
  box-shadow: 0 6px 22px rgba(17, 44, 62, .035) !important;
}
#comments.bmfb-comments .bmpolish-comment-card__head {
  gap: 12px;
  margin-bottom: 10px;
}
#comments.bmfb-comments .bmpolish-comment-author strong {
  color: var(--bmfb-cx-ink);
  font-size: 14px;
  font-weight: 800;
}
#comments.bmfb-comments .bmpolish-comment-text {
  color: #374c5b;
  font-size: 14px;
  line-height: 2.05;
  overflow-wrap: anywhere;
}
#comments.bmfb-comments .bmpolish-comment-text p {
  margin: 0 0 8px;
  line-height: inherit;
}
#comments.bmfb-comments .bmpolish-comment-text p:last-child { margin-bottom: 0; }
#comments.bmfb-comments .bmpolish-comment-actions { margin-top: 14px; }
#comments.bmfb-comments .bmpolish-comment-actions .comment-reply-link {
  min-height: 34px;
  padding: 5px 15px;
  border: 1px solid #d5eee9;
  border-radius: 999px;
  background: #effbf8;
  color: #087a73 !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
  transition: background-color .15s ease, border-color .15s ease;
}
#comments.bmfb-comments .bmpolish-comment-actions .comment-reply-link:hover {
  border-color: #b8e4dc;
  background: #e2f7f2;
}
#comments.bmfb-comments .commentlist .children {
  margin: 14px 15px 4px 0;
  padding: 0 13px 0 0;
  border-right: 2px solid #b8ebe3;
  border-left: 0;
}

/* Reply form: a coherent, readable RTL card at the bottom or moved below a comment. */
#comments.bmfb-comments .comment-respond {
  position: relative;
  display: block;
  box-sizing: border-box;
  clear: both;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 25px 0 15px;
  padding: clamp(20px, 2.8vw, 34px);
  border: 1px solid #d9e9eb;
  border-radius: 23px;
  background: linear-gradient(150deg, #fff 60%, #f3fbfa 100%);
  box-shadow: 0 12px 36px rgba(13, 59, 71, .06);
  direction: rtl;
  text-align: right;
}
#comments.bmfb-comments .comment-respond::before {
  content: '';
  position: absolute;
  top: 0;
  right: 25px;
  width: 74px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #12b4ae, #3f9ce4);
}
#comments.bmfb-comments .commentlist .comment-respond {
  margin: 17px 0 20px;
  box-shadow: 0 8px 25px rgba(13, 59, 71, .035);
}

/* Explicitly separate the title and WordPress's "cancel reply" control. */
#comments.bmfb-comments .comment-respond #reply-title {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 16px;
  width: 100%;
  min-width: 0;
  margin: 0 0 11px !important;
  padding: 0 !important;
  color: var(--bmfb-cx-ink) !important;
  font-size: clamp(19px, 2.2vw, 24px) !important;
  font-weight: 850 !important;
  line-height: 1.75;
  text-align: right;
  overflow-wrap: anywhere;
}
#comments.bmfb-comments .comment-respond #reply-title small {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.8;
}
#comments.bmfb-comments #cancel-comment-reply-link {
  padding: 5px 12px;
  border: 1px solid #f5d8d7;
  border-radius: 999px;
  background: #fff4f3;
  color: #aa4850 !important;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.85;
  text-decoration: none !important;
  white-space: nowrap;
}
#comments.bmfb-comments #cancel-comment-reply-link:hover {
  background: #ffe8e6;
  border-color: #efc0c0;
}

/* Plugin's original two-column grid splits the name and message far apart. */
#comments.bmfb-comments .comment-respond form.comment-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row;
  align-items: stretch;
  gap: 16px !important;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
}
#comments.bmfb-comments .comment-respond form.comment-form > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
}
#comments.bmfb-comments .comment-respond .bmpolish-comment-note,
#comments.bmfb-comments .comment-respond .comment-notes,
#comments.bmfb-comments .comment-respond .bmpolish-logged-in {
  margin: 0 0 1px !important;
  color: var(--bmfb-cx-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 2;
  text-align: right;
}
#comments.bmfb-comments .comment-respond .comment-form-author { order: 1; }
#comments.bmfb-comments .comment-respond .comment-form-comment { order: 2; }
#comments.bmfb-comments .comment-respond .comment-form-cookies-consent { order: 3; }
#comments.bmfb-comments .comment-respond .form-submit { order: 4; }
#comments.bmfb-comments .comment-respond .bmpolish-field {
  width: 100%;
  margin: 0 !important;
  text-align: right;
}
#comments.bmfb-comments .comment-respond .bmpolish-field label {
  display: block;
  width: 100%;
  margin: 0 0 8px !important;
  color: #234052;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
#comments.bmfb-comments .comment-respond .required { color: #db6572; }
#comments.bmfb-comments .comment-respond .bmpolish-field input,
#comments.bmfb-comments .comment-respond .bmpolish-field textarea {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100%;
  margin: 0;
  padding: 13px 18px !important;
  border: 1px solid #d6e4ea !important;
  border-radius: 15px !important;
  background: #fff !important;
  color: #23394c !important;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.95;
  direction: rtl;
  text-align: right;
  box-shadow: 0 2px 6px rgba(22, 58, 76, .025) !important;
  transition: border-color .16s ease, box-shadow .16s ease;
}
#comments.bmfb-comments .comment-respond .comment-form-author input {
  min-height: 54px;
}
#comments.bmfb-comments .comment-respond .comment-form-comment textarea {
  min-height: 170px;
  resize: vertical;
}
#comments.bmfb-comments .comment-respond .bmpolish-field input::placeholder,
#comments.bmfb-comments .comment-respond .bmpolish-field textarea::placeholder {
  color: #8798a7;
  opacity: 1;
}
#comments.bmfb-comments .comment-respond .bmpolish-field input:focus,
#comments.bmfb-comments .comment-respond .bmpolish-field textarea:focus {
  outline: 0;
  border-color: #37b6b0 !important;
  box-shadow: 0 0 0 4px rgba(8, 161, 150, .11) !important;
}
#comments.bmfb-comments .comment-respond .form-submit {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 4px 0 0 !important;
}
#comments.bmfb-comments .comment-respond .bmpolish-comment-submit,
#comments.bmfb-comments .comment-respond input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 168px;
  min-height: 50px !important;
  padding: 11px 26px !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: linear-gradient(110deg, #08a69d, #198ad2) !important;
  color: #fff !important;
  font-size: 14px;
  font-weight: 800 !important;
  line-height: 1.6;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 9px 18px rgba(9, 132, 163, .15) !important;
  transition: transform .16s ease, box-shadow .16s ease;
}
#comments.bmfb-comments .comment-respond input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(9, 132, 163, .22) !important;
}
#comments.bmfb-comments .comment-respond a:focus-visible,
#comments.bmfb-comments .comment-respond button:focus-visible,
#comments.bmfb-comments .comment-respond input:focus-visible,
#comments.bmfb-comments .bmpolish-comment-actions a:focus-visible {
  outline: 3px solid rgba(16, 158, 161, .4);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  #comments.bmfb-comments {
    padding: 15px !important;
    border-radius: 18px !important;
  }
  #comments.bmfb-comments .bmpolish-comment-card { padding: 15px !important; }
  #comments.bmfb-comments .commentlist .children {
    margin-right: 8px;
    padding-right: 9px;
  }
  #comments.bmfb-comments .comment-respond {
    margin-top: 18px;
    padding: 18px 15px 20px;
    border-radius: 17px;
  }
  #comments.bmfb-comments .comment-respond::before { right: 15px; }
  #comments.bmfb-comments .comment-respond #reply-title {
    font-size: 19px !important;
    line-height: 1.8;
  }
  #comments.bmfb-comments .comment-respond .comment-form-comment textarea { min-height: 165px; }
  #comments.bmfb-comments .comment-respond .form-submit,
  #comments.bmfb-comments .comment-respond .form-submit input[type="submit"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #comments.bmfb-comments .comment-respond input,
  #comments.bmfb-comments .comment-respond textarea,
  #comments.bmfb-comments .comment-reply-link { transition: none !important; }
}
