/* ==========================================================
   Trang Thuê sở hữu ô tô (Figma 72:738 desktop / 150:1254 mobile)
   Mobile-first: gốc = 390px, @media (min-width:1024px) = 1440px
   ========================================================== */

.d-only { display: none; }
.m-only { display: inline; }

/* ---------- Khung trang ---------- */
.article-page {
  padding-top: 16px;
  padding-bottom: 48px;
}

.article-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 16px;
}

/* ---------- Bài viết ---------- */
.article {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}

.article__intro,
.article__sec {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.article__sec {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.article__date {
  font-size: 14px;
  line-height: 20px;
  color: var(--chu-phu);
}

.article__title {
  font-weight: 700;
  font-size: 26px;
  line-height: 34px;
  color: var(--chu-tieu-de);
}

.article__lead,
.article__sec > p {
  font-size: 16px;
  line-height: 26px;
  color: var(--chu-noi-dung);
}

.article__sec h2 {
  font-weight: 700;
  font-size: 22px;
  line-height: 30px;
  color: var(--chu-tieu-de);
}

.article__sec h3 {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  color: var(--chu-tieu-de);
}

/* Đoạn "Cam kết phát cuốc" (150:1588) dùng line-height 28 cả trên mobile */
.article__sec > p.lh-28 { line-height: 28px; }

.article__sec > p.note {
  font-size: 13px;
  line-height: 20px;
  color: var(--chu-phu);
}

/* Ảnh đại diện */
.article__cover {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  height: 197px;
}
.article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Nhãn "Ảnh tạm" dùng class chung .img-note (base.css) */

/* Mục lục */
.toc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--nen-xam-nhat);
}
.toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  color: var(--chu-tieu-de);
  text-align: left;
}
.toc__head img { transition: transform .2s; }
.toc.is-open .toc__head img { transform: rotate(180deg); }
.toc__title { display: none; }
.toc__list {
  display: none;
  flex-direction: column;
  gap: 8px;
}
.toc.is-open .toc__list { display: flex; }
.toc__list a {
  font-size: 15px;
  line-height: 24px;
  color: var(--xanh-chu);
}
.toc__list a:hover {
  color: var(--xanh-nhan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Danh sách tích xanh */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list li {
  display: flex;
  gap: 12px;
  font-size: 16px;
  line-height: 26px;
  color: var(--chu-noi-dung);
}
/* Dòng chữ mà Montserrat trên trình duyệt rộng hơn Figma <1px → bù để xuống dòng giống Figma */
.fit-figma { letter-spacing: -0.02px; }

.check-list li::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: url(../img/common/icon-check-24.svg) center / 24px 24px no-repeat;
}

/* ---------- Bảng ---------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--duong-ke);
  border-radius: 12px;
  background: var(--nen-trang);
  font-size: 15px;
  line-height: 24px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--duong-ke);
}
.data-table thead th {
  border-top: 0;
  background: var(--nen-xam-nhat);
  font-weight: 600;
  color: var(--chu-tieu-de);
}
.data-table thead th:first-child { border-top-left-radius: 11px; }
.data-table thead th:last-child { border-top-right-radius: 11px; }
.data-table tbody tr:last-child > :first-child { border-bottom-left-radius: 11px; }
.data-table tbody tr:last-child > :last-child { border-bottom-right-radius: 11px; }

.data-table tbody th {
  font-weight: 600;
  color: var(--chu-noi-dung);
}
.data-table tbody td {
  font-weight: 400;
  color: var(--chu-tieu-de);
}
.data-table .is-total td {
  font-weight: 600;
  color: var(--xanh-chu);
}

/* Bảng giá và đặt cọc */
.data-table--price { min-width: 780px; }
.data-table--price th,
.data-table--price td { padding: 12px 14px; }
.data-table--price tr > :first-child { width: 170px; }

/* Bảng giá theo năm */
.data-table--year {
  min-width: 770px;
  font-size: 14px;
}
.data-table--year th,
.data-table--year td { padding: 12px; }
.data-table--year tr > :first-child { width: 190px; }
.data-table--year td.is-hl {
  background: var(--xanh-ngoc-nhat);
  font-weight: 600;
}

/* Bảng đảm bảo thu nhập */
.data-table--income { min-width: 580px; }
.data-table--income tr > :first-child { width: 190px; }

/* Bảng ví dụ chi phí */
.data-table--example tr > :first-child { width: 200px; }

/* Bảng chiết khấu B2B */
.data-table--b2b tr > :first-child { width: 150px; }

/* ---------- Dải kêu gọi giữa bài ---------- */
.cta-band {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--nen-xam-nhat);
}
.cta-band__text {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 2px;
}
@media (max-width: 767.98px) {
  .cta-band { min-height: 226px; }
}
.cta-band__title {
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--chu-tieu-de);
}
.cta-band__desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--chu-noi-dung);
}
.cta-band .btn { width: 100%; }

.article__cta { width: 100%; }

/* ---------- Hỏi đáp theo nhóm ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.faq__tabs {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.faq__tabs::-webkit-scrollbar { display: none; }
.faq__tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--duong-ke);
  border-radius: 8px;
  background: var(--nen-trang);
  font-weight: 600;
  font-size: 14px;
  line-height: 24px;
  color: var(--chu-tieu-de);
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.faq__tab.is-active {
  border: 0;
  background: var(--xanh-thuong-hieu);
  color: var(--nen-trang);
}

.faq__list {
  overflow: hidden;
  border: 1px solid var(--duong-ke);
  border-radius: 12px;
}
.faq__item + .faq__item { border-top: 1px solid var(--duong-ke); }
.faq__q {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  background: var(--nen-trang);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--chu-tieu-de);
  text-align: left;
}
.faq__q span { flex: 1 1 0; min-width: 0; }
.faq__q .i-open { display: none; }
.faq__item.is-open .faq__q .i-closed { display: none; }
.faq__item.is-open .faq__q .i-open { display: block; }
.faq__item.is-open .faq__q { padding-bottom: 8px; }
.faq__a {
  padding: 0 20px 16px;
  font-size: 15px;
  line-height: 24px;
  color: var(--chu-noi-dung);
}

/* ---------- Cột phụ ---------- */
.article-aside {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}

.hotline-box { display: none; }

.side-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.side-block__title {
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: var(--chu-tieu-de);
}

/* Mobile: thẻ kéo ngang */
/* Figma (155:1874): khung kéo ngang bị cắt ở mép cột bài viết, đệm phải 20px */
.side-list {
  display: flex;
  gap: 12px;
  padding-right: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.side-list::-webkit-scrollbar { display: none; }

.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  width: 250px;
  height: 100px;
  padding: 14px 16px;
  /* Figma có nét viền nhưng đang ẩn (150:2161) → giữ chỗ 1px, không hiển thị */
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--nen-trang);
  scroll-snap-align: start;
}
.side-block--posts .side-item {
  width: 260px;
  height: 124px;
}
.side-item__text {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.side-item__text strong {
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  color: var(--chu-tieu-de);
}
/* Trỏ / Nhấn theo "Dòng chính sách" (166:1494 / 166:1501): tiêu đề chuyển xanh */
.side-item:hover .side-item__text strong,
.side-item:focus-visible .side-item__text strong,
.side-item:active .side-item__text strong { color: var(--xanh-chu); }
.side-item__text span {
  font-size: 14px;
  line-height: 20px;
  color: var(--chu-phu);
}

.side-block__more {
  align-self: flex-start;
  padding-top: 12px;
  font-size: 15px;
}
.side-block__more > .m-only { display: inline-flex; }
@media (min-width: 1024px) {
  .side-block__more > .d-only { display: inline-flex; }
  .side-block__more > .m-only { display: none; }
}

/* ---------- Form đăng ký ---------- */
.register {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 20px;
  border-radius: 16px;
  background: var(--nen-xam-nhat);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.register__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.register__eyebrow { display: none; }
.register__title {
  font-weight: 700;
  font-size: 22px;
  line-height: 30px;
  color: var(--chu-tieu-de);
}
.register__desc {
  font-size: 16px;
  line-height: 26px;
  color: var(--chu-noi-dung);
}
.register__desc strong { color: var(--xanh-chu); }

/* Mốc neo theo dòng xe trong bảng giá */
.data-table th[id] { scroll-margin-top: calc(var(--header-h) + 80px); }

/* ==========================================================
   Desktop
   ========================================================== */
@media (min-width: 768px) {
  .cta-band {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .cta-band__text { flex: 1 1 0; min-width: 0; }
  .cta-band .btn { width: auto; flex-shrink: 0; }
  .article__cta { width: auto; align-self: flex-start; }
  .faq__tabs { flex-wrap: wrap; overflow: visible; }
}

@media (min-width: 1024px) {
  .d-only { display: inline; }
  .m-only { display: none; }

  .article-page {
    padding-top: 24px;
    padding-bottom: 96px;
  }
  /* Figma 73:869: mỗi tab rộng số nguyên (chữ hug được làm tròn lên) → giữ đúng vị trí các tab */
  .faq__tab:nth-child(1) { min-width: 149px; }
  .faq__tab:nth-child(2) { min-width: 91px; }
  .faq__tab:nth-child(3) { min-width: 86px; }
  .faq__tab:nth-child(4) { min-width: 186px; }
  .faq__tab:nth-child(5) { min-width: 166px; }
  .faq__tab:nth-child(6) { min-width: 158px; }
  .faq__tab:nth-child(7) { min-width: 143px; }
  .article-layout {
    margin-top: 24px;
    gap: 48px;
  }
  .article { gap: 48px; }

  .article__title {
    font-size: 32px;
    line-height: 40px;
  }
  .article__cover { height: auto; aspect-ratio: 790 / 444; }
  .article__lead,
  .article__sec > p {
    line-height: 28px;
  }
  .article__sec h2 {
    font-size: 24px;
    line-height: 32px;
  }
  .article__sec h3 {
    font-size: 20px;
    line-height: 28px;
  }

  .toc__head { display: none; }
  .toc__title {
    display: block;
    font-weight: 600;
    font-size: 18px;
    line-height: 26px;
    color: var(--chu-tieu-de);
  }
  .toc__list { display: flex; }

  .data-table--price,
  .data-table--year,
  .data-table--income { min-width: 0; }
  .data-table--price tr > :first-child { width: 190px; }
  .data-table--year tr > :first-child { width: 170px; }
  .data-table--income tr > :first-child { width: 270px; }
  .data-table--example tr > :first-child { width: 480px; }
  .data-table--b2b tr > :first-child { width: 300px; }

  /* Cột phụ: danh sách dọc */
  .article-aside { gap: 32px; }
  .hotline-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px;
    border: 1px solid var(--duong-ke);
    border-radius: 16px;
    background: var(--nen-trang);
  }
  .hotline-box__title {
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    color: var(--chu-tieu-de);
  }
  .hotline-box__desc {
    font-size: 14px;
    line-height: 22px;
    color: var(--chu-noi-dung);
  }
  .hotline-box__phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    color: var(--xanh-chu);
    white-space: nowrap;
  }

  .side-block { gap: 4px; }
  .side-list {
    flex-direction: column;
    gap: 4px;
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }
  .side-item,
  .side-block--posts .side-item {
    width: 100%;
    height: auto;
    padding: 14px 0;
    border: 0;
    border-bottom: 1px solid var(--duong-ke);
    border-radius: 0;
    background: none;
  }
  .side-block__more {
    padding-top: 0;
    font-size: 16px;
  }

  .register {
    gap: 32px;
    padding: 48px 40px;
  }
  .register__head {
    align-items: center;
    text-align: center;
  }
  .register__eyebrow {
    display: block;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: var(--vang-nhan-chu);
  }
  .register__title {
    font-size: 24px;
    line-height: 32px;
  }
  .register__form { gap: 24px; }
}

/* Hai cột khi đủ chỗ (khung 1200px: 790 + 48 + 362) */
@media (min-width: 1200px) {
  .article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 362px;
    grid-template-areas:
      "art side"
      "form side";
    align-items: start;
    column-gap: 48px;
    row-gap: 48px;
  }
  .article { grid-area: art; }
  .article-aside { grid-area: side; }
  .register { grid-area: form; }
}
