/* ==========================================================================
   Lộc Phát — SHARED page components (dùng chung nhiều trang)
   MOBILE-FIRST. Base = mobile; @media (min-width:860px) = desktop.
   Gồm: section helpers, product card, commitment strip, CTA band,
        chrome mobile (bottom bar, drawer, speed-dial).
   ========================================================================== */

/* ---- Section helpers -------------------------------------------------- */
.section { max-width: 520px; margin: 0 auto; padding: 26px 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; color: var(--text-primary); text-transform: uppercase; letter-spacing: .02em; }
.section-head p { color: var(--text-secondary); margin-top: 6px; text-transform: none; font-size: 12px; }
.section-title-c { text-align: center; max-width: 640px; margin: 0 auto 18px; }
.section-title-c h2 { font-size: 18px; color: var(--text-primary); margin-top: 10px; }
.section-title-c p { color: var(--text-secondary); margin-top: 8px; text-transform: none; font-size: 12.5px; line-height: 1.55; }
.link-all { color: var(--color-primary); font-family: var(--font-display); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.link-all i { font-size: .82em; margin-left: 6px; transform: rotate(45deg); }
.band-dark { position: relative; background: var(--gray-900); overflow: hidden; }
.band-sunken { background: var(--surface-sunken); }
.diag-lines { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 12px, transparent 12px 24px); }

/* ---- Commitment strip ------------------------------------------------- */
.commit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.commit-item { display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.commit-item .ic { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-primary-subtle); display: flex; align-items: center; justify-content: center; }
.commit-item .ic i { color: var(--color-primary); font-size: 16px; }
.commit-item .tx { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }

/* ---- Product card (placeholder-image variant) ------------------------- */
.prod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.prod { display: flex; flex-direction: column; background: var(--surface-card); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-xs); border: 1px solid var(--border-default); transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard); }
.prod:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.prod__media { position: relative; aspect-ratio: 1/1; background: repeating-linear-gradient(45deg, var(--gray-100) 0 10px, var(--gray-50) 10px 20px); display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; color: var(--gray-400); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.prod__badge { position: absolute; top: 6px; left: 6px; background: var(--color-accent); color: #fff; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-full); }
.prod__body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.prod__cat { font-size: 9.5px; color: var(--color-primary); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.prod__name { font-size: 11.5px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-primary); line-height: 1.3; min-height: 30px; }
.prod__stars { font-size: 10px; color: var(--amber-600); }
.prod__stars span { color: var(--text-tertiary); }
.prod__foot { margin-top: auto; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; padding-top: 4px; }
.prod__price { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--color-primary); }
.prod__old { font-size: 10px; color: var(--text-tertiary); text-decoration: line-through; }

/* ---- CTA band --------------------------------------------------------- */
.cta-band { position: relative; background: var(--gray-950); padding: var(--space-6) 14px; overflow: hidden; }
.cta-band__inner { position: relative; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.cta-band__text { text-align: center; }
.cta-band__badge-wrap { width: fit-content; margin: 0 auto; }
.cta-band__text h2 { color: #fff; font-size: 18px; margin-top: 12px; line-height: 1.3; }
.cta-band__text p { color: var(--gray-400); margin-top: 8px; text-transform: none; font-size: 12px; line-height: 1.5; }
.cta-band__chips { display: none; }         /* chips chỉ hiện desktop */
.cta-band__card { display: flex; flex-direction: column; gap: 10px; }
.dial { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: var(--radius-md); }
.dial--phone { background: var(--color-accent); }
.dial--phone:hover { background: var(--color-accent-hover); }
.dial--zalo { background: var(--gray-900); border: 1px solid var(--gray-700); }
.dial--zalo:hover { border-color: var(--blue-400); background: var(--gray-800); }
.dial__icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex: none; }
.dial__icon--phone { border-radius: 50%; background: rgba(255,255,255,.18); }
.dial__icon--phone i { font-size: 16px; color: #fff; }
.dial__icon--zalo { border-radius: var(--radius-sm); background: #0068FF; font-family: var(--font-display); font-weight: 800; font-size: 18px; color: #fff; }
.dial__meta { display: flex; flex-direction: column; line-height: 1.25; }
.dial__kicker { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.dial--phone .dial__kicker { color: rgba(255,255,255,.85); }
.dial--zalo .dial__kicker { color: var(--gray-500); }
.dial__value { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: #fff; }
.dial--zalo .dial__value { font-weight: 700; font-size: 13px; }

/* ======================================================================
   MOBILE-ONLY CHROME (bottom bar, drawer, speed-dial)
   ====================================================================== */
/* Thanh điều hướng dưới: 5 mục phẳng, đồng nhất. Không FAB nổi, không đổ bóng
   màu, không gạch active — trạng thái chỉ báo bằng MÀU. Hotline luôn màu accent. */
.mbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 73;
  background: var(--surface-card); border-top: 1px solid var(--border-default);
  box-shadow: 0 -2px 12px rgba(15,23,42,.06);
  /* Số cột tự theo số mục thật — tránh hở ô trống khi thêm/bớt mục. */
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mbar a, .mbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--mbar-height); padding: 8px 2px;
  background: none; border: none; cursor: pointer; text-align: center;
  color: var(--text-secondary); font-size: 11px; font-weight: 600; line-height: 1.1;
}
.mbar a i, .mbar button i { font-size: 20px; line-height: 1; }
.mbar a.is-active, .mbar button.is-active { color: var(--color-primary); font-weight: 700; }
/* Hotline giữ màu accent kể cả khi speed-dial đang mở (JS gắn .is-active). */
.mbar .mbar__hotline,
.mbar .mbar__hotline.is-active { color: var(--color-accent); font-weight: 700; }

.drawer { position: fixed; inset: 0; z-index: 81; background: var(--surface-page); display: none; flex-direction: column; }
.drawer.is-open { display: flex; }
.drawer__scrim { position: fixed; inset: 0; background: rgba(15,20,30,.55); z-index: 80; display: none; }
.drawer.is-open ~ .drawer__scrim { display: block; }
.drawer__head { padding: 12px 14px; background: var(--surface-card); border-bottom: 1px solid var(--border-default); display: flex; align-items: center; gap: 10px; }
.drawer__head h2 { flex: 1; font-size: 15px; font-weight: 800; color: var(--text-primary); text-transform: uppercase; letter-spacing: var(--tracking-wide); text-align: center; }
.drawer__close { width: 38px; height: 38px; border: none; background: transparent; color: var(--text-primary); display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); cursor: pointer; }
.drawer__body { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }

/* MENU MOBILE — một danh sách duy nhất, phản chiếu thanh ngang desktop.
   Trước đây là 13 thẻ danh mục rời (mỗi thẻ 71px) cộng một khối điều hướng
   tách riêng: drawer cao 1643px và khách phải đọc theo hai kiểu khác nhau.
   Giờ gộp thành một thẻ liền, nhóm con gập lại được. */
.drawer__nav { background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); overflow: hidden; }

/* Một dòng: icon — nhãn — mũi tên. Giữ vùng chạm 44px. */
.drawer__nav-row { display: flex; align-items: center; gap: 11px; min-height: 46px;
  padding: 8px 12px; color: var(--text-primary); font-family: var(--font-display);
  font-weight: 700; font-size: 13.5px; }
.drawer__nav-row:hover { background: var(--surface-primary-subtle); }
.drawer__nav-row.is-active { color: var(--color-primary); }
.drawer__nav-icon { flex: none; width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); display: flex; align-items: center; justify-content: center;
  color: var(--color-primary); font-size: 13px; }
.drawer__nav-row.is-active .drawer__nav-icon { background: var(--surface-primary-subtle); }
.drawer__nav-label { flex: 1; min-width: 0; line-height: 1.3; }
.drawer__nav-go { color: var(--text-tertiary); font-size: 11px; flex: none; }

/* Mục lá nằm thẳng trong .drawer__nav nên tự kẻ đường phân cách;
   mục có nhóm con thì để .drawer__nav-group lo, tránh kẻ hai lần. */
.drawer__nav > .drawer__nav-row,
.drawer__nav-group { border-bottom: 1px solid var(--border-default); }
.drawer__nav > *:last-child { border-bottom: none; }

/* Hàng cha của một nhóm: link chiếm phần lớn, nút mũi tên tách riêng để bấm
   vào chữ là đi thẳng tới trang, bấm vào mũi tên mới mở nhóm. */
.drawer__nav-head { display: flex; align-items: stretch; }
.drawer__nav-head .drawer__nav-row { flex: 1; min-width: 0; }
.drawer__nav-toggle { flex: none; width: 46px; border: 0; border-left: 1px solid var(--border-default);
  background: none; color: var(--text-tertiary); cursor: pointer; display: flex;
  align-items: center; justify-content: center; }
.drawer__nav-toggle i { transition: transform .18s ease; font-size: 12px; }
.drawer__nav-group.is-open .drawer__nav-toggle { color: var(--color-primary); }
.drawer__nav-group.is-open .drawer__nav-toggle i { transform: rotate(180deg); }

/* Nhóm con: đóng mặc định, mở khi accordion gắn .is-open. */
.drawer__nav-sub { display: none; background: var(--surface-sunken);
  border-top: 1px solid var(--border-default); }
.drawer__nav-group.is-open .drawer__nav-sub { display: block; }
.drawer__nav-sub a { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 40px; padding: 7px 12px 7px 53px; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); }
.drawer__nav-sub a + a { border-top: 1px solid var(--border-default); }
.drawer__nav-sub a:hover { color: var(--color-primary); }
.drawer__nav-sub a.is-active { color: var(--color-primary); }
.drawer__nav-count { flex: none; font-size: 11.5px; color: var(--text-tertiary);
  font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .drawer__nav-toggle i { transition: none; }
}

.speed-dial { position: fixed; left: 0; right: 0; bottom: 48px; z-index: 72; display: none; flex-direction: column; align-items: center; gap: 10px; padding: 0 20px; }
.speed-dial.is-open { display: flex; }
.speed-dial__scrim { position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 71; display: none; }
.speed-dial.is-open ~ .speed-dial__scrim { display: block; }
.speed-dial > a { width: 100%; max-width: 320px; box-shadow: var(--shadow-lg); }

/* KHÔNG thêm padding ở body: .site-footer đã tự chừa chỗ cho .mbar
   (xem components.css). Cộng dồn cả hai sẽ tạo khoảng trống thừa dưới footer. */
body { padding-bottom: 0; }

/* ======================================================================
   DESKTOP ≥ 860px
   ====================================================================== */
@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .section { max-width: var(--container-max); padding: 64px 32px; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: var(--text-2xl); }
  .section-head p { font-size: var(--text-sm); }
  .section-title-c { margin-bottom: 40px; }
  .section-title-c h2 { font-size: var(--text-2xl); }
  .section-title-c p { font-size: var(--text-base); }
  .link-all { font-size: var(--text-sm); letter-spacing: .04em; }

  /* product card */
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .prod__media { font-size: 9px; }
  .prod__badge { font-size: 11px; padding: 3px 8px; }
  .prod__cat { font-size: 11px; }
  .prod__name { font-size: 13px; min-height: 34px; }
  .prod__stars { font-size: 11px; }
  .prod__price { font-size: var(--text-base); }
  .prod__old { font-size: 11px; }

  /* CTA band: 2 cột */
  .cta-band { padding: var(--space-16) 32px; }
  .cta-band__inner { max-width: var(--container-max); flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .cta-band__text { flex: 1 1 380px; text-align: left; }
  .cta-band__badge-wrap { margin: 0; }
  .cta-band__text h2 { font-size: var(--text-2xl); margin-top: 16px; }
  .cta-band__text p { font-size: var(--text-base); margin-top: 10px; max-width: 460px; }
  .cta-band__chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
  .cta-chip { display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--gray-800); border-radius: var(--radius-full); color: var(--gray-300); font-size: 12.5px; }
  .cta-chip i { color: var(--blue-300); }
  .cta-band__card { flex: 1 1 320px; max-width: 400px; background: var(--gray-900); border: 1px solid var(--gray-800); border-radius: var(--radius-lg); padding: 26px 28px; gap: 16px; }
  .dial { padding: 14px 16px; gap: 14px; }
  .dial--zalo { background: transparent; }
  .dial__icon { width: 44px; height: 44px; }
  .dial__icon--phone i { font-size: 18px; }
  .dial__icon--zalo { font-size: 20px; }
  .dial__value { font-size: var(--text-xl); }
  .dial--zalo .dial__value { font-size: var(--text-base); }
  .dial__kicker { font-size: 11px; }

  /* ẩn chrome mobile + section chỉ-mobile trên desktop */
  .mbar, .drawer, .drawer__scrim, .speed-dial, .speed-dial__scrim, .only-mobile { display: none !important; }
}

/* =========================================================================
   THẺ DỰ ÁN — nguồn duy nhất.
   Dùng ở: khối "Dự án" trang chủ, archive-du_an, taxonomy-loai_du_an, và khối
   "Dự án khác" ở trang chi tiết. Trước đây khối này bị chép ở cả home.css lẫn
   du-an.css rồi trôi lệch — bản trong home.css thiếu object-fit nên ảnh dự án
   ngoài trang chủ không được cắt đúng khung.
   ========================================================================= */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (min-width: 600px) {
  /* Khoảng giữa điện thoại và desktop trước đây không có mốc nào: máy tính
     bảng và điện thoại xoay ngang ăn nguyên lưới 2 cột của mobile, thẻ bị kéo
     rộng ra mà chữ vẫn cỡ nhỏ. Cho tự đếm cột từ 210px. */
  .proj-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
}

.proj { position: relative; background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.proj:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.proj__img { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: repeating-linear-gradient(45deg, var(--gray-100) 0 10px, var(--gray-50) 10px 20px); text-align: center; padding: 8px; color: var(--gray-400); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.proj__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Nhãn DUY NHẤT trên thẻ dự án: loại dự án. Xanh thương hiệu thay vì xám
   than — xám dễ chìm vào vùng tối của ảnh hiện trường, xanh thì bật lên ở
   cả ảnh sáng lẫn tối. Không dùng đỏ: đỏ đang dành cho hotline và nút hành
   động, để đây sẽ tranh sự chú ý với chính chỗ cần khách bấm. */
.proj__tag { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--color-primary); color: #fff; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 5px 10px; border-radius: var(--radius-full); box-shadow: 0 2px 10px rgba(8, 16, 32, .3); }
.proj__body { padding: 10px 12px 12px; }
.proj__body h4 { font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 700; line-height: 1.3; color: var(--text-primary); }
.proj__body h4 a { color: var(--text-primary); }
.proj__body h4 a:hover { color: var(--color-primary); }
.proj__addr { display: flex; align-items: flex-start; gap: 5px; margin-top: 6px; color: var(--text-secondary); font-size: 11px; line-height: 1.4; }
.proj__addr i { color: var(--color-accent); margin-top: 3px; }
.proj__map { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--color-primary); }
.proj__map:hover { text-decoration: underline; }

@media (min-width: 860px) {
  /* auto-FILL, không phải auto-fit: auto-fit xoá cột rỗng nên khi site mới có
     1–2 dự án, thẻ giãn ra chiếm hết chiều ngang (đo được 594px/thẻ, ảnh cao
     446px). auto-fill giữ cột rỗng nên thẻ đứng yên ở kích thước thiết kế. */
  .proj-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
  .proj__img { font-size: 10px; letter-spacing: .08em; }
  .proj__tag { top: 12px; left: 12px; font-size: 11.5px; padding: 6px 13px; }
  .proj__body { padding: 16px; }
  .proj__body h4 { font-size: var(--text-base); }
  .proj__addr { font-size: var(--text-sm); margin-top: 8px; }
  .proj__map { font-size: 12.5px; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .proj { transition: none; }
  .proj:hover { transform: none; }
}

/* =========================================================================
   TRẠNG THÁI RỖNG — dùng chung cho trang Dự án và Cẩm Nang.
   Để ở shared.css vì du-an.css chỉ nạp ở trang dự án, còn blog dùng blog.css.
   ========================================================================= */
.lp-empty-wrap { max-width: var(--container-max); margin: 0 auto; padding: 24px 14px 8px; }
/* ---- Trạng thái "chưa có nội dung" — dùng chung -----------------------
   Thay cho một dòng chữ xám trước đây. Khách vào đây qua Google hoặc lọc
   trúng loại chưa có bài — cần lối đi tiếp, không phải ngõ cụt. */
.lp-empty { text-align: center; padding: 34px 18px 40px; background: var(--surface-card);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.lp-empty__icon { display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%; background: var(--surface-primary-subtle); }
.lp-empty__icon i { font-size: 24px; color: var(--color-primary); }
.lp-empty h2 { margin-top: 16px; font-size: var(--text-lg); color: var(--text-primary); }
.lp-empty p { margin: 10px auto 0; max-width: 52ch; color: var(--text-secondary);
  font-size: 13.5px; line-height: 1.6; }
.lp-empty__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px;
  align-items: stretch; }

@media (min-width: 860px) {
  .lp-empty-wrap { padding: 40px 32px 8px; }
  .lp-empty { padding: 52px 32px 56px; }

  .lp-empty p { font-size: var(--text-base); }

  .lp-empty__actions { flex-direction: row; justify-content: center; align-items: center; }
}
