/* =========================================================================
   showcase.css — KHOI "TUNG CONG CU" (tab trai, anh phai)
   ========================================================================= */

.showcase {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
}

/* ── Cot tab ─────────────────────────────────────────────── */
.tabs {
  display: grid;
  gap: 8px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.tab {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              transform var(--dur) var(--ease-out);
}
.tab:hover { transform: translateX(4px); border-color: var(--border-strong); }
.tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(4px);
}
.tab__ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-3);
  color: var(--accent);
  transition: background-color var(--dur) var(--ease);
}
.tab.is-active .tab__ico { background: var(--card); }

/* Bieu tuong la ANH RIENG (quan tri tai len) chu khong phai hinh ve san:
   co ve dung o vuong, khong day vo the tab du anh to. */
.tab__ico img { width: 22px; height: 22px; object-fit: contain; display: block; }
.tab__t { font-weight: 700; font-size: .96rem; line-height: 1.3; }
.tab__d { font-size: var(--fs-xs); color: var(--text-muted); }
.tab.is-active .tab__d { color: var(--accent); }

/* ── Khung ben phai ─────────────────────────────────────── */
.panes { position: relative; }

.pane {
  display: none;
  animation: pane-in .45s var(--ease-out) both;
}
.pane.is-active { display: block; }

@keyframes pane-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.pane__head { margin-bottom: 18px; }
.pane__head h3 { margin-bottom: .25em; font-size: 1.35rem; }
.pane__head p  { color: var(--text-muted); margin: 0; }

.pane__body { display: grid; gap: 20px; }
.pane__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pane__list li {
  display: flex; gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
}
.pane__list li svg { flex: none; margin-top: 4px; color: var(--accent); }

@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; }
  /* Tren dien thoai cho tab chay ngang, vuot duoc. */
  .tabs {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 1fr);
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
  }
  .tab { scroll-snap-align: start; }
  .tab:hover, .tab.is-active { transform: none; }
}

/* ── Ô tải cạnh tên License ─────────────────────────────────────────────
   Bản quyền và file cài là MỘT, nên mỗi khối .lic có đúng MỘT ô tải
   [data-get-product] nằm cùng hàng với tên. home/home.js đổ vào: tổng
   lượt tải → ô chọn phiên bản → nút Tải về. */
.lic__get {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  align-content: start;
  flex: 0 0 auto;
  width: 230px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--sh-sm);
}

/* Không tìm thấy mã sản phẩm thì home.js để trống — đừng chừa lại cái
   khung rỗng. */
.lic__get:empty { display: none; }

.lic__get .pane__dl {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  color: var(--text-faint);
  white-space: nowrap;
}

.lic__get .prod__ver { width: 100%; min-width: 0; }
.lic__get .btn { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════
   KHỐI BẢN QUYỀN (.lic) — Auto Library và Auto Tool

   Trang giới thiệu theo HAI BẢN QUYỀN, mỗi khối một bộ tab riêng
   ([data-tabs]). Inventor Tool không có khối vì nó chỉ là cầu nối miễn phí.
   ═══════════════════════════════════════════════════════════════════════ */

.lic {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px dashed var(--border-strong);
}

/* Dau khoi: chu ben trai, o tai ben phai — CUNG HANG voi ten License. */
.lic__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 32px);
  margin-bottom: clamp(20px, 3vw, 30px);
}

.lic__head-txt { max-width: 70ch; min-width: 0; }

/* Nhãn "Bản quyền 1/2": chữ mono trên nền vàng nhạt — đánh dấu đây là thứ
   BÁN THEO GIẤY PHÉP, khác các khối giới thiệu thường. */
.lic__no {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lic__head h3 {
  margin: 10px 0 8px;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
}

.lic__head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.lic__head b { color: var(--accent); }

/* Dòng "hàng trăm tiện ích miễn phí" — một dải nhấn nhẹ dưới khối Auto
   Tool, không phải thẻ to (nó là ghi chú thêm, không phải tính năng thứ 6). */
.lic__free {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 75ch;
  margin: clamp(18px, 3vw, 26px) 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--accent-solid);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.lic__free svg { flex: none; margin-top: 2px; color: var(--accent); }
.lic__free b { color: var(--accent); }

@media (max-width: 640px) {
  .lic { margin-top: 30px; padding-top: 24px; }
}

/* Nhãn "Nền tảng · Miễn phí" của khối Inventor Tool: xanh thay vì vàng —
   để phân biệt ngay với hai khối BÁN bản quyền bên dưới. */
.lic__no--free {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}

/* Khối đầu tiên không cần đường kẻ phía trên (nó đứng ngay dưới tiêu đề). */
.lic--first { border-top: 0; padding-top: 0; }

/* Ba gạch giới thiệu của khối Inventor Tool. */
.lic__ticks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 75ch;
}

.lic__ticks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.lic__ticks svg { flex: none; margin-top: 3px; color: var(--ok); }
.lic__ticks b { color: var(--text); }

/* ── Màn hình hẹp: ô tải xuống dưới chữ, giãn hết bề ngang ── */
@media (max-width: 700px) {
  .lic__head { flex-direction: column; }
  .lic__get { width: 100%; }
}

/* ── Video / dải ảnh trong pane (nội dung từ CSDL) ────────────────────── */
.pane__video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.pane__video iframe,
.pane__video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.pane__strip {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pane__thumb {
  flex: none;
  width: 84px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}

.pane__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pane__thumb.is-on { border-color: var(--accent-solid); }

@media (max-width: 640px) {
  .pane__thumb { width: 72px; height: 48px; }
}

/* Nút ▶ Video trong dải chuyển — cùng cỡ với ảnh nhỏ. */
.pane__thumb--vid {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
}

/* Mô tả (license lẫn tính năng): TÔN TRỌNG XUỐNG DÒNG mà quản trị gõ trong
   admin-content — không có dòng này thì mọi \n dính thành một khối chữ.
   pre-line: giữ xuống dòng, vẫn tự bọc chữ theo bề ngang. */
.pane__desc { white-space: pre-line; }

/* ── Mô tả tính năng dài: cắt 4 dòng + Xem thêm ─────────────────────────
   Cắt để khung media không bị đẩy tụt xuống khi quản trị viết mô tả dài;
   ai muốn đọc hết thì bấm. */
.pane__desc--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pane__desc--clamp.is-open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.pane__more {
  margin-top: 4px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pane__more:hover { color: var(--accent-hover); }

@media (hover: none) {
  .pane__more { min-height: 40px; }   /* vua ngon tay */
}

/* ── Giới hạn mô tả LICENSE: 3 dòng (tính năng: 4 dòng ở trên) ────────── */
.lic__desc--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lic__desc--clamp.is-open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Nút "+ n tính năng nữa" cuối cột tab — trông như tab nhưng nét đứt,
   canh giữa, để không lẫn với tính năng thật. */
.tab--more {
  justify-content: center;
  border-style: dashed !important;
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-sm);
}
