/* Card styles — tách từ template-parts/card-*.php (trước đây in lại theo từng thẻ) */

/* ═══ card-chatbot.php ═══ */
/* ══════════════════════════════════════════════════════════════
   CARD CHATBOT - NEW DESIGN
   ══════════════════════════════════════════════════════════════ */
.cb-card-new {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all .25s ease;
  text-decoration: none;
  color: inherit;
}
.cb-card-new:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  border-color: var(--cyan);
}

/* ── Thumbnail ── */
.cb-thumb-container {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #0a0a0f;
}
.cb-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.cb-card-new:hover .cb-thumb-img {
  transform: scale(1.05);
}
.cb-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* ── Badges Top Left ── */
.cb-badges-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 24px);
}
.cb-badge-new-wrap {
  position: absolute;
  top: 46px;
  left: 12px;
}

.cb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.cb-badge-premium {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.4);
}
.cb-badge-free {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,.4);
}
.cb-badge-outline {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.cb-badge-new {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(249,115,22,.4);
}

/* ── Bookmark Button ── */
.cb-bookmark {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}
.cb-bookmark:hover {
  background: rgba(6,182,212,.3);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(1.1);
}

/* ── Content ── */
.cb-content {
  padding: 16px;
}
.cb-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.cb-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cb-version {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-hover);
  padding: 3px 8px;
  border-radius: 50px;
  border: 1px solid var(--border);
}
.cb-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Footer Row ── */
.cb-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cb-sold {
  font-size: 12px;
  color: var(--muted);
}
.cb-price-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cb-discount {
  font-size: 11px;
  font-weight: 700;
  background: rgba(239,68,68,.15);
  color: #f87171;
  padding: 2px 6px;
  border-radius: 4px;
}
.cb-price-orig {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
}
.cb-price-sale {
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan);
}
.cb-price-free {
  font-size: 14px;
  font-weight: 700;
  color: var(--free);
}

/* Add to Cart Button */
.cb-add-cart-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(16,185,129,0.2));
  border: 1px solid rgba(6,182,212,0.4);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cb-add-cart-btn:hover {
  background: var(--cta-grad, linear-gradient(135deg, var(--cyan), #0891b2));
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(6,182,212,0.4);
}

/* ── 1 Year Access Badge - Psychological Trigger ── */
.cb-access-badge {
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(16,185,129,0.15));
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 8px;
  font-size: 13px;
  color: #a5f3fc;
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(6,182,212,0.15);
  animation: pulse-badge 2s ease-in-out infinite;
}
.cb-access-badge strong {
  color: #22d3ee;
  font-size: 15px;
  text-shadow: 0 0 10px rgba(34,211,238,0.5);
}
/* ── Owned Badge - User already purchased ── */
.cb-owned-badge {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(16,185,129,0.2)) !important;
  border: 1px solid rgba(34,197,94,0.5) !important;
  color: #4ade80 !important;
  animation: pulse-owned 1.5s ease-in-out infinite;
}
.cb-owned-badge strong {
  color: #22c55e !important;
  text-shadow: 0 0 10px rgba(34,197,94,0.5) !important;
}
@keyframes pulse-owned {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(34,197,94,0.2); }
  50% { transform: scale(1.02); box-shadow: 0 6px 16px rgba(34,197,94,0.35); }
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ═══ card-sanpham.php ═══ */
/* ── Sản Phẩm Card ── */
.sp-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.sp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}

/* Thumbnail 4:3 */
.sp-thumb-wrap {
  position: relative;
  padding-top: 75%;
  background: #f1f5f9;
  overflow: hidden;
}
.sp-thumb, .sp-thumb-empty {
  position: absolute;
  inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.sp-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; background: var(--bg-card);
}
.sp-gradient {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  pointer-events: none;
}
.sp-badges-overlay {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 5px; flex-wrap: wrap; z-index: 3;
}
.sp-price-overlay {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 4px; align-items: center; z-index: 3;
}
.sp-type-badge {
  font-size: 10px; font-weight: 700;
  background: rgba(168,85,247,.25); color: #c084fc;
  border: 1px solid rgba(168,85,247,.4);
  padding: 3px 8px; border-radius: 50px;
}

/* Body */
.sp-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; flex: 1;
}
.sp-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.sp-desc {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  margin-bottom: 10px; flex: 1;
}

/* Price */
.sp-price-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}
.sp-price-main { display: flex; align-items: center; gap: 6px; }
.sp-orig {
  font-size: 12px; color: var(--muted);
  text-decoration: line-through;
}
.sp-sale {
  font-size: 18px; font-weight: 800;
  color: var(--cyan);
}
.sp-sold { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Footer */
.sp-footer {
  display: flex; gap: 8px; align-items: center;
}
.sp-buy-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--cta-grad, linear-gradient(135deg, var(--cyan), #0891b2));
  color: #000; border: none; padding: 9px 16px;
  border-radius: 9px; font-size: 13px; font-weight: 700;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(6,182,212,.25);
}
.sp-buy-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(6,182,212,.4);
  color: #000;
}
/* Price overlay badges */
.sp-price-badge {
  font-size: 13px; font-weight: 800;
  background: rgba(0,0,0,.65); color: var(--cyan);
  border: 1px solid rgba(6,182,212,.4);
  padding: 3px 8px; border-radius: 6px;
  backdrop-filter: blur(4px);
}
.sp-disc-badge {
  font-size: 11px; font-weight: 700;
  background: rgba(239,68,68,.75); color: #fff;
  padding: 2px 6px; border-radius: 4px;
}
/* Save button */
.sp-save-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff; border-radius: 8px;
  cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.sp-save-btn:hover { background: rgba(255,255,255,.12); }

/* Cart button */
.sp-cart-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(6,182,212,0.15);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 8px;
  color: var(--cyan);
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.sp-cart-btn:hover {
  background: var(--cyan);
  color: #000;
}

/* ═══ card-tailieu.php ═══ */
/* ── Tài Liệu Card ── */
.tl-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.tl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}

/* Thumbnail 4:3 */
.tl-thumb-wrap {
  position: relative;
  padding-top: 75%; /* 4:3 */
  background: #f1f5f9;
  overflow: hidden;
}
.tl-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder khi không có ảnh */
.tl-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(var(--ft-color-rgb, 239,68,68), .08) 0%,
    var(--bg-card) 100%);
  gap: 8px;
}
.tl-thumb-icon { font-size: 40px; }
.tl-thumb-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Gradient */
.tl-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 100%);
  pointer-events: none;
}

/* Badges */
.tl-badges-overlay {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 5px; flex-wrap: wrap;
  z-index: 3;
}
.tl-status-overlay {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 3;
}
.tl-img-count {
  position: absolute;
  bottom: 8px; left: 10px;
  font-size: 10px;
  color: rgba(255,255,255,.7);
  z-index: 3;
}

/* File Type Badge */
.tl-ft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
  background: color-mix(in srgb, var(--ft-color) 20%, transparent);
  color: var(--ft-color);
  border: 1px solid color-mix(in srgb, var(--ft-color) 40%, transparent);
  letter-spacing: .03em;
}

/* Body */
.tl-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tl-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tl-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tl-cat {
  font-size: 10px;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--cyan-glow);
  padding: 2px 7px;
  border-radius: 50px;
  font-weight: 600;
}
.tl-info {
  font-size: 10px;
  color: var(--muted);
}
.tl-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

/* Footer */
.tl-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.tl-stats {
  font-size: 11px;
  color: var(--muted);
}
.tl-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--cyan);
  color: #000;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .15s;
  font-family: inherit;
}
.tl-dl-btn:hover {
  background: color-mix(in srgb, var(--cyan) 85%, white);
  transform: scale(1.03);
}
.tl-dl-btn:active { transform: scale(.97); }
.tl-dl-btn.loading { opacity: .6; pointer-events: none; }
.tl-dl-icon { font-size: 13px; }

/* ═══ card-video.php ═══ */
/* ── Video Card ── */
.vid-card {
  border-radius: 14px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: transform .22s, box-shadow .22s;
}
.vid-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.vid-v { max-width: 280px; margin: 0 auto; }

/* ── Vùng video — aspect-ratio ── */
.vid-area {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;   /* con trỏ ngón tay khi hover */
}
/* Khi hover trên YouTube: viền sáng nhẹ báo hiệu */
.vid-area[onmouseenter]:hover .vid-thumb {
  filter: brightness(1.08);
  transition: filter .3s;
}

/* Thumbnail */
.vid-thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: filter .3s;
}

/* Drive iframe */
.vid-drive {
  display: block; width: 100%; height: 100%;
  border: none; background: #000;
}

/* Blank */
.vid-blank {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: var(--bg-card);
}

/* Slot iframe YouTube — active khi play */
.vid-slot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 5; background: #000;
  display: none;
}
.vid-slot iframe {
  width: 100%; height: 100%; border: none;
}

/* ── Badges ── */
.vid-tl {
  position: absolute; top: 8px; left: 8px;
  display: flex; gap: 4px; flex-wrap: wrap; z-index: 4;
  pointer-events: none; /* badges không block click */
}
.vid-tr {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  pointer-events: none;
}
.vid-badge-drive {
  font-size: 10px; background: rgba(16,185,129,.22);
  color: #34d399; border: 1px solid rgba(16,185,129,.4);
  border-radius: 6px; padding: 2px 6px; font-weight: 700;
}

/* ── Chip sản phẩm ── */
.vid-sp-chip {
  position: absolute; top: 38px; left: 8px; z-index: 6;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 4px 10px 4px 6px;
  text-decoration: none; color: #fff;
  font-size: 11px; font-weight: 700;
  white-space: nowrap; max-width: calc(100% - 56px); overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.55);
  transition: background .2s;
  pointer-events: auto;  /* chip vẫn bấm được */
}
.vid-sp-chip:hover { background: rgba(0,0,0,.92); }
.vid-sp-ico   { font-size: 13px; flex-shrink: 0; }
.vid-sp-lbl   { overflow: hidden; text-overflow: ellipsis; color: #fff; }
.vid-sp-price {
  flex-shrink: 0; color: #fbbf24; font-size: 10px; font-weight: 800;
  border-left: 1px solid rgba(255,255,255,.2); padding-left: 6px;
}

/* ── Footer ── */
.vid-footer { padding: 10px 13px 12px; }
.vid-title {
  font-size: 13px; font-weight: 600; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}
.vid-title a { color: var(--text); text-decoration: none; }
.vid-title a:hover { color: var(--cyan); }
.vid-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}
.vid-more { color: var(--cyan); text-decoration: none; font-weight: 600; font-size: 11px; }
.vid-more:hover { opacity: .75; }
