/* Trang sản phẩm MEVN — bám theo Figma "Product Detail" và biến màu của trang chủ (home/css/style.css).
   Nút, nhãn mục, form liên hệ, header, footer dùng lại class của trang chủ. */
.pd {
  /* Đỏ dùng chung với trang chủ (--color-red trong home/css/style.css) cho cả nền sáng và nền đen. */
  --pd-red: var(--color-red, #ff0000);
  --pd-red-on-dark: var(--color-red, #ff0000);
  --pd-text-2: #595959;         /* chữ phụ trên nền sáng */
  --pd-text-on-dark: #c8c8c8;   /* chữ phụ trên nền đen */
  --pd-line: var(--border-color, #e1e1e1);
  --pd-line-strong: #d9d9d9;
  --pd-gutter: 24px;
  color: var(--color-black, #000);
}
.pd h1, .pd h2, .pd h3 { font-weight: 500; line-height: 1.2; margin: 0; }
.pd p { margin: 0; }
.pd img { max-width: 100%; display: block; }
/* Nội dung rộng đúng 1440px như .container của trang chủ: khung = 1440 + 2 lề, lề nằm trong khung. */
.pd section, .pd-breadcrumb, .pd-subnav { max-width: calc(var(--max-width, 1440px) + 2 * var(--pd-gutter)); margin-inline: auto; }
.pd a:focus-visible, .pd button:focus-visible { outline: 2px solid var(--pd-red); outline-offset: 3px; }
.pd-tech a:focus-visible, .pd-ai button:focus-visible, .pd-support a:focus-visible { outline-color: #fff; }

.pd-label { font-size: 12px; font-weight: 600; line-height: 1.6; letter-spacing: 1.44px; text-transform: uppercase; color: var(--pd-red); }
.pd-label--dark { color: var(--pd-red-on-dark); }
.pd-label--plain { color: #000; }
.pd-heading { display: flex; flex-direction: column; gap: 12px; }
.pd-heading h2, .pd-heading h1 { font-size: 48px; }
.pd-heading--row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 24px; }
.pd-heading--row > div { display: flex; flex-direction: column; gap: 12px; }
.pd .btn-primary { background: var(--pd-red); }
.pd .btn-primary, .pd .btn-outline { display: inline-flex; align-items: center; justify-content: space-between; text-decoration: none; white-space: nowrap; }
.pd-more-link { font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* Đường dẫn */
.pd-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 20px var(--pd-gutter); border-bottom: 1px solid var(--pd-line); font-size: 12px; line-height: 1.35; color: var(--color-gray-dark, #666); }
.pd-breadcrumb a { color: inherit; text-decoration: none; }
.pd-breadcrumb a:hover { color: var(--pd-red); }
.pd-breadcrumb [aria-current] { font-weight: 600; color: #000; }

/* Banner dòng sản phẩm */
.pd-brand__head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px var(--pd-gutter); }
.pd-brand__title { font-size: 48px; font-weight: 500; line-height: 1.2; }
.pd-brand__note { width: 360px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.4; color: var(--pd-text-2); }
.pd-brand__media { position: relative; height: 539px; overflow: hidden; background: #000; }
.pd-brand__media img { width: 100%; height: 100%; object-fit: cover; }
.pd-brand__media p { position: absolute; left: 64px; bottom: 48px; font-size: 20px; line-height: 1.2; color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.5); }

/* Khối sản phẩm */
.pd-hero { display: flex; gap: 64px; padding: 64px var(--pd-gutter); }
.pd-gallery { flex: 0 0 calc(50% - 44px); min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pd-gallery__main { height: 480px; display: flex; align-items: center; justify-content: center; background: #fff; }
.pd-gallery__main img { max-height: 100%; object-fit: contain; }
.pd-gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.pd-thumb { height: 84px; padding: 4px; border: 1px solid var(--pd-line-strong); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 12px/1 "Roboto", sans-serif; color: var(--color-gray-dark, #666); text-decoration: none; }
.pd-thumb img { max-height: 100%; object-fit: contain; }
.pd-thumb.is-active { border-color: var(--pd-red); }
.pd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.pd-info__heading { display: flex; flex-direction: column; gap: 12px; }
.pd-info h1 { font-size: 48px; }
.pd-info__subtitle { font-size: 20px; font-weight: 500; line-height: 1.2; }
.pd-info__intro { font-size: 16px; line-height: 1.4; color: var(--pd-text-2); }
.pd-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 20px 0; border-block: 1px solid var(--pd-line); }
.pd-facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding-right: 12px; }
.pd-facts dd { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.2; }
.pd-facts dd.is-highlight { color: var(--pd-red); }
.pd-facts dt { font-size: 12px; line-height: 1.4; color: var(--color-gray-dark, #666); }
.pd-capacity { display: flex; flex-direction: column; gap: 12px; }
.pd-capacity__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pd-capacity__head p { font-size: 16px; font-weight: 500; color: var(--pd-text-2); }
.pd-capacity__head a { font-size: 15px; color: var(--color-gray-dark, #666); }
.pd-capacity__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pd-pill { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--pd-line-strong); background: #fff; text-decoration: none; color: #000; transition: border-color .3s ease; }
.pd-pill strong { font-size: 16px; font-weight: 500; line-height: 1.2; }
.pd-pill span { font-size: 12px; line-height: 1.35; color: var(--pd-text-2); }
.pd-pill:hover { border-color: #000; }
.pd-pill.is-active { border: 2px solid var(--pd-red); }
.pd-price { display: flex; flex-direction: column; gap: 4px; }
.pd-price p { font-size: 12px; line-height: 1.4; color: var(--color-gray-dark, #666); }
.pd-price strong { font-size: 28px; font-weight: 500; line-height: 1.2; }
.pd-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pd-links { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.pd-links a { padding: 6px 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: #000; }
.pd-links a:hover { color: var(--pd-red); }
.pd-warranty { font-size: 12px; line-height: 1.4; color: var(--color-gray-dark, #666); }

/* Điều hướng trong trang */
.pd-subnav { position: sticky; top: 80px; z-index: 50; display: flex; gap: 40px; padding: 0 var(--pd-gutter); background: #fff; border-block: 1px solid var(--pd-line); overflow-x: auto; }
.pd-subnav a { padding: 20px 0 18px; font-size: 16px; font-weight: 500; line-height: 1; color: var(--color-gray-dark, #666); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.pd-subnav a:hover { color: #000; }
.pd-subnav a.is-active { color: #000; border-bottom-color: var(--color-red, #f00); }
.pd section[id] { scroll-margin-top: 140px; }

/* Công nghệ (nền đen) */
.pd-tech, .pd-story, .pd-more, .pd-ai, .pd-support { background: #000; color: #fff; }
.pd section.pd-tech, .pd section.pd-story, .pd section.pd-more, .pd section.pd-ai, .pd section.pd-support { max-width: none; }
.pd-tech > *, .pd-story > *, .pd-more > *, .pd-support > * { width: 100%; max-width: var(--max-width, 1440px); margin-inline: auto; }
.pd-tech { padding: 80px var(--pd-gutter) 56px; display: flex; flex-direction: column; }
.pd-tech__opening { max-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; margin-bottom: 40px; }
.pd-tech__opening h2 { font-size: 48px; }
.pd-tech__opening > p:last-child { max-width: 560px; font-size: 16px; line-height: 1.4; color: var(--pd-text-on-dark); }
.pd-tech__banner { width: 100vw; max-width: none !important; margin-inline: calc(50% - 50vw) !important; height: 440px; object-fit: cover; }
.pd-tech__list { list-style: none; width: 100%; padding: 0; margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.pd-tech__list li { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.2); }
.pd-tech__list h3, .pd-card-dark h3, .pd-tile h3 { font-size: 28px; }
.pd-tech__list p, .pd-card-dark p:not(.pd-label), .pd-tile p { font-size: 16px; line-height: 1.4; color: var(--pd-text-on-dark); }
.pd-story { padding: 56px var(--pd-gutter) 64px; display: flex; flex-direction: column; gap: 64px; }
.pd-story__lead { width: 100%; display: flex; align-items: center; gap: 64px; }
.pd-story__media { flex: 0 0 calc(50% - 8px); height: 448px; display: flex; align-items: center; justify-content: center; }
.pd-story__media img { max-height: 100%; object-fit: contain; }
.pd-story__content { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.pd-story__content h2 { font-size: 48px; }
.pd-story__content > p:last-child { max-width: 560px; font-size: 18px; line-height: 1.4; color: var(--pd-text-on-dark); }
.pd-story__grid, .pd-more__grid { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pd-card-dark { display: flex; flex-direction: column; gap: 16px; }
.pd-card-dark__media { height: 300px; display: flex; align-items: center; justify-content: center; background: #fff; }
.pd-card-dark__media img { max-height: 100%; object-fit: contain; }
.pd-more { padding: 0 var(--pd-gutter) 80px; display: flex; flex-direction: column; gap: 40px; }
.pd-more .pd-heading, .pd-support .pd-heading { width: 100%; }
.pd-tile { display: flex; flex-direction: column; gap: 12px; }
.pd-tile img { width: 100%; aspect-ratio: 448 / 280; object-fit: cover; margin-bottom: 12px; }

/* Thông số */
.pd section.pd-specs { max-width: none; background: #f6f6f6; padding: 80px var(--pd-gutter); }
.pd-specs > * { max-width: var(--max-width, 1440px); margin-inline: auto; }
.pd-specs .pd-heading { margin-bottom: 40px; }
.pd-specs__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.pd-specs__table { margin: 0; background: #fff; }
.pd-specs__table > div { display: flex; align-items: center; gap: 24px; min-height: 56px; padding: 18px 24px; border-bottom: 1px solid var(--pd-line); }
.pd-specs__table dt { flex: 1; font-size: 16px; line-height: 1.2; color: var(--color-gray-dark, #666); }
.pd-specs__table dd { flex: 0 0 260px; margin: 0; font-size: 16px; font-weight: 500; line-height: 1.2; }

/* Trợ lý AI */
.pd-ai { padding: 80px var(--pd-gutter) 64px; }
.pd-ai { display: flex; justify-content: center; }
/* Hai cột + khoảng cách 64px = đúng 1440px, thẳng lề với các khối khác. */
.pd-ai__copy, .pd-ai__panel { flex: 1; max-width: calc((var(--max-width, 1440px) - 64px) / 2); }
.pd-ai { gap: 64px; align-items: center; }
.pd-ai__copy { display: flex; flex-direction: column; gap: 24px; }
.pd-ai__copy h2 { font-size: 48px; }
.pd-ai__copy > p:last-child { max-width: 560px; font-size: 16px; line-height: 1.4; color: var(--pd-text-on-dark); }
.pd-ai__panel { display: flex; flex-direction: column; gap: 20px; padding: 28px 32px; background: #151515; }
.pd-ai__panel h3 { font-size: 24px; }
.pd-ai__panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pd-ai button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; padding: 4px 0; border: 0; background: none; font: 400 14px/1.4 "Roboto", sans-serif; color: var(--pd-text-on-dark); text-align: left; cursor: pointer; }
.pd-ai button img { transition: transform .3s ease; }
.pd-ai button:hover { color: #fff; }
.pd-ai button:hover img { transform: translateX(6px); }
.pd-ai .pd-ai__ask { padding: 16px; border: 1px solid #4d4d4d; background: #222; font-size: 16px; }
.pd-ai__note { font-size: 12px; line-height: 1.4; color: var(--pd-text-on-dark); }

/* Hỗ trợ */
.pd-support { padding: 16px var(--pd-gutter) 80px; display: flex; flex-direction: column; gap: 40px; }
.pd-support__grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.pd-support__grid a { min-height: 154px; display: flex; flex-direction: column; gap: 8px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.2); color: #fff; text-decoration: none; transition: border-color .3s ease; }
.pd-support__grid a:hover { border-top-color: var(--pd-red-on-dark); }
.pd-support__grid strong { font-size: 24px; font-weight: 500; line-height: 1.2; }
.pd-support__grid span { font-size: 16px; line-height: 1.4; color: var(--pd-text-on-dark); }

/* Sổ tay, sản phẩm liên quan */
.pd-handbook { padding: 80px var(--pd-gutter) 0; }
.pd-related { padding: 80px var(--pd-gutter); }
.pd-handbook .pd-heading, .pd-related .pd-heading { margin-bottom: 40px; }
.pd-handbook__grid { display: grid; grid-template-columns: 3fr 2fr 2fr; gap: 24px; }
.pd-article { display: flex; flex-direction: column; gap: 12px; color: #000; text-decoration: none; }
.pd-article img { width: 100%; height: 320px; object-fit: cover; margin-bottom: 4px; }
.pd-article time { font-size: 12px; color: var(--color-gray-dark, #666); }
.pd-article h3 { font-size: 20px; }
.pd-related__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pd-product-card { display: flex; flex-direction: column; gap: 8px; color: #000; text-decoration: none; }
.pd-product-card__media { height: 240px; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; background: #fff; border-top: 1px solid var(--pd-line); }
.pd-product-card__media img { max-height: 100%; object-fit: contain; transition: transform .3s ease; }
.pd-product-card:hover img { transform: scale(1.03); }
.pd-product-card h3 { font-size: 28px; }
.pd-product-card__price { font-size: 16px; line-height: 1.4; color: var(--color-gray-dark, #666); }
.pd-product-card:hover .pd-more-link, .pd-article:hover .pd-more-link { color: var(--pd-red); }
.pd-index__intro { max-width: 640px; font-size: 16px; line-height: 1.4; color: var(--pd-text-2); }
.pd-index__cats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

/* Màn hình nhỏ */
@media (max-width: 1200px) {
  .pd-subnav { top: 0; }
}
@media (max-width: 992px) {
  .pd-heading h2, .pd-heading h1, .pd-info h1, .pd-brand__title, .pd-tech__opening h2, .pd-story__content h2, .pd-ai__copy h2 { font-size: 32px; }
  .pd-brand__head, .pd-hero, .pd-story__lead, .pd-ai { flex-direction: column; align-items: stretch; }
  .pd-brand__note { width: auto; }
  .pd-brand__media { height: 320px; }
  .pd-brand__media p { left: 24px; bottom: 24px; }
  .pd-hero { gap: 32px; padding-block: 32px; }
  .pd-gallery { flex-basis: auto; }
  .pd-gallery__main { height: 320px; }
  .pd-story__media { flex-basis: auto; height: 280px; }
  .pd-tech__list, .pd-support__grid, .pd-related__grid { grid-template-columns: repeat(2, 1fr); }
  .pd-story__grid, .pd-more__grid, .pd-specs__cols, .pd-handbook__grid { grid-template-columns: 1fr; }
  .pd-tech__banner { height: 240px; }
  .pd-specs__table dd { flex-basis: 45%; }
  .pd-heading--row { flex-direction: column; align-items: flex-start; }
  .pd-ai__copy, .pd-ai__panel { max-width: none; }
}
@media (max-width: 576px) {
  .pd-tech__list, .pd-support__grid, .pd-related__grid, .pd-facts { grid-template-columns: 1fr; }
  .pd-facts > div { padding-block: 8px; }
  .pd-specs__table > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pd-specs__table dd { flex-basis: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .pd * { transition: none !important; }
}

/* Giữ nút đúng kích thước nội dung và mũi tên đúng tỉ lệ khi dùng class nút của trang chủ */
.pd .btn-primary, .pd .btn-outline { width: auto; flex: none; }
.pd .btn-primary img, .pd .btn-outline img, .pd-ai button img { width: 20px; height: 14px; flex: none; }

/* Menu chính có mục con (quản lý trong CMS: Menu chính) */
.header .nav-group { position: relative; display: flex; }
.header .nav-item.is-current { color: var(--color-red, #f00); }
.header .nav-group > .nav-item::after { content: ""; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.header .nav-dropdown { position: absolute; top: 100%; left: 0; z-index: 110; min-width: 280px; display: none; flex-direction: column; padding: 8px 0; background: #fff; border: 1px solid var(--border-color, #e1e1e1); border-top: 2px solid var(--color-red, #f00); box-shadow: 0 12px 24px rgba(0, 0, 0, .08); }
.header .nav-group:hover .nav-dropdown, .header .nav-group:focus-within .nav-dropdown { display: flex; }
.header .nav-dropdown a { padding: 12px 20px; font-size: 15px; font-weight: 500; line-height: 1.35; color: #000; text-decoration: none; white-space: nowrap; transition: color .3s ease, background .3s ease; }
.header .nav-dropdown a:hover, .header .nav-dropdown a:focus-visible { color: var(--color-red, #f00); background: #f5f5f5; }
@media (max-width: 1200px) {
  .header .nav-group { flex-direction: column; align-items: stretch; }
  .header .nav-group > .nav-item::after { display: none; }
  .header .nav-dropdown { position: static; display: flex; min-width: 0; padding: 0 0 8px 16px; border: 0; box-shadow: none; }
  .header .nav-dropdown a { padding: 10px 16px; white-space: normal; }
}
