/**
 * Nam Việt — Single Product (Chi tiết sản phẩm) — v2 industrial direction.
 *
 * Markup: single-product_p1.php. Source: design/v2/product-detail.html (inline
 * <style> = spec). Shell (utility/header/footer), base primitives (.container,
 * .btn*, .kicker, .sec-head, .breadcrumb) come from base.css; this sheet adds the
 * product-detail sections. Class names match the existing template + gallery JS
 * (.thumbnail / #main-image-img) so the v2 reskin needs no JS change.
 *
 * Enqueued only on is_singular('product_p1') (handle `nv-single-product`).
 */

/* ============ BREADCRUMB BAR (light, slim) ============ */
.crumb-bar { background: var(--paper); border-bottom: 1px solid var(--s-200); }
.crumb-bar .container { padding-top: 0; padding-bottom: 0; }
.crumb-bar .breadcrumb { padding: 22px 0; margin: 0; }
.crumb-bar .breadcrumb .sep { color: var(--orange); }
.crumb-bar .breadcrumb .cur { color: var(--ink); font-weight: 600; }

/* ============ PRODUCT DETAIL ============ */
.product-detail-section { background: var(--paper); padding: 54px 0 100px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; margin: 0; }

/* Gallery */
.product-gallery { display: flex; flex-direction: column; gap: 14px; }
.main-image {
  position: relative; aspect-ratio: 4 / 3.4; height: auto; width: 100%;
  background: linear-gradient(135deg, var(--s-100), var(--s-200));
  box-shadow: var(--sh-md); overflow: hidden; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--s-500); font-size: 0.9rem;
}
.main-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.25s ease; }

.thumbnails { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.thumbnail {
  aspect-ratio: 1 / 1; height: auto; overflow: hidden; border: 2px solid transparent;
  background: var(--white); cursor: pointer; padding: 0; display: block;
  box-shadow: var(--sh-sm); border-radius: 0;
  transition: border-color 0.2s, transform 0.15s;
}
.thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail:hover { border-color: var(--s-300); transform: translateY(-2px); }
.thumbnail.active { border-color: var(--orange); box-shadow: var(--sh-sm); }

/* Product Info */
.product-info > .kicker { margin-bottom: 6px; }
.product-info h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem); color: var(--ink);
  margin: 14px 0 16px; letter-spacing: -0.03em;
}
.product-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--s-200);
  font-family: var(--mono); font-size: 0.8rem; color: var(--s-500);
}
.in-stock {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--orange-700); font-weight: 700; letter-spacing: 0.02em; font-size: 0.8rem;
}
.in-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* Giá sản phẩm (ACF `price`, fallback "Liên hệ" — inc/template-helpers.php).
   Panel nền giấy + vạch cam: giá là thông tin quyết định trên trang chi tiết nên
   được đóng khung thay vì để trôi giữa hai đoạn text. `price-note` chỉ xuất hiện
   ở trạng thái `.is-quote` (chưa có giá) — cam kết thời gian phản hồi báo giá. */
.product-price {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 26px;
  padding: 16px 20px; background: var(--paper); border-left: 3px solid var(--orange);
}
.product-price .price-label {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--s-500); line-height: 1;
}
.product-price .price-value {
  font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1.15;
}
.product-price .price-note { font-size: 0.82rem; line-height: 1.55; color: var(--s-500); max-width: 46ch; }
.product-price.is-quote { border-left-color: var(--s-300); }
.product-price.is-quote .price-value {
  font-family: var(--body); font-size: 1.3rem; font-weight: 700; color: var(--s-700); letter-spacing: 0;
}

.description { color: var(--s-700); font-size: 1rem; line-height: 1.78; margin-bottom: 24px; max-width: 42em; }
.description p { margin-bottom: 1em; }
.description p:last-child { margin-bottom: 0; }

/* Specs (table styled as v2 spec-list) */
.specs-section { margin-bottom: 8px; }
.specs-section > .kicker { margin-bottom: 6px; }
.specs-table {
  width: 100%; border-collapse: collapse; margin-top: 14px;
  border: none; border-top: 1px solid var(--s-200); border-radius: 0; overflow: visible;
}
.specs-table tr { border-bottom: 1px solid var(--s-200); }
.specs-table th, .specs-table td { padding: 13px 2px; text-align: left; vertical-align: top; }
.specs-table th {
  width: 36%; background: transparent;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--s-500); font-weight: 600;
}
.specs-table td { color: var(--ink); font-size: 0.94rem; font-weight: 500; }

.cta-section { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; padding-top: 0; border-top: none; }
.cta-section .btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ============ RELATED (reuse .pcard from products) ============ */
.related-section { background: var(--white); }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pcard {
  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;
}
.pcard:hover { box-shadow: var(--sh-lg); transform: translateY(-4px); }
.pcard .ph {
  position: relative; overflow: hidden; aspect-ratio: 16 / 11; flex: none; display: block;
  background: linear-gradient(135deg, var(--s-100), var(--s-200));
}
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.pcard:hover .ph img { transform: scale(1.06); }
.pcard .cat {
  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;
}
.pcard .pb { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard h3 { font-size: 1.18rem; color: var(--ink); line-height: 1.2; }
.pcard h3 a { color: inherit; }
.pcard h3 a:hover { color: var(--orange-700); }
.pcard .pdesc { font-size: 0.88rem; color: var(--s-500); flex: 1; }
.pcard .pprice { display: flex; flex-direction: column; gap: 3px; padding-left: 11px; border-left: 3px solid var(--orange); }
.pcard .pprice-label {
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--s-400); line-height: 1;
}
.pcard .pprice-value {
  font-family: var(--display); font-size: 1.05rem; font-weight: 700; color: var(--ink);
  letter-spacing: -0.015em; line-height: 1.25;
}
.pcard .pprice.is-quote { border-left-color: var(--s-200); }
.pcard .pprice.is-quote .pprice-value {
  font-family: var(--body); font-size: 0.92rem; font-weight: 600; color: var(--s-500); letter-spacing: 0;
}
.pcard .pl {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--orange-700);
  display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; transition: gap 0.2s, color 0.2s;
}
.pcard .pl svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.pcard:hover .pl { color: var(--orange); gap: 11px; }
.pcard:hover .pl svg { transform: translateX(3px); }

/* ============ 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) {
  .product-grid { grid-template-columns: 1fr; gap: 36px; }
  .prod-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .prod-grid { grid-template-columns: 1fr; }
  .cta-section .btn { width: 100%; justify-content: center; }
}
