/* =========================================================================
   products/products.css — TRANG TAI PHAN MEM

   Chi chua thu RIENG cua trang nay. Khung the san pham (.prod, .prod__ver…)
   dung chung voi trang chu — nam o ../home/home.css, trang nay nap tep do
   truoc roi moi nap tep nay de de len.
   ========================================================================= */

/* ── Dau trang ──────────────────────────────────────────── */
.pghead {
  position: relative;
  padding: calc(var(--nav-h) + clamp(40px, 6vw, 76px)) 0 clamp(32px, 5vw, 56px);
  overflow: hidden;
}

.pghead h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin: 10px 0 14px;
}

.pghead__lead {
  max-width: 62ch;
  color: var(--text-muted);
  font-size: var(--fs-lead);
  line-height: 1.65;
}

.pghead__note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.pghead__note a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Thanh tim ──────────────────────────────────────────── */
.prodbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 280px;
  min-width: 0;                 /* khong co dong nay o hep se tran ngang */
  max-width: 420px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-faint);
  transition: border-color .15s, box-shadow .15s;
}

.searchbox:focus-within {
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--accent);
}

.searchbox input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  outline: none;
}

/* Nut xoa mac dinh cua Chrome tren <input type=search> lech mau o nen toi. */
.searchbox input::-webkit-search-cancel-button {
  filter: grayscale(1) opacity(.55);
  cursor: pointer;
}

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

/* ── The san pham ban day du ────────────────────────────── */
/* Trang chu de vua ba cot cho gon; o day it san pham nhung nhieu chu hon
   (ghi chu phat hanh), nen the rong hon mot chut cho de doc. */
.prods--page {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.prod--full { scroll-margin-top: calc(var(--nav-h) + 20px); }

.prod__title { min-width: 0; }   /* ten dai thi cat trong o, khong day the rong ra */

/* Ghi chu phat hanh cua ban DANG CHON, doi theo o chon phien ban. */
.prod__note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

.prod__note:empty { display: none; padding: 0; border: 0; }

.prod__note-dl {
  font-family: var(--font-mono);
  letter-spacing: .04em;
  color: var(--text-faint);
}

/* Vao bang dia chi /products/#AUTOTOOL: nhay mot cai cho biet la the nao. */
.prod--hi {
  border-color: var(--accent-solid);
  box-shadow: var(--sh-glow);
}

/* ── Ba buoc cai dat ────────────────────────────────────── */
.step__num {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--accent-solid);
  color: var(--accent-fg);       /* graphite tren nen vang — doc duoc ca hai giao dien */
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .9rem;
}

.steps { list-style: none; padding: 0; margin: 0; }
.steps .step { padding: 22px; }
.steps h3 { font-size: 1.02rem; margin: 0 0 6px; }
.steps p  { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.6; }
.steps a  { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }


/* ── "Xem thêm" cho mô tả bị cắt ────────────────────────────
   .prod__desc cắt còn 3 dòng (xem ../home/home.css) cho các thẻ cao bằng
   nhau. Mô tả của Inventor Tool dài gấp mấy lần thẻ nên phải có đường đọc
   tiếp — bỏ cắt bằng cách trả display về block. */
.prod__desc.is-open {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.prod__more {
  justify-self: start;          /* the la luoi: khong co dong nay nut keo dai ca hang */
  margin-top: -6px;             /* keo sat vao doan mo ta, dung roi ra nhu mot muc rieng */
  padding: 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;
}

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

/* ── Chuyển trang ───────────────────────────────────────── */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: clamp(24px, 3vw, 36px);
}

.pager:empty { display: none; }   /* mot trang thi khong chua khoang trong */

.page-btn {
  min-width: 40px;
  height: 40px;                  /* 40px: vua tam ngon tay tren dien thoai */
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent-solid);
  color: var(--accent);
}

.page-btn.is-active {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--accent-fg);       /* graphite tren vang — chu trang khong doc duoc */
}

.page-btn:disabled {
  opacity: .4;
  cursor: default;
}

.pager__gap {
  min-width: 24px;
  text-align: center;
  color: var(--text-faint);
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════
   MÁY TÍNH BẢNG (≤ 1024px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

  /* ⚠ 16px, KHÔNG phải var(--fs-sm).
     shared/css/mobile.css đã có luật `input, select, textarea { font-size:
     16px }` chống iOS tự phóng to, NHƯNG luật đó chọn bằng TÊN THẺ nên thua
     `.prod__ver` và `.searchbox input` (chọn bằng lớp) về độ ưu tiên — dù
     nạp sau vẫn thua. Không viết lại ở đây thì bấm vào ô chọn phiên bản
     trên iPhone là Safari phóng to trang và KHÔNG tự thu lại. */
  .searchbox input { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   ĐIỆN THOẠI (≤ 640px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  .pghead { padding-top: calc(var(--nav-h) + 28px); }

  /* Thanh tìm: ô tìm chiếm nguyên hàng, số đếm xuống dòng dưới. */
  .prodbar { gap: 10px; }
  .searchbox { max-width: none; }
  .prodbar__count { width: 100%; }

  /* Ô chọn phiên bản và nút Tải mỗi thứ một hàng — để cạnh nhau thì tên bản
     ("Version Inventor 2024 · 26.3 MB") bị cắt cụt không đọc được. */
  .prod__foot { flex-direction: column; align-items: stretch; }
  .prod__foot .prod__ver { width: 100%; }

  .pager { gap: 4px; }
  .page-btn { min-width: 44px; height: 44px; padding: 0 8px; }
}

/* ── Máy cảm ứng (không phân biệt bề ngang) ─────────────────
   Chữ gạch chân cỡ nhỏ là đủ để bấm bằng chuột, nhưng ngón tay thì không.
   Nới vùng bấm ra 44px mà không làm chữ to lên. */
@media (hover: none) {
  .prod__more {
    padding: 10px 0;
    margin-top: -10px;
    min-height: 44px;
  }
  .page-btn { min-width: 44px; height: 44px; }
}
