/* ═══════════════════════════════════════════════════
   T29 — Tab Bình Luận
   Scope: .pd-comment-section (product detail page only)
   ═══════════════════════════════════════════════════ */

/* ── Wrapper ── */
.pd-comment-section {
  padding: 20px 0 8px;
}

/* ── Comment list ── */
.pd-comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

/* ── Comment item: avatar + body ── */
.pd-comment-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.pd-comment-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #C62828;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  user-select: none;
}

.pd-comment-body {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #EEEEEE;
  border-radius: 10px;
  padding: 14px 16px;
}

.pd-comment-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pd-comment-name {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
}

.pd-comment-date {
  font-size: 12px;
  color: #9E9E9E;
}

.pd-comment-content {
  font-size: 14px;
  color: #424242;
  line-height: 1.7;
  word-break: break-word;
}

/* Admin reply block */
.pd-comment-reply {
  margin-top: 10px;
  padding: 10px 12px;
  background: #FFF8E1;
  border-left: 3px solid #C62828;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #424242;
}

.pd-reply-badge {
  display: block;
  font-weight: 700;
  color: #C62828;
  font-size: 12px;
  margin-bottom: 4px;
}

.pd-reply-text {
  line-height: 1.6;
}

/* ── Empty state ── */
.pd-comment-empty {
  text-align: center;
  padding: 40px 20px;
}

.pd-comment-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.pd-comment-empty-text {
  font-size: 15px;
  font-weight: 600;
  color: #616161;
  margin: 0 0 6px;
}

.pd-comment-empty-sub {
  font-size: 13px;
  color: #9E9E9E;
  margin: 0;
}

/* ── Form wrapper ── */
.pd-comment-form-wrap {
  border-top: 2px solid #F0F0F0;
  padding-top: 36px;
  margin-top: 8px;
}

.pd-comment-form-title {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 16px;
}

/* Textarea field */
.pd-cmt-field {
  margin-bottom: 12px;
}

.pd-cmt-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1.5px solid #BDBDBD;
  border-radius: 8px;
  font-size: 14px;
  color: #1A1A1A;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  display: block;
}

.pd-cmt-textarea:focus {
  border-color: #C62828;
}

/* Footer: note + submit button */
.pd-cmt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pd-cmt-note {
  font-size: 12px;
  color: #9E9E9E;
  font-style: italic;
}

.pd-cmt-submit {
  padding: 11px 28px;
  background: #C62828;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.pd-cmt-submit:hover {
  background: #B71C1C;
}

.pd-cmt-submit:disabled {
  background: #BDBDBD;
  cursor: not-allowed;
}

/* Notice messages */
.pd-cmt-notice {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.pd-cmt-notice.pd-notice-ok {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.pd-cmt-notice.pd-notice-err {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
}

/* Login notice */
.pd-cmt-login-notice {
  padding: 14px 16px;
  background: #FFF8E1;
  border-radius: 8px;
  font-size: 14px;
  color: #424242;
  border: 1px solid #FFE082;
}

.pd-cmt-login-link {
  color: #C62828;
  font-weight: 600;
  text-decoration: underline;
}

.pd-cmt-login-link:hover {
  color: #B71C1C;
}

/* Hide fake panel tab (anchor-only tab, no content panel) */
.pd-comment-fake-panel {
  display: none !important;
}

/* Text input for guest comment form */
.pd-cmt-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #BDBDBD;
  border-radius: 8px;
  font-size: 14px;
  color: #1A1A1A;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
  font-family: inherit;
  outline: none;
  display: block;
}

.pd-cmt-input:focus {
  border-color: #C62828;
}

/* Two-column row: name + phone side by side */
.pd-cmt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Comment section outer container ── */
/* clear: both ensures this block starts below any floated element from the
   tab widget above it (Bootstrap col float + easyResponsiveTabs). Without
   this the float context can bleed and push the section outside the column. */
.pd-comment-outer {
  clear: both;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin-top: 28px;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 0 24px 24px;
}

@media (max-width: 767px) {
  .pd-comment-outer {
    margin-top: 18px;
  }
}

/* Scroll offset so sticky header doesn't cover the section */
#product-comments {
  scroll-margin-top: 90px;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .pd-cmt-row {
    grid-template-columns: 1fr;
  }

  .pd-comment-item {
    gap: 10px;
  }

  .pd-comment-avatar {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .pd-comment-body {
    padding: 10px 12px;
  }

  .pd-cmt-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .pd-cmt-submit {
    width: 100%;
    justify-content: center;
  }

  .pd-cmt-textarea {
    min-height: 80px;
  }
}
