/* ==========================================================================
   TyAuto — Đọc đúng sách cho đúng nghề: Bảng kiểu dáng giao diện
   Thông điệp: "Đọc đúng sách cho đúng nghề."
   Hệ thống 7 nhóm ngành nghề & 5 yếu tố thực tế
   ========================================================================== */

/* Phông chữ được nạp bằng <link> trong <head> để không chặn render thêm một vòng. */

:root {
  /* Bề mặt & Nền giấy */
  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f4efe8;
  --bg-surface-elevated: #ffffff;
  
  /* Màu chữ & Mực in */
  --text-primary: #1c1917;   /* Stone 900 */
  --text-secondary: #44403c; /* Stone 700 */
  --text-muted: #78716c;     /* Stone 500 */
  --text-inverse: #ffffff;

  /* Đường viền */
  --border-color: #e7e2da;
  --border-subtle: #f0ebe4;
  --border-focus: #c2410c;

  /* Màu nhấn thương hiệu TyAuto */
  --accent-lab: #c2410c;         /* Màu cam gạch nung */
  --accent-lab-light: #fff7ed;
  --accent-lab-border: #fed7aa;
  --accent-teal: #0f766e;        /* Màu xanh mòng két */
  --accent-teal-light: #f0fdfa;

  /* Màu sắc sàn thương mại */
  --shopee-color: #ee4d2d;
  --shopee-hover: #d73211;
  --tiki-color: #1a94ff;
  --tiki-hover: #0d7ce0;

  --gold-star: #d97706;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --warning-bg: #fefce8;
  --skip-bg: #fafaf9;
  --skip-text: #57534e;

  /* Đổ bóng */
  --shadow-sm: 0 1px 2px 0 rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(28, 25, 23, 0.06), 0 2px 4px -2px rgba(28, 25, 23, 0.03);
  --shadow-lg: 0 12px 20px -4px rgba(28, 25, 23, 0.07), 0 4px 6px -4px rgba(28, 25, 23, 0.03);
  --book-shadow: 3px 6px 18px rgba(28, 25, 23, 0.12), 1px 2px 4px rgba(28, 25, 23, 0.06);

  /* Phông chữ */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Bo góc */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --container-max: 1160px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Thiết lập cơ bản
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Thanh đo tiến trình đọc */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-lab);
  width: 0%;
  z-index: 1001;
  transition: width 0.1s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --------------------------------------------------------------------------
   Thanh đầu trang
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
}

.brand-logo-text {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.brand-name {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-tagline-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  position: relative;
  padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-lab);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-wishlist-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-wishlist-toggle:hover {
  border-color: var(--accent-lab);
  color: var(--accent-lab);
  background: var(--accent-lab-light);
}

.wishlist-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--accent-lab);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Phần giới thiệu đầu trang (Hero)
   -------------------------------------------------------------------------- */
.hero-section {
  background: var(--bg-page);
  padding: 3.5rem 0 2rem;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero-lab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-lab);
  background: var(--accent-lab-light);
  border: 1px solid var(--accent-lab-border);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.15rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.85rem;
  line-height: 1.18;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.15rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   BỘ ĐIỀU HƯỚNG TÌM SÁCH THEO 7 NHÓM NGHỀ
   -------------------------------------------------------------------------- */
.finder-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
  margin: 0 auto 3rem;
  max-width: 980px;
}

.finder-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.finder-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.finder-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finder-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.finder-label-num {
  width: 20px;
  height: 20px;
  background: var(--accent-lab-light);
  color: var(--accent-lab);
  border: 1px solid var(--accent-lab-border);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Thanh nút chọn 7 nhóm nghề (Step 1) */
.role-pills-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.role-pill-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.role-pill-btn:hover {
  border-color: var(--accent-lab);
  color: var(--accent-lab);
  background: var(--accent-lab-light);
}

.role-pill-btn.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

/* Ô chọn vấn đề & tìm kiếm */
.finder-controls-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.finder-select {
  width: 100%;
  appearance: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 2rem 0.6rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finder-select:focus {
  outline: none;
  border-color: var(--accent-lab);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.1);
}

.finder-search-inline {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
}

.finder-search-inline input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.86rem;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Danh mục sách & Thẻ sách
   -------------------------------------------------------------------------- */
.catalog-section {
  padding: 1rem 0 5rem;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title-wrap h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title-wrap p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.75rem;
}

.book-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d6cfc4;
}

.card-header-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card-role-badges-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.card-role-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--accent-lab);
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

.card-main {
  display: flex;
  gap: 1.15rem;
  padding: 1.25rem 1.25rem 0.85rem;
}

.card-cover-wrap {
  width: 92px;
  height: 136px;
  flex-shrink: 0;
  position: relative;
  perspective: 600px;
}

.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--book-shadow);
  transition: transform var(--transition-normal);
}

.book-card:hover .cover {
  transform: rotateY(-5deg) scale(1.02);
}

.cover-placeholder {
  background: linear-gradient(135deg, #78716c 0%, #44403c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
}

.card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a:hover {
  color: var(--accent-lab);
}

.card-author {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.card-tagline {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}

/* Khung tóm tắt 3 dòng nhanh của thẻ sách (Field Note Box) */
.card-note-box {
  padding: 0.85rem 1.25rem;
  background: #fdfbf7;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.card-summary-row {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
}

.card-summary-label {
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.card-footer {
  padding: 0.85rem 1.25rem 1.15rem;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-detail-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-lab);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-detail-link:hover {
  text-decoration: underline;
}

.btn-bookmark-card {
  background: none;
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-bookmark-card:hover, .btn-bookmark-card.active {
  border-color: #f87171;
  color: #ef4444;
  background: #fef2f2;
}

.btn-bookmark-card.active svg {
  fill: #ef4444;
}

/* --------------------------------------------------------------------------
   Nút liên kết sàn thương mại
   -------------------------------------------------------------------------- */
.affiliate-buttons {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  flex: 1;
}

.btn-shopee {
  background-color: var(--shopee-color);
  color: #ffffff;
}

.btn-shopee:hover {
  background-color: var(--shopee-hover);
  color: #ffffff;
}

.btn-tiki {
  background-color: var(--tiki-color);
  color: #ffffff;
}

.btn-tiki:hover {
  background-color: var(--tiki-hover);
  color: #ffffff;
}

.badge-no-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-surface-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Trang chi tiết sách (5 Khối thông tin thực tế)
   -------------------------------------------------------------------------- */
.detail-page-wrapper {
  padding: 1.5rem 0 5rem;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
  color: var(--accent-lab);
}

.breadcrumb-separator {
  font-size: 0.7rem;
}

.book-detail-hero {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.detail-cover-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-cover-frame {
  width: 100%;
  aspect-ratio: 2/3;
  position: relative;
  perspective: 1000px;
}

.detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--book-shadow);
}

.detail-buy-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.buy-box-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.buy-box-guarantee {
  font-size: 0.72rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
}

.detail-content-col {
  display: flex;
  flex-direction: column;
}

.detail-meta-pill-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.lab-meta-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.detail-author {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.detail-tagline-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--accent-lab);
  background: var(--accent-lab-light);
  border-left: 3px solid var(--accent-lab);
  padding: 0.85rem 1.15rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.75rem;
}

/* Các khối phân tích chi tiết */
.detail-deep-dive {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.lab-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.lab-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.lab-section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-lab);
  background: var(--accent-lab-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.lab-section-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lab-section-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* Khối Nên đọc khi nào */
.when-to-read-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #78350f;
}

/* Khối Có thể áp dụng vào công việc nào */
.applicable-jobs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.applicable-job-item {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #115e59;
}

/* Khối Ai chưa cần đọc */
.who-should-skip-box {
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #57534e;
}

/* --------------------------------------------------------------------------
   Chân trang
   -------------------------------------------------------------------------- */
.site-footer {
  background: #1c1917;
  color: #a8a29e;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #292524;
}

.footer-brand h3 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  max-width: 420px;
}

.footer-disclosure-note {
  background: #292524;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: #d6d3d1;
  margin-top: 1.5rem;
  border-left: 2px solid var(--accent-lab);
}

.footer-col h4 {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Thanh mua hàng cố định trên điện thoại
   -------------------------------------------------------------------------- */
.mobile-sticky-buy-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(12px);
  padding: 0.65rem 1.15rem;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(28, 25, 23, 0.06);
  z-index: 99;
}

/* --------------------------------------------------------------------------
   Trạng thái rỗng & Thông báo lỗi
   -------------------------------------------------------------------------- */
.empty-state-box {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Thông báo Toast
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1c1917;
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Đáp ứng kích thước màn hình (Responsive)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .book-detail-hero {
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .finder-controls-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 2.15rem;
  }

  .finder-container {
    padding: 1.25rem 1.15rem;
  }

  .finder-controls-row {
    grid-template-columns: 1fr;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .book-detail-hero {
    grid-template-columns: 1fr;
    padding: 1.35rem;
  }

  .detail-cover-col {
    max-width: 180px;
    margin: 0 auto;
  }

  .detail-title {
    font-size: 1.85rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .mobile-sticky-buy-bar {
    display: block;
  }
}

/* ==========================================================================
   BỔ SUNG & HIỆU CHỈNH — kiến trúc trang tĩnh (public/)
   Đặt ở cuối file để ghi đè các quy tắc phía trên khi cần.
   ========================================================================== */

:root {
  --icon-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Truy cập bằng bàn phím
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--text-primary);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
  font-size: 0.9rem;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.finder-search-inline:focus-within {
  border-color: var(--accent-lab);
  box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Vùng bấm tối thiểu 44px trên thiết bị cảm ứng
   -------------------------------------------------------------------------- */
.btn,
.role-pill-btn,
.btn-wishlist-toggle,
.btn-detail-link,
.btn-search-clear,
.btn-bookmark-card {
  min-height: 44px;
}

.btn-detail-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0;
}

.btn-bookmark-card {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.btn-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 0.35rem;
  min-width: 44px;
}
.btn-search-clear[hidden] {
  display: none;
}

.btn-wishlist-toggle.active {
  border-color: var(--accent-lab-border);
  background: var(--accent-lab-light);
  color: var(--accent-lab);
}

.btn-wishlist-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--icon-heart) center / contain no-repeat;
  mask: var(--icon-heart) center / contain no-repeat;
}

.btn-bookmark-card::before {
  content: "";
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--icon-heart) center / contain no-repeat;
  mask: var(--icon-heart) center / contain no-repeat;
}
.btn-bookmark-card.active {
  color: var(--accent-lab);
  border-color: var(--accent-lab-border);
  background: var(--accent-lab-light);
}

.wishlist-counter[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Nút chung
   -------------------------------------------------------------------------- */
.btn-primary {
  background: var(--text-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #000;
}
.btn-inline {
  flex: 0 0 auto;
  display: inline-flex;
  max-width: 260px;
  margin: 1rem auto 0;
  padding-left: 1.4rem;
  padding-right: 1.4rem;
  text-decoration: none;
}
.btn-back-link {
  text-decoration: none;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Bìa chữ — dùng khi chưa có ảnh bìa thật
   -------------------------------------------------------------------------- */
.cover-typo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.75rem 0.75rem 1.05rem;
  background: linear-gradient(160deg, #2c2724 0%, #443c36 55%, #2c2724 100%);
  color: #f6f1e9;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.cover-typo-spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--accent-lab) 0%, #7c2d12 100%);
}
.cover-typo-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-typo-author {
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  color: rgba(246, 241, 233, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-typo-mark {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 241, 233, 0.45);
}
.detail-cover-img.cover-typo {
  padding: 1.75rem 1.4rem 1.4rem 2rem;
  gap: 0.6rem;
}
.detail-cover-img.cover-typo .cover-typo-title {
  font-size: 1.5rem;
  -webkit-line-clamp: 7;
}
.detail-cover-img.cover-typo .cover-typo-author {
  font-size: 0.85rem;
}
.detail-cover-img.cover-typo .cover-typo-mark {
  font-size: 0.68rem;
}
.detail-cover-img.cover-typo .cover-typo-spine {
  width: 12px;
}

/* --------------------------------------------------------------------------
   Thẻ sách
   -------------------------------------------------------------------------- */
.card-reading-time {
  white-space: nowrap;
  flex-shrink: 0;
}
.card-role-lead {
  color: var(--accent-lab);
  font-weight: 700;
}
.book-card--compact .card-tagline {
  -webkit-line-clamp: 3;
  font-style: normal;
}
.noscript-book-list {
  text-align: left;
  margin: 1rem auto 0;
  max-width: 520px;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.9;
}

/* --------------------------------------------------------------------------
   Trạng thái rỗng & lỗi
   -------------------------------------------------------------------------- */
.error-box {
  text-align: left;
  font-weight: 500;
  grid-column: 1 / -1;
}
.error-box-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.error-box .btn-inline {
  margin-left: 0;
  background: #991b1b;
}

/* --------------------------------------------------------------------------
   Khối "Cách TyAuto chọn sách"
   -------------------------------------------------------------------------- */
.manifesto-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 3.5rem 0;
}
.manifesto-intro {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.manifesto-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.manifesto-card p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.manifesto-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.manifesto-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.manifesto-kicker--lab { color: var(--accent-lab); }
.manifesto-kicker--teal { color: var(--accent-teal); }
.manifesto-kicker--muted { color: var(--text-muted); }
.manifesto-kicker--violet { color: #7e22ce; }

.manifesto-honesty {
  margin-top: 1.75rem;
  padding: 1.35rem 1.5rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-page);
}
.manifesto-honesty ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

/* --------------------------------------------------------------------------
   Trang chi tiết — các khối nội dung
   -------------------------------------------------------------------------- */
.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  /* Không dùng margin-top:auto: cột ảnh bìa cao hơn cột chữ nên nút bị đẩy
     xuống tận đáy, để lại gần 400px khoảng trắng ngay giữa trang. */
  margin-top: 1.75rem;
  flex-wrap: wrap;
}
.lab-meta-badge--role {
  color: var(--accent-lab);
  font-weight: 700;
}
.detail-subblock {
  margin-bottom: 1.15rem;
}
.detail-role-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.problem-solved-box {
  background: var(--accent-lab-light);
  border: 1px solid var(--accent-lab-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.15rem;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #7c2d12;
}
.problem-solved-label,
.tyauto-note-label,
.workflow-box-label,
.limitations-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}
.who-should-read-list {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.93rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.tyauto-note-box {
  border-left: 3px solid var(--accent-lab);
  padding: 0.15rem 0 0.15rem 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.tyauto-note-hint {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}
.workflow-box {
  margin-top: 1.1rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.limitations-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.lab-section-tag--amber { background: #fef3c7; color: #92400e; }
.lab-section-tag--teal { background: #ccfbf1; color: #0f766e; }
.lab-section-tag--muted { background: #fafaf9; color: #57534e; }
.lab-section-card--teal { border-color: #99f6e4; }

.related-section {
  margin-top: 4rem;
}
.related-section .section-title-wrap {
  margin-bottom: 1.75rem;
}

/* --------------------------------------------------------------------------
   Hộp mua sách
   -------------------------------------------------------------------------- */
.buy-box-state {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.15rem;
}
.buy-box-state--ready {
  color: var(--text-muted);
}
.buy-box-note {
  font-size: 0.73rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.6rem;
  margin-top: 0.2rem;
}
.badge-no-link {
  text-align: center;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Thanh mua cố định trên điện thoại
   -------------------------------------------------------------------------- */
.mobile-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.mobile-bar-text {
  flex: 1;
  min-width: 0;
}
.mobile-bar-title {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.mobile-bar-author {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-bar-buttons {
  flex-shrink: 0;
  max-width: 55%;
}

/* --------------------------------------------------------------------------
   Chân trang
   -------------------------------------------------------------------------- */
.footer-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.footer-col-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}
.footer-disclosure-note {
  font-size: 0.8rem;
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Trước đây thanh điều hướng bị ẩn hẳn và không có gì thay thế. */
  .nav-links {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    white-space: nowrap;
    font-size: 0.82rem;
  }
  .header-inner {
    flex-wrap: wrap;
    row-gap: 0.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .header-inner nav {
    order: 3;
    width: 100%;
  }
  .brand-tagline-sub {
    display: none;
  }
  /* Chừa chỗ cho thanh mua cố định, tránh che mất cuối chân trang. */
  body:has(.mobile-sticky-buy-bar) .site-footer {
    padding-bottom: 7rem;
  }
  .mobile-bar-buttons .affiliate-buttons {
    flex-direction: column;
    gap: 0.3rem;
  }
  .mobile-bar-buttons .btn {
    min-height: 38px;
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
  }
}

@media (max-width: 420px) {
  .manifesto-grid {
    grid-template-columns: 1fr;
  }
  .card-action-row {
    gap: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   Ô tìm kiếm và ô chọn — ba class này được HTML dùng nhưng chưa từng có quy tắc
   nào, khiến icon kính lúp giãn full chiều rộng và mũi tên select rơi xuống dưới.
   -------------------------------------------------------------------------- */
.hero-search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.select-wrapper {
  position: relative;
  display: block;
}

.select-wrapper .finder-select {
  width: 100%;
}

.select-arrow {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.6rem;
  line-height: 1;
  color: var(--text-muted);
}

.finder-search-inline {
  gap: 0.5rem;
}
