/* ============================================================
   PACELAND — Giỏ hàng dự án (bảng hàng + bộ lọc)
   Prefix: .gh-  ·  Dùng token của styles.css, không ghi đè
   ============================================================ */

.gh { --gh-gap: clamp(12px, 1.6vw, 20px); }

/* ---------- Dải thông số ---------- */
/* Cột chia hết cho số ô (thường 6) để không thừa ô trống ở hàng cuối */
.gh-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
@media (min-width: 620px) { .gh-stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1060px) { .gh-stats { grid-template-columns: repeat(6, 1fr); } }
.gh-stats div { background: var(--white); padding: clamp(.9rem, 1.8vw, 1.25rem); }
.gh-stats dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gh-stats dd { font-family: var(--head); font-weight: 700; font-size: clamp(1rem, 1.7vw, 1.15rem); margin-top: .3rem; line-height: 1.3; }

/* ---------- Thẻ khối tháp ---------- */
.gh-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gh-gap); }
.gh-block { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; padding: clamp(1rem, 2vw, 1.4rem); display: flex; flex-direction: column; gap: .5rem; }
.gh-block__id { font-family: var(--head); font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; }
.gh-block__id small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: .1rem; }
.gh-block__nums { display: flex; gap: 1.1rem; font-size: .88rem; color: var(--ink-soft); }
.gh-block__nums b { font-family: var(--head); color: var(--ink); }
.gh-block__note { font-size: .84rem; color: var(--muted); line-height: 1.6; flex: 1; }
.gh-tag { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .28rem .6rem; border-radius: 999px; }
.gh-tag--full { background: var(--gold-tint); color: #7A5C2E; }
.gh-tag--raw { background: rgba(27, 21, 16, .06); color: var(--ink-soft); }

/* ---------- Thanh công cụ ---------- */
.gh-bar { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; padding: clamp(.8rem, 1.6vw, 1.1rem); }
.gh-bar__top { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.gh-search { flex: 1 1 200px; min-width: 0; position: relative; }
.gh-search input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 .9rem 0 2.4rem; background: var(--paper); font: inherit; font-size: .92rem; color: var(--ink); }
.gh-search input:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 1px; }
.gh-search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.gh-sel { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 2rem 0 .8rem; background: var(--paper); font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.gh-toggle { height: 44px; display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--line); border-radius: 8px; padding: 0 .95rem; background: var(--paper); font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.gh-toggle svg { width: 16px; height: 16px; }
.gh-toggle[aria-expanded="true"] { border-color: var(--gold-soft); background: var(--gold-tint); }
.gh-toggle b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; }

.gh-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.gh-chip { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: .38rem .85rem; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease); }
.gh-chip:hover { border-color: var(--gold-soft); }
.gh-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.gh-panel { display: none; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); }
.gh-panel.is-open { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gh-gap); }
.gh-field label { display: block; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
.gh-field .gh-sel { width: 100%; }
.gh-panel__act { grid-column: 1 / -1; display: flex; gap: .6rem; flex-wrap: wrap; }

.gh-count { margin-top: .85rem; font-size: .88rem; color: var(--muted); }
.gh-count b { color: var(--ink); font-family: var(--head); }

/* ---------- Bảng hàng ---------- */
.gh-tablewrap { margin-top: var(--gh-gap); background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.gh-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: 820px; }
.gh-table th, .gh-table td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.gh-table thead th { position: sticky; top: 0; z-index: 2; background: var(--paper); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.gh-table tbody tr:last-child td { border-bottom: 0; }
.gh-table tbody tr:hover { background: var(--paper); }
.gh-table tbody tr.is-picked { background: var(--gold-tint); }
.gh-code { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--head); font-weight: 800; letter-spacing: .03em; color: var(--red); }
.gh-num { font-family: var(--head); font-weight: 700; }
.gh-sub { display: block; font-size: .76rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.gh-view { white-space: normal; max-width: 230px; color: var(--ink-soft); font-size: .86rem; line-height: 1.5; }
.gh-pill { display: inline-block; font-size: .73rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--red-tint); color: var(--red-deep); white-space: nowrap; }
.gh-ask { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--red); background: var(--red); color: #fff; border-radius: 8px; padding: .5rem .8rem; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease); }
.gh-ask:hover { background: var(--red-deep); border-color: var(--red-deep); }
.gh-ask svg { width: 15px; height: 15px; }
.gh-pick { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }
/* Cột CTA luôn nhìn thấy khi bảng phải cuộn ngang — khác bảng mẫu, ở đó nút bị trôi khỏi màn */
.gh-sticky { position: sticky; right: 0; background: var(--white); border-left: 1px solid var(--line-soft); }
.gh-table thead th.gh-sticky { background: var(--paper); z-index: 3; }
.gh-table tbody tr:hover .gh-sticky { background: var(--paper); }
.gh-table tbody tr.is-picked .gh-sticky { background: #F2E9DA; }

/* ---------- Thẻ căn cho màn hẹp ---------- */
.gh-cards { display: none; }
.gh-unit { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; padding: 1rem 1.1rem; }
.gh-unit + .gh-unit { margin-top: .7rem; }
.gh-unit.is-picked { border-color: var(--gold-soft); background: var(--gold-tint); }
.gh-unit__hd { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.gh-unit__price { text-align: right; }
.gh-unit__price b { display: block; font-family: var(--head); font-weight: 800; font-size: 1.12rem; color: var(--red); }
.gh-unit__rows { margin: .8rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .87rem; }
.gh-unit__rows dt { color: var(--muted); }
.gh-unit__rows dd { color: var(--ink-soft); text-align: right; }
.gh-unit__act { margin-top: .9rem; }
.gh-unit__act .gh-ask { width: 100%; justify-content: center; padding-block: .72rem; }
.gh-unit__id { display: flex; align-items: flex-start; gap: .6rem; }
.gh-unit__box { padding-top: .15rem; cursor: pointer; }
.gh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.gh-empty { padding: clamp(2rem, 5vw, 3.2rem) 1.2rem; text-align: center; }
.gh-empty p { color: var(--ink-soft); max-width: 46ch; margin: .5rem auto 0; font-size: .94rem; }

/* ---------- Thanh so sánh nổi ---------- */
.gh-cmp { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 120%); z-index: 95; width: min(680px, calc(100vw - 24px)); background: var(--ink); color: var(--paper); border-radius: 14px 14px 0 0; padding: .85rem 1.1rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; box-shadow: var(--shadow-lg); transition: transform .28s var(--ease); padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px)); }
.gh-cmp.is-on { transform: translate(-50%, 0); }
body.gh-cmp-on .float-contact { transform: translateY(calc(-1 * var(--gh-cmp-h, 84px) - 10px)); transition: transform .28s var(--ease); }
.gh-cmp__txt { flex: 1 1 auto; font-size: .88rem; }
.gh-cmp__txt b { font-family: var(--head); }
.gh-cmp button { border-radius: 8px; padding: .5rem .9rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.gh-cmp__go { background: var(--paper); color: var(--ink); }
.gh-cmp__clear { background: transparent; color: var(--muted-2); border-color: rgba(246, 242, 234, .25); }

/* ---------- Hộp thoại ---------- */
.gh-dlg { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(27, 21, 16, .55); }
.gh-dlg.is-on { display: flex; }
.gh-dlg__box { background: var(--paper); border-radius: 16px; width: min(560px, 100%); max-height: min(88vh, 760px); overflow-y: auto; padding: clamp(1.3rem, 3vw, 2rem); position: relative; box-shadow: var(--shadow-lg); }
.gh-dlg__box--wide { width: min(880px, 100%); }
.gh-dlg__x { position: absolute; top: .8rem; right: .8rem; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.gh-dlg__x svg { width: 17px; height: 17px; }
.gh-dlg h2 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); line-height: 1.25; padding-right: 2.4rem; }
.gh-dlg__unit { margin-top: .9rem; padding: .8rem 1rem; background: var(--white); border: 1px solid var(--line-soft); border-radius: 10px; font-size: .9rem; }
.gh-dlg__unit b { font-family: var(--head); color: var(--red); }

.gh-cmptable { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 1rem; }
.gh-cmptable th, .gh-cmptable td { padding: .65rem .7rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.gh-cmptable thead th { font-family: var(--head); font-weight: 800; color: var(--red); white-space: nowrap; }
.gh-cmptable tbody th { font-weight: 600; color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }

/* ---------- Dòng sản phẩm & định mức giá ---------- */
.gh-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gh-gap); }
.gh-line { background: var(--white); border: 1px solid var(--line-soft); border-radius: 14px; padding: clamp(1rem, 2vw, 1.4rem); }
.gh-line h3 { font-size: 1.15rem; }
.gh-line__dt { font-family: var(--head); font-weight: 700; color: var(--ink-soft); margin-top: .3rem; font-size: .95rem; }
.gh-line__fin { margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--line); font-size: .84rem; color: var(--muted); }
.gh-line__fin b { color: var(--ink); font-family: var(--head); }
.gh-tiers { display: grid; gap: .6rem; margin-top: 1rem; }
.gh-tier { display: flex; gap: .9rem; align-items: baseline; background: var(--white); border: 1px solid var(--line-soft); border-radius: 10px; padding: .75rem 1rem; }
.gh-tier b { flex: none; font-family: var(--head); font-weight: 800; color: var(--gold); min-width: 46px; }
.gh-tier span { font-size: .88rem; color: var(--ink-soft); line-height: 1.6; }
.gh-tier em { font-style: normal; font-weight: 600; color: var(--ink); }

.gh-note { margin-top: var(--gh-gap); padding: clamp(.9rem, 2vw, 1.3rem); background: var(--red-tint); border: 1px solid var(--red-line); border-radius: 12px; font-size: .88rem; color: var(--ink-soft); line-height: 1.7; }
.gh-note b { color: var(--red-deep); }

/* ---------- Bảng chính sách ---------- */
.gh-policy { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; font-size: .92rem; }
.gh-policy th, .gh-policy td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.gh-policy tr:last-child th, .gh-policy tr:last-child td { border-bottom: 0; }
.gh-policy th { font-family: var(--head); font-weight: 600; color: var(--ink); width: 46%; }
.gh-policy td { text-align: right; font-family: var(--head); font-weight: 700; color: var(--red); }
.gh-policy tr:nth-child(even) th, .gh-policy tr:nth-child(even) td { background: var(--paper); }

/* ---------- Thẻ giỏ hàng trên SaleHub ---------- */
.gh-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--gh-gap); }
.gh-hubcard { position: relative; background: var(--white); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.gh-hubcard:hover { border-color: var(--gold-soft); transform: translateY(-3px); }
.gh-hubcard__img { aspect-ratio: 16 / 9; background: var(--cloud); overflow: hidden; }
.gh-hubcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gh-hubcard__bd { padding: clamp(1rem, 2vw, 1.35rem); display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.gh-hubcard h3 { font-size: 1.15rem; }
.gh-hubcard h3 a { color: inherit; text-decoration: none; }
.gh-hubcard h3 a::after { content: ""; position: absolute; inset: 0; }
.gh-hubcard p { font-size: .87rem; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.gh-hubcard__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .82rem; color: var(--muted); }
.gh-hubcard__meta b { color: var(--ink); font-family: var(--head); }
.gh-hubcard__cta { font-size: .87rem; font-weight: 700; color: var(--red); }
.gh-hubcard--soon { opacity: .62; }
.gh-hubcard--soon:hover { transform: none; border-color: var(--line-soft); }

/* ---------- Màn hẹp ---------- */
@media (max-width: 900px) {
  .gh-scroll { display: none; }
  .gh-cards { display: block; margin-top: var(--gh-gap); }
  .gh-tablewrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .gh-cmptable { display: block; overflow-x: auto; }
}
@media (max-width: 560px) {
  .gh-bar__top { gap: .5rem; }
  .gh-sel, .gh-toggle { flex: 1 1 calc(50% - .25rem); }
  .gh-cmp { border-radius: 12px 12px 0 0; gap: .55rem; }
  .gh-cmp__txt { flex: 1 1 100%; }
  .gh-cmp__go { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-hubcard, .gh-chip, .gh-ask, .gh-cmp { transition: none; }
}
