/* Kenco Enterprise Core - frontend styles
 * Đổi màu thương hiệu bằng cách ghi đè các biến --kenco-* trong kenco-master.css.
 * Khối "Mục lục" (.kenco-toc-*) dùng biến nên nếu kenco-master.css đã định nghĩa lại thì file đó thắng.
 */
:root {
  --kenco-primary: #0b3d91;
  --kenco-accent: #f58220;
  --kenco-ink: #0f172a;
  --kenco-muted: #64748b;
  --kenco-line: #e2e8f0;
  --kenco-bg-soft: #f8fafc;
  --kenco-danger: #dc2626;
  --kenco-radius: 14px;
}

.kenco-modal-backdrop [hidden],
.kenco-form-status[hidden] { display: none !important; }

html.kenco-lock { overflow: hidden; }

/* ---------- Nút RFQ ---------- */
.kenco-btn-rfq {
  display: inline-block;
  background: var(--kenco-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 20px;
  border: 0;
  border-radius: 10px;
  margin: 0;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(11, 61, 145, .25);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.kenco-btn-rfq:hover { background: var(--kenco-accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 130, 32, .35); }
.kenco-btn-block { display: block; width: 100%; box-sizing: border-box; }
.kenco-card-actions { margin-top: 10px; width: 100%; box-sizing: border-box; }
.kenco-single-actions { margin: 14px 0; }

/* ---------- Badge ---------- */
.kenco-badge-pill {
  display: inline-block;
  background: #eff6ff;
  color: var(--kenco-primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 4px;
}

/* ---------- Mục lục bài viết ---------- */
.kenco-toc-box {
  background: var(--kenco-bg-soft);
  border: 1px solid var(--kenco-line);
  border-left: 4px solid var(--kenco-primary);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 25px 0;
}
.kenco-toc-header { font-size: 16px; font-weight: 800; color: var(--kenco-ink); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.kenco-toc-list { margin: 0; padding-left: 20px; list-style: decimal; }
.kenco-toc-list li { margin-bottom: 6px; font-size: 14px; }
.kenco-toc-list a { color: #334155; text-decoration: none; transition: color .2s; }
.kenco-toc-list a:hover { color: var(--kenco-primary); }
.kenco-toc-sub { margin-left: 18px; list-style: circle; }
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: 90px; }
html { scroll-behavior: smooth; }

/* ---------- Dự án (kenco_project) ---------- */
.kenco-projects { display: grid; gap: 22px; margin: 20px 0; grid-template-columns: repeat(3, 1fr); }
.kenco-projects.kenco-cols-1 { grid-template-columns: 1fr; }
.kenco-projects.kenco-cols-2 { grid-template-columns: repeat(2, 1fr); }
.kenco-projects.kenco-cols-4 { grid-template-columns: repeat(4, 1fr); }
.kenco-project-card { background: #fff; border: 1px solid var(--kenco-line); border-radius: var(--kenco-radius); overflow: hidden; transition: transform .25s, box-shadow .25s; }
.kenco-project-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px -10px rgba(11, 61, 145, .18); }
.kenco-project-card a { display: block; color: inherit; text-decoration: none; }
.kenco-project-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: var(--kenco-ink); }
.kenco-project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kenco-project-body { padding: 14px 16px 18px; }
.kenco-project-title { margin: 0 0 6px; font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--kenco-ink); }
.kenco-project-meta { margin: 0; font-size: 13px; color: var(--kenco-muted); }

.kenco-project-specs { margin: 32px 0; }
.kenco-table-wrap { overflow-x: auto; }
.kenco-spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kenco-spec-table th,
.kenco-spec-table td { border: 1px solid var(--kenco-line); padding: 10px 14px; text-align: left; vertical-align: top; }
.kenco-spec-table th { width: 32%; background: var(--kenco-bg-soft); color: var(--kenco-ink); font-weight: 700; }

/* ---------- Modal RFQ ---------- */
.kenco-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.kenco-modal-backdrop.is-active { display: flex; }

.kenco-modal {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .3);
}
.kenco-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.kenco-modal-title { margin: 2px 0 0; font-size: 17px; font-weight: 800; color: var(--kenco-ink); }
.kenco-close-circle {
  background: #f1f5f9; border: 0; width: 34px; height: 34px; min-height: 0; padding: 0; margin: 0; flex: none;
  border-radius: 50%; font-size: 16px; color: var(--kenco-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.kenco-close-circle:hover { background: var(--kenco-line); color: var(--kenco-ink); }

.kenco-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.kenco-input-group { margin-bottom: 12px; text-align: left; }
.kenco-input-group label { display: block; font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.kenco-required { color: var(--kenco-danger); }
.kenco-form-input { width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; background: var(--kenco-bg-soft); box-sizing: border-box; margin: 0; }
.kenco-form-input:focus { border-color: var(--kenco-primary); background: #fff; outline: 2px solid rgba(11, 61, 145, .2); }
.kenco-form-input.is-invalid { border-color: var(--kenco-danger); }

.kenco-fieldset { border: 1px dashed #cbd5e1; border-radius: 12px; padding: 12px 14px 2px; margin: 4px 0 12px; }
.kenco-fieldset legend { font-size: 12px; font-weight: 800; color: var(--kenco-primary); padding: 0 6px; }
.kenco-fieldset legend small { font-weight: 500; color: var(--kenco-muted); }

.kenco-consent label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 12px; line-height: 1.5; color: #475569; }
.kenco-consent input[type="checkbox"] { margin: 3px 0 0; flex: none; }

/* Honeypot: ẩn khỏi người dùng thật nhưng vẫn nằm trong DOM cho bot */
.kenco-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.kenco-form-buttons { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 18px; }
.kenco-btn-cancel { padding: 10px; margin: 0; border-radius: 10px; border: 0; background: #f1f5f9; color: #475569; font-weight: 700; cursor: pointer; }
.kenco-btn-submit { padding: 10px; margin: 0; border-radius: 10px; border: 0; background: var(--kenco-primary); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 4px 12px rgba(11, 61, 145, .3); }
.kenco-btn-submit:hover { background: var(--kenco-accent); }
.kenco-btn-submit[disabled] { opacity: .7; cursor: progress; }

.kenco-form-status { padding: 10px; border-radius: 8px; margin: 12px 0 0; font-size: 13px; }
.kenco-status-success { background: #dcfce7; color: #15803d; }
.kenco-status-error { background: #fee2e2; color: #b91c1c; }

@media (max-width: 782px) {
  .kenco-projects,
  .kenco-projects.kenco-cols-3,
  .kenco-projects.kenco-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 549px) {
  .kenco-projects,
  .kenco-projects.kenco-cols-2,
  .kenco-projects.kenco-cols-3,
  .kenco-projects.kenco-cols-4 { grid-template-columns: 1fr; }
  .kenco-modal { padding: 18px; }
  .kenco-grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kenco-btn-rfq, .kenco-project-card { transition: none !important; }
}
