/* ============================================================
   aff-kit.css — bộ component affiliate tăng CTR trong bài viết
   Port từ aff-toolkit (REHub) sang design token của muadepre.
   Dùng biến --ink, --mint, --gold của site nên tự chạy đúng ở dark mode.
   ============================================================ */

.affkit {
  --ak-line: var(--ink-200);
  --ak-card: var(--ivory);
  --ak-hot: #E05A47;
  --ak-hot-soft: #FDEEEC;
  --ak-ok: var(--mint-700);
  --ak-ok-soft: var(--mint-50);
  font-family: var(--font-sans);
  margin: 32px 0;
}
.theme-dark .affkit { --ak-hot-soft: #2A1A17; }

/* ---------- nút dùng chung ---------- */
.affkit .ak-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--mint-900); color: var(--ivory);
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: var(--radius); text-decoration: none;
  border: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, transform .1s ease;
}
.affkit .ak-btn:hover { background: var(--mint-700); transform: translateY(-1px); }
.affkit .ak-btn--gold { background: var(--gold); color: #fff; }
.affkit .ak-btn--gold:hover { background: #b89549; }
.affkit .ak-btn--sm { padding: 8px 14px; font-size: 13px; }
.affkit .ak-cash {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--mint-900);
  background: var(--mint-50); border: 1px solid var(--mint-200);
  border-radius: var(--radius); padding: 7px 12px; text-decoration: none;
}
.affkit .ak-cash:hover { background: var(--mint-100); }
.affkit .ak-note { font-size: 12px; color: var(--ink-500); margin: 8px 0 0; }

/* ============================================================
   1. VERDICT BOX — điểm tổng + tiêu chí + ưu/nhược
   ============================================================ */
.ak-verdict {
  background: var(--ak-card); border: 1px solid var(--ak-line);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; gap: 24px; flex-wrap: wrap;
}
.ak-verdict__score { flex: 0 0 116px; text-align: center; }
.ak-verdict__ring {
  width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--mint-500) calc(var(--score) * 1%), var(--ink-200) 0);
}
.ak-verdict__ring span {
  width: 84px; height: 84px; border-radius: 50%; background: var(--ak-card);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--mint-900);
}
.ak-verdict__label {
  font-size: 11px; font-weight: 700; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: .06em;
}
.ak-verdict__body { flex: 1; min-width: 260px; }
.ak-verdict__title {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  color: var(--ink-900); margin: 0 0 12px; line-height: 1.3;
}
.ak-verdict__crit { margin-bottom: 9px; font-size: 13px; }
.ak-verdict__crit-top { display: flex; justify-content: space-between; margin-bottom: 3px; color: var(--ink-700); }
.ak-verdict__bar { height: 6px; background: var(--ink-200); border-radius: 4px; overflow: hidden; }
.ak-verdict__bar i { display: block; height: 100%; background: var(--mint-500); border-radius: 4px; }
.ak-verdict__pc { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.ak-verdict__pros, .ak-verdict__cons { flex: 1; min-width: 210px; border-radius: var(--radius); padding: 12px 14px 12px 16px; font-size: 13.5px; }
.ak-verdict__pros { background: var(--ak-ok-soft); }
.ak-verdict__cons { background: var(--ak-hot-soft); }
.ak-verdict__pc-h { margin: 0 0 6px; font-size: 13px; font-weight: 600; font-family: var(--font-sans); }
.ak-verdict__pros .ak-verdict__pc-h { color: var(--mint-900); }
.ak-verdict__cons .ak-verdict__pc-h { color: var(--ak-hot); }
.ak-verdict__pros ul, .ak-verdict__cons ul { margin: 0; padding-left: 16px; }
.ak-verdict__pros li, .ak-verdict__cons li { list-style: none; position: relative; margin-bottom: 4px; color: var(--ink-700); }
.ak-verdict__pros li::before { content: "✓"; color: var(--mint-700); position: absolute; left: -16px; font-weight: 700; }
.ak-verdict__cons li::before { content: "✕"; color: var(--ak-hot); position: absolute; left: -16px; font-weight: 700; }

/* ============================================================
   2. TOPLIST — bảng xếp hạng "Top N"
   ============================================================ */
.ak-toplist { display: flex; flex-direction: column; gap: 18px; }
.ak-top {
  background: var(--ak-card); border: 1px solid var(--ak-line);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; gap: 16px; position: relative; flex-wrap: wrap;
}
.ak-top--win { border: 2px solid var(--gold); }
.ak-top__rank {
  position: absolute; top: -13px; left: -8px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--mint-900); color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm);
}
.ak-top--win .ak-top__rank { background: var(--gold); color: #fff; }
.ak-top__ribbon {
  position: absolute; top: -11px; right: 16px; background: var(--gold); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}
.ak-top__img {
  flex: 0 0 100px; height: 100px; border-radius: var(--radius);
  background: var(--cream); overflow: hidden;
}
.ak-top__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ak-top__body { flex: 1; min-width: 200px; }
.ak-top__body h3 {
  margin: 2px 0 4px; font-family: var(--font-display); font-size: 18px;
  font-weight: 500; line-height: 1.3;
}
.ak-top__body h3 a { color: var(--ink-900); text-decoration: none; }
.ak-top__body h3 a:hover { color: var(--mint-700); }
.ak-top__meta { font-size: 12.5px; color: var(--ink-500); margin-bottom: 6px; }
.ak-top__plus { font-size: 13.5px; color: var(--mint-900); margin: 0; }
.ak-top__cta {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 7px; min-width: 132px;
}
.ak-top__price { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--mint-900); }
.ak-top__price s { display: block; font-size: 12px; color: var(--ink-500); font-weight: 400; }

/* ============================================================
   3. VERSUS — bảng đối đầu 2 sản phẩm
   ============================================================ */
.ak-versus { background: var(--ak-card); border: 1px solid var(--ak-line); border-radius: var(--radius-lg); overflow-x: auto; }
.ak-versus table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.ak-versus th, .ak-versus td { padding: 12px 14px; text-align: center; border-bottom: 1px solid var(--ak-line); }
.ak-versus tr:last-child td { border-bottom: none; }
.ak-versus th { background: var(--cream); font-family: var(--font-display); font-size: 16px; font-weight: 500; color: var(--ink-900); }
.ak-versus td:first-child { text-align: left; color: var(--ink-500); font-weight: 600; font-size: 13px; width: 30%; }
.ak-versus .win { color: var(--mint-900); font-weight: 700; }
.ak-versus .win::after { content: " ✓"; color: var(--mint-500); }
.ak-versus__vs { display: inline-block; background: var(--ak-hot); color: #fff; font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 999px; }

/* ============================================================
   4. DEAL BOX — đếm ngược
   ============================================================ */
.ak-deal {
  background: linear-gradient(120deg, var(--mint-900), var(--mint-700));
  color: var(--ivory); border-radius: var(--radius-lg); padding: 22px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.ak-deal__body { flex: 1; min-width: 220px; }
.ak-deal__body h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--ivory); }
.ak-deal__body p { margin: 0; font-size: 13.5px; opacity: .85; }
.ak-deal__price { font-family: var(--font-display); font-size: 23px; font-weight: 600; color: var(--gold-soft); margin-top: 8px; }
.ak-deal__price s { font-size: 14px; opacity: .6; font-weight: 400; margin-left: 8px; }
.ak-deal__timer { display: flex; gap: 8px; }
.ak-deal__cell { background: rgba(255,255,255,.14); border-radius: var(--radius-sm); padding: 8px 0; width: 56px; text-align: center; }
.ak-deal__cell b { display: block; font-size: 19px; font-family: var(--font-mono); }
.ak-deal__cell small { font-size: 10px; text-transform: uppercase; opacity: .75; letter-spacing: .05em; }
.ak-deal .ak-btn { background: var(--gold); color: #fff; }
.ak-deal .ak-btn:hover { background: #b89549; }

/* ============================================================
   5. VOUCHER GRID — mã giảm giá Shopee, bấm để lộ + copy
   ============================================================ */
.ak-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.ak-vcard {
  background: var(--ak-card); border: 1px solid var(--ak-line);
  border-radius: var(--radius); padding: 14px; display: flex; gap: 12px;
}
.ak-vcard__disc {
  flex: 0 0 auto; background: var(--ak-hot-soft); color: var(--ak-hot); font-weight: 700;
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; text-align: center;
  min-width: 62px; align-self: flex-start; line-height: 1.25;
}
.ak-vcard__body { flex: 1; min-width: 0; }
.ak-vcard__body b { font-size: 13.5px; display: block; margin-bottom: 2px; color: var(--ink-900); font-weight: 600; }
.ak-vcard__meta { font-size: 12px; color: var(--ink-500); margin-bottom: 9px; }
.ak-vgrid__updated { font-size: 12px; color: var(--ink-500); margin: 10px 0 0; }

/* coupon button (dùng chung voucher grid) */
.ak-code { position: relative; display: inline-block; }
.ak-code__btn {
  background: transparent; border: 2px dashed var(--gold); color: var(--mint-900);
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: .08em;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: .15s;
}
.ak-code__btn:hover { background: var(--cream); }
.ak-code__btn.is-open { border-style: solid; background: var(--cream); cursor: copy; }
.ak-code__tip {
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  background: var(--ink-900); color: var(--ivory); font-size: 11px; padding: 3px 9px;
  border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: .2s; white-space: nowrap;
}
.ak-code__tip.is-show { opacity: 1; }

/* ============================================================
   6. KEY TAKEAWAYS — khối trả lời nhanh đầu bài (GEO)
   ============================================================ */
.ak-tldr {
  background: var(--mint-50); border: 1px solid var(--mint-200);
  border-left: 4px solid var(--mint-500);
  border-radius: var(--radius); padding: 18px 20px;
}
.ak-tldr h2, .ak-tldr__h {
  font-family: var(--font-sans) !important; font-size: 12px !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mint-700) !important;
  margin: 0 0 10px !important;
}
.ak-tldr ul { margin: 0; padding-left: 18px; }
.ak-tldr li { margin-bottom: 7px; font-size: 15px; line-height: 1.6; color: var(--ink-700); }
.ak-tldr li:last-child { margin-bottom: 0; }
.ak-tldr strong { color: var(--ink-900); }

@media (max-width: 640px) {
  .ak-verdict { padding: 18px; gap: 16px; }
  .ak-verdict__score { flex: 0 0 100%; display: flex; align-items: center; gap: 14px; text-align: left; }
  .ak-verdict__ring { margin: 0; }
  .ak-top__cta { flex-direction: row; width: 100%; justify-content: space-between; min-width: 0; }
  .ak-top__img { flex: 0 0 76px; height: 76px; }
  .ak-deal__timer { width: 100%; }
  .ak-deal__cell { flex: 1; width: auto; }
  .ak-deal .ak-btn { width: 100%; }
}
