:root {
  --teal: #0e5258;
  --teal-dark: #093b40;
  --teal-soft: #eef6f6;
  --cream: #fdf3d7;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --price: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header tối giản */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 12px;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--teal);
}
.brand-text { display: flex; flex-direction: column; }
.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-header {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: 0.2s;
  border: 1px solid var(--teal);
  color: var(--teal);
  background: var(--surface);
  white-space: nowrap;
}
.btn-header:hover {
  background: var(--teal);
  color: #fff;
}
.btn-header.primary {
  background: var(--teal);
  color: #fff;
}
.btn-header.primary:hover {
  background: var(--teal-dark);
}

/* Khu vực tiêu đề & tìm kiếm */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 24px;
}
.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumb a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover { text-decoration: underline; }
.hero-pill {
  display: inline-block;
  background: var(--cream);
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.hero h1 {
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.hero p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 18px;
}
.search-bar {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 3px 14px;
  transition: border-color 0.2s;
}
.search-bar:focus-within {
  border-color: var(--teal);
  background: #fff;
}
.search-bar input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  padding: 9px 6px;
  font-size: 0.94rem;
  color: var(--text);
}

/* Khung bộ lọc 3 tầng: Môn (Link SEO) - Danh mục - Khối */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filter-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: start;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.filter-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-top: 6px;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: #fff;
}
.chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  font-weight: 600;
}

/* Thanh trạng thái kết quả */
.result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0 12px;
  font-size: 0.86rem;
  color: var(--muted);
}
.reset-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: 0.15s;
}
.reset-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

/* Danh sách tài liệu */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}
.doc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.doc-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(14, 82, 88, 0.06);
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}
.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
}
.tag.subject {
  background: var(--cream);
  color: var(--teal);
  font-weight: 700;
}
.tag.grade {
  background: #f4f4f5;
  color: #3f3f46;
}
.tag.word {
  background: #eff6ff;
  color: #1d4ed8;
}
.doc-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.doc-desc {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 690px;
}

.doc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 215px;
}
.price-box { text-align: right; }
.price-now {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--price);
}
.price-now.free { color: var(--teal); }
.price-old {
  font-size: 0.84rem;
  color: #a1a1aa;
  text-decoration: line-through;
  margin-left: 6px;
}
.btn-group {
  display: flex;
  gap: 8px;
  width: 100%;
}
.btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: 0.15s;
}
.btn-drive {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-drive:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}
.btn-order {
  background: var(--teal);
  color: #fff;
}
.btn-order:hover { background: var(--teal-dark); }

/* Khối nội dung tĩnh chuẩn SEO cho từng trang */
.seo-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.seo-col h3 {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 6px;
}
.seo-col p {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Điều hướng liên kết nội bộ các môn ở chân trang */
.subject-directory {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 40px;
}
.subject-directory h4 {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.dir-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.dir-links a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.dir-links a:hover {
  color: var(--teal);
  text-decoration: underline;
}

/* Modal Đặt mua liên hệ SĐT 0877430084 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 59, 64, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  padding: 26px;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
}
.close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}
.modal-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--cream);
  color: var(--teal);
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.modal-card h2 {
  font-size: 1.12rem;
  line-height: 1.4;
  margin-bottom: 6px;
}
.modal-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--price);
  margin-bottom: 14px;
}
.order-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.order-box p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.phone-highlight {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.order-code-box {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.84rem;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.copy-btn {
  border: 1px solid var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover {
  background: var(--teal);
  color: #fff;
}
.modal-cta {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.btn-full {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 9px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}
.btn-call {
  background: var(--teal);
  color: #fff;
}
.btn-call:hover { background: var(--teal-dark); }
.btn-zalo {
  background: var(--cream);
  color: var(--teal);
  border: 1px solid #e6d5a7;
}
.btn-zalo:hover {
  background: #f9e8b8;
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 26px 0;
  font-size: 0.86rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-phone {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 720px) {
  .filter-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .filter-label { padding-top: 0; }
  .doc-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .doc-right {
    align-items: flex-start;
    width: 100%;
  }
  .price-box { text-align: left; }
  .btn-header.hide-mobile { display: none; }
}