.kh-page { max-width: 1040px; margin: 0 auto; padding: 20px 16px 0; }

.kh-loading, .kh-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 40px 20px; text-align: center; grid-column: 1 / -1;
}
.kh-empty-state svg { color: var(--text-2); opacity: .45; }
.kh-loading p, .kh-empty-state p { font-size: 13.5px; color: var(--text-2); margin: 0; max-width: 320px; line-height: 1.5; }

.kh-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
@media (max-width: 767px) {
  .kh-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════ */
.kh-card {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  opacity: 0; animation: khCardIn .4s ease forwards;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.kh-card:hover { box-shadow: var(--shadow-md); border-color: #c7d7fb; transform: translateY(-2px); }
@keyframes khCardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.kh-card-img-wrap { width: 100%; aspect-ratio: 16 / 10; background: var(--bg-hover); overflow: hidden; flex-shrink: 0; }
.kh-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kh-card-img-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: linear-gradient(135deg, var(--bg-hover), var(--bg));
}

.kh-card-body { padding: 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.kh-card-name { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.35; }
.kh-card-desc {
  font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.kh-card-fee { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kh-card-fee-original { font-size: 13px; color: var(--text-3); text-decoration: line-through; font-weight: 600; }
.kh-card-fee-amount { font-size: 18px; color: var(--primary); font-weight: 800; }
.kh-card-fee-amount.sale { color: var(--danger); }

.kh-card-btn {
  margin-top: 4px; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--primary-light); color: var(--primary); font-weight: 700; font-size: 14.5px;
  cursor: pointer; font-family: inherit; transition: background .15s, transform .12s;
}
.kh-card-btn:hover { background: #dbe7fd; }
.kh-card-btn:active { transform: scale(.98); }

/* ═══════════════════════════════════════════════════════════
   MODAL — "Thông tin khóa học"
   ═══════════════════════════════════════════════════════════ */
.kh-overlay {
  position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: khFadeIn .2s ease; overflow-y: auto;
}
@keyframes khFadeIn { from { opacity: 0; } to { opacity: 1; } }

.kh-modal {
  background: var(--bg-card); border-radius: 20px; max-width: 600px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: khPopIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes khPopIn { from { transform: translateY(20px) scale(.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.kh-modal-img-wrap { width: 100%; aspect-ratio: 16 / 9; background: var(--bg-hover); overflow: hidden; }
.kh-modal-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kh-modal-body { padding: 20px 22px 22px; }
.kh-modal-title { font-size: 19px; font-weight: 800; color: var(--text); margin: 0 0 4px; line-height: 1.3; }
.kh-modal-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; margin: 0 0 16px; }

.kh-block-title {
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 8px;
}

.kh-content-list { list-style: none; padding: 0; margin: 0 0 16px; }
.kh-content-list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13.5px; line-height: 1.55; color: var(--text); padding: 5px 0;
}
.kh-content-list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  margin-top: 7px; background: var(--primary);
}

.kh-price-block { padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.kh-price-box { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kh-price-original { font-size: 14px; font-weight: 600; color: var(--text-3); text-decoration: line-through; }
.kh-price-sale { font-size: 22px; font-weight: 800; color: var(--danger); }
.kh-price-amount { font-size: 22px; font-weight: 800; color: var(--primary); }
.kh-discount-reason {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 12px; font-weight: 700; color: var(--warning);
  background: var(--warning-light); border-radius: 8px; padding: 6px 10px; width: fit-content;
}

.kh-register-btn {
  display: block; width: 100%; text-align: center; padding: 14px; border-radius: 12px;
  background: linear-gradient(90deg, #1d6ff2, #3b82f6); color: #fff; font-weight: 800; font-size: 15px;
  border: none; cursor: pointer; font-family: inherit; box-shadow: 0 6px 18px rgba(29,111,242,.3);
  transition: opacity .15s, transform .12s; margin-bottom: 14px;
}
.kh-register-btn:hover { opacity: .92; }
.kh-register-btn:active { transform: scale(.99); }

.kh-cta-title {
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 8px;
}
.kh-cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.kh-cta {
  flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: none; border-radius: 10px; color: #fff; font-weight: 800; font-size: 13.5px;
  text-decoration: none; font-family: inherit; transition: opacity .15s, transform .12s;
}
.kh-cta:hover { opacity: .92; transform: translateY(-1px); }
.kh-cta:active { transform: translateY(0); }
.kh-cta-zalo { background: #0068ff; box-shadow: 0 4px 14px rgba(0,104,255,.25); }
.kh-cta-fb   { background: #1877f2; box-shadow: 0 4px 14px rgba(24,119,242,.25); }

/* ── Khối đăng ký/thanh toán — hiện khi bấm "Đăng ký khóa này" ── */
.kh-pay-block {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
  animation: khFadeIn .2s ease;
}
.kh-pay-title { font-size: 13.5px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.kh-bank-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.kh-bank-row:last-of-type { border-bottom: none; }
.kh-bank-label { color: var(--text-2); flex-shrink: 0; min-width: 92px; }
.kh-bank-value { color: var(--text); font-weight: 700; flex: 1; word-break: break-word; }
.kh-copy-btn {
  flex-shrink: 0; background: var(--primary-light); color: var(--primary); border: none;
  border-radius: 7px; padding: 5px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.kh-copy-btn:hover { background: #dbe7fd; }

.kh-transfer-box {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 10px;
  background: var(--bg-hover); border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
  color: var(--text-2); line-height: 1.55;
}
.kh-transfer-box svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }

.kh-qr-wrap { text-align: center; margin-top: 12px; }
.kh-qr-wrap img { max-width: 170px; width: 100%; border-radius: 10px; border: 1.5px solid var(--border); }
.kh-qr-label { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.kh-modal-close {
  display: block; width: 100%; text-align: center; padding: 11px; border-radius: 10px;
  border: 1.5px solid var(--border); background: transparent; color: var(--text-2);
  font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; margin-top: 14px;
  transition: all .15s;
}
.kh-modal-close:hover { background: var(--bg-hover); }
