/**
 * Nam Việt — Product archive (Sản phẩm) — v2 industrial direction.
 *
 * Source: design/v2/products.html (inline <style> = spec). The shell (utility bar,
 * header, footer), base primitives (.container, .btn*, .kicker, .notch, .grid-bg,
 * section, .sec-head) and the shared inner-page hero band (.page-hero, .crumb)
 * come from base.css/header.css/footer.css — this sheet only adds the archive
 * sections. Class names keep the `nv-` prefix the archive shortcodes emit
 * (inc/template-helpers.php) so markup + styling stay in sync.
 *
 * Enqueued conditionally (handle `nv-products`) for the product post-type archive
 * + product_category taxonomy archive (inc/hooks-frontend.php).
 */

/* ============ PRODUCTS LISTING ============ */
.nv-prod { background: var(--paper); }
.nv-prod .sec-head { margin-bottom: 34px; }

/* toolbar: filters + result meta on one rail */
.nv-prod-toolbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 34px; border-bottom: 1px solid var(--s-200);
}
.nv-filter-group { display: flex; flex-direction: column; gap: 12px; }
.nv-filter-label {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--s-500);
}

/* filter pills — emitted by [nv_product_category_filter] as .nv-filter-buttons > .nv-filter-pill */
.nv-filter-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.nv-filter-pill {
  font-family: var(--body); font-size: 0.84rem; font-weight: 600; color: var(--s-700);
  background: var(--white); border: 1px solid var(--s-200); padding: 9px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}
.nv-filter-pill:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.nv-filter-pill--active { background: var(--orange); border-color: var(--orange); color: #fff; }
.nv-filter-pill__count {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  background: var(--paper-2); color: var(--s-500); padding: 2px 7px;
}
.nv-filter-pill:hover .nv-filter-pill__count { color: var(--ink); }
.nv-filter-pill--active .nv-filter-pill__count { background: rgba(255,255,255,0.22); color: #fff; }

/* result meta + sort */
.nv-result-meta { display: flex; align-items: center; gap: 18px; font-size: 0.86rem; color: var(--s-500); }
.nv-result-count strong { color: var(--ink); font-weight: 700; }
.nv-sort-form { margin: 0; }
.nv-sort-wrap {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--s-500);
}
.nv-sort-select {
  font-family: var(--body); font-size: 0.86rem; letter-spacing: 0; text-transform: none;
  padding: 9px 12px; border: 1px solid var(--s-200); background: var(--white); color: var(--ink); cursor: pointer;
}
.nv-sort-select:hover { border-color: var(--ink); }

/* ============ PRODUCT GRID + CARD ============ */
.nv-product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.nv-product-card {
  position: relative; background: var(--white); box-shadow: var(--sh-sm); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow 0.3s, transform 0.3s;
}
.nv-product-card:hover { box-shadow: var(--sh-lg); transform: translateY(-4px); }
.nv-product-card-img-link { display: block; }

/* image wrapper — emitted by [nv_product_card_image] as .nv-product-card-img-wrap > img + .nv-product-tag */
.nv-product-card-img-wrap {
  position: relative; overflow: hidden; aspect-ratio: 16 / 11; display: block;
  background: linear-gradient(135deg, var(--s-100), var(--s-200));
}
.nv-product-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.nv-product-card:hover .nv-product-card-img-wrap img { transform: scale(1.06); }
.nv-product-tag {
  position: absolute; top: 14px; left: 14px; font-family: var(--mono); font-size: 0.66rem;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: 6px 11px; z-index: 2;
}

.nv-product-card-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nv-product-card-title { font-size: 1.2rem; color: var(--ink); line-height: 1.2; margin: 0; }
.nv-product-card-title a { color: inherit; }
.nv-product-card-title a:hover { color: var(--orange-700); }
.nv-product-card-excerpt { font-size: 0.88rem; color: var(--s-500); flex: 1; margin: 0; }
/* Giá sản phẩm (ACF `price`, fallback "Liên hệ" — inc/template-helpers.php).
   Vạch dọc bên trái neo khối giá vào mép nội dung thay vì thả trôi giữa card;
   `.is-quote` = chưa có giá → vạch trung tính + chữ nhạt, để giá thật nổi lên
   khi quét cả lưới. Cam dành cho CTA bên dưới, giá dùng --ink cho tương phản. */
.nv-product-card-price {
  display: flex; flex-direction: column; gap: 3px; margin: 4px 0 0;
  padding-left: 12px; border-left: 3px solid var(--orange);
}
.nv-product-card-price .nv-price-label {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--s-400); line-height: 1;
}
.nv-product-card-price .nv-price-value {
  font-family: var(--display); font-size: 1.15rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.015em; line-height: 1.25;
}
.nv-product-card-price.is-quote { border-left-color: var(--s-200); }
.nv-product-card-price.is-quote .nv-price-value {
  font-family: var(--body); font-size: 0.95rem; font-weight: 600; color: var(--s-500);
  letter-spacing: 0;
}
.nv-product-card-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--s-100);
}
.nv-product-detail-link {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--orange-700);
  display: inline-flex; align-items: center; gap: 7px; transition: gap 0.2s, color 0.2s;
}
.nv-product-detail-link svg {
  width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s;
}
.nv-product-card:hover .nv-product-detail-link { color: var(--orange); gap: 11px; }
.nv-product-card:hover .nv-product-detail-link svg { transform: translateX(3px); }
.nv-btn-quote {
  font-family: var(--body); font-size: 0.78rem; font-weight: 600; color: var(--orange-700);
  background: transparent; border: 1px solid var(--orange-100); padding: 7px 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nv-btn-quote svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nv-btn-quote:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ============ EMPTY STATE (emitted by [nv_product_archive_empty_state]) ============ */
.nv-empty-state {
  grid-column: 1 / -1; text-align: center; padding: 70px 24px;
  background: var(--white); border: 1px dashed var(--s-200);
}
.nv-empty-state h3 { font-size: 1.3rem; color: var(--ink); margin-bottom: 8px; }
.nv-empty-state p { color: var(--s-500); font-size: 0.95rem; margin-bottom: 22px; }
.nv-empty-state__cta {
  display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--body); font-weight: 700;
  font-size: 0.95rem; padding: 15px 28px; background: var(--orange); color: #fff;
  box-shadow: var(--sh-orange); transition: background 0.2s, transform 0.15s;
}
.nv-empty-state__cta:hover { background: var(--orange-600); transform: translateY(-2px); }

/* ============ PAGINATION ============ */
.nv-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 54px; flex-wrap: wrap; }
.nv-pagination .page-numbers {
  min-width: 46px; height: 46px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.9rem; font-weight: 700; border: 1px solid var(--s-200);
  background: var(--white); color: var(--s-700); transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.nv-pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }
.nv-pagination .page-numbers.current { background: var(--orange); border-color: var(--orange); color: #fff; pointer-events: none; }
.nv-pagination .page-numbers.dots { border: none; background: transparent; }

/* ============ CTA BAND ============ */
.cta-band { position: relative; background: var(--orange); color: #fff; overflow: hidden; padding: 72px 0; }
.cta-band::before { content: ""; position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: overlay; background-image: linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px); background-size: 40px 40px; }
.cta-band::after { content: ""; position: absolute; top: 0; right: 0; width: 46%; height: 100%; background: linear-gradient(120deg, transparent, rgba(26,28,31,0.18)); pointer-events: none; }
.cta-band .container { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta-band .ctk { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.85); }
.cta-band h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); color: #fff; margin: 12px 0 6px; max-width: 18em; }
.cta-band .c-phone { font-family: var(--mono); font-weight: 700; font-size: 1.2rem; margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.cta-band .c-phone .cp-ico { display: flex; align-items: center; }
.cta-band .c-phone .cp-ico svg { width: 20px; height: 20px; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-band .btn-primary { background: #fff; color: var(--orange-700); box-shadow: 0 16px 30px rgba(26,28,31,0.22); }
.cta-band .btn-primary:hover { background: var(--ink); color: #fff; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .nv-product-grid { grid-template-columns: 1fr 1fr; }
  .nv-prod-toolbar { align-items: flex-start; }
}
@media (max-width: 680px) {
  .nv-product-grid { grid-template-columns: 1fr; }
  .nv-prod-toolbar { flex-direction: column; gap: 22px; }
  .nv-result-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
}
