/* ==========================================
   File: shop.css
   Nạp ở: trang sản phẩm, danh mục sản phẩm
   Gồm: product-loop (lưới của vòng lặp WooCommerce), product-single
   Chưa có: lookup-table (bảng tra quy cách, chờ chốt phạm vi H8, Hạ tầng code mục 9.1)
   Biến: --dms-* của DMS Core; --ttbd-* khai báo ở site.css. Không gõ mã màu ở file này.
   Ghi chú: mẫu templates/product-sections.php, product-photos.php, product-badges.php, faq.php, product-quote-card.php,
            product-specs-aside.php (0.3.1). Khối bọc ảnh và cột thông tin ttbd-product-top (0.3.2). Giá và nút Nhận báo giá
            do Core in và tự style (dms-price, dms-quote-button).
   Phiên bản: 0.3.15 | Cập nhật: 2026-12-06
   ========================================== */

/* ------------------------------------------
   Thành phần: product-loop (vòng lặp WooCommerce ở danh mục, sản phẩm cùng loại dùng lưới ttbd-products)
   Dùng ở: danh mục sản phẩm, trang sản phẩm (Sản phẩm cùng loại)
   Ghi chú: inc/product-card.php thêm class ttbd-products vào ul.products. Bỏ float, độ rộng của woocommerce-layout.css
            bằng bộ chọn có độ ưu tiên cao hơn của WooCommerce, không dùng !important.
   ------------------------------------------ */
:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products {
	margin: 0;
	padding: 0;
	list-style: none;
}

:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products::before,
:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products::after {
	content: none;
}

:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products li.product {
	width: auto;
	float: none;
	margin: 0;
	padding: 0;
}

.ttbd-products > li.product > .ttbd-product-card {
	height: 100%;
}

/* Số cột, khoảng cách của lưới sản phẩm do theme con quyết theo thiết kế (máy tính 4 cột cách 24px; tablet, điện thoại
   2 cột cách 16px), không phụ thuộc ô số cột, khoảng cách trong Customizer của GP Premium (0.3.5). Bộ chọn mạnh hơn
   .wc-related-upsell-mobile-columns-1 .related ul.products và .wc-columns-container.wc-mobile-columns-1 .products của GP. */
.woocommerce .related ul.products.ttbd-products,
.woocommerce .wc-columns-container ul.products.ttbd-products,
:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ttbd-space-6);
}

/* Sản phẩm cùng loại: một khối như các phần trên, cách trên dưới 64px (điện thoại 48px). Nền Bg-Surface hết bề ngang
   màn hình (Design system 9.4 dòng 7; 0.3.7), nội dung vẫn trong khung. */
.single-product .related.products {
	clear: both;
	padding: var(--ttbd-space-16) 0;
	background: var(--dms-color-surface);
	box-shadow: 0 0 0 100vmax var(--dms-color-surface);
	clip-path: inset(0 -100vmax);
}

.related.products > .ttbd-section-title {
	margin-top: 0;
}

/* Tiêu đề và link "Xem tất cả <danh mục> →" cùng một hàng (0.3.4), dùng khung ttbd-post-list__head của common.css. */
.ttbd-related__head .ttbd-section-title {
	margin: 0;
}

/* Bài viết hướng dẫn cuối trang sản phẩm (Element E11, hi-fi Sản phẩm chi tiết): thẻ bài không có đoạn tóm tắt, dòng ngày
   không kẻ trên, cách tiêu đề 4px. */
.single-product .ttbd-post-card__excerpt {
	display: none;
}

.single-product .ttbd-post-card__date {
	padding-top: var(--ttbd-space-1);
	border-top: 0;
}

/* ------------------------------------------
   Thành phần: ttbd-product-single (Trang sản phẩm: nhãn và bảng rút gọn C30, thanh tab C31, 4 phần, ảnh thực tế C32)
   Dùng ở: trang sản phẩm
   Biến: --dms-color-border, --dms-color-surface, --ttbd-color-soft, --ttbd-color-primary, --dms-color-action,
         --ttbd-color-link, --dms-color-text, --dms-color-text-2, --ttbd-grid-line-light
   JS: tabs.js (tô phần đang xem trên thanh tab), gallery.js (mở ảnh thực tế, chưa viết)
   HTML: tiêu đề 4 phần và nhãn trên thanh tab là thẻ p, không phải heading (TTBD-C01).
   ------------------------------------------ */

/* Nhãn và bảng rút gọn dưới tên sản phẩm. */
.ttbd-product-badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ttbd-space-2);
	margin: var(--ttbd-space-4) 0 0;
}

/* Giá: thiết kế không hiện dòng "Liên hệ" (QD-002); Giá tham khảo của Core vẫn hiện. */
.single-product .summary .dms-price--contact {
	display: none;
}

.ttbd-product-cat {
	margin: 0 0 var(--ttbd-space-2);
}

.ttbd-product-cat a {
	color: inherit;
	text-decoration: none;
}

.ttbd-product-keys {
	margin: var(--ttbd-space-4) 0 0;
	border-top: 1px solid var(--dms-color-border);
}

.ttbd-product-keys > div {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: var(--ttbd-space-3);
	padding: var(--ttbd-space-3) 0;
	border-bottom: 1px solid var(--dms-color-border);
	font-size: 16px;
}

.ttbd-product-keys dt {
	color: var(--dms-color-text-2);
	font-weight: 600;
}

.ttbd-product-keys dd {
	margin: 0;
	color: var(--dms-color-text);
	font-weight: 600;
}

.ttbd-product-keys__more {
	margin: var(--ttbd-space-3) 0 var(--ttbd-space-6);
	font-size: 15px;
}

.ttbd-product-keys__more a {
	color: var(--ttbd-color-link);
	font-weight: 700;
}

/* Tên sản phẩm (H1) theo Design system 4.3 dòng 1: 64 / 52 / 40px, đậm 800, dòng 1.1, màu Text-Heading (0.3.7; trước
   đó 30 - 44px, chữ đen theo hi-fi). Cách nhãn bên dưới 24 / 20 / 16px (margin-top của nhãn). */
.single-product .summary .product_title {
	margin: 0;
	color: var(--ttbd-color-primary);
	font-size: 64px;
	line-height: 1.1;
}

.single-product .summary .product_title + .ttbd-product-badges {
	margin-top: var(--ttbd-space-6);
}

/* Mốc dính dùng chung của trang sản phẩm (0.3.14, TTBD-K53). Một chỗ khai báo chiều cao, các khối dính và điểm cuộn
   tính từ đây, đổi header thì chỉ sửa ở đây:
   - --ttbd-head-h: header dính của GP. Máy tính 76px (M49, site.css giữ 76px khi dính), tablet 76px (header di động
     tablet, site.css), điện thoại 60px.
   - --ttbd-ab-h: thanh quản trị WordPress khi đăng nhập: 32px từ 783px, 46px từ 601 đến 782px; từ 600px trở xuống thanh
     quản trị không cố định (cuộn đi cùng trang) nên 0. Khách không có lớp admin-bar nên 0.
   - --ttbd-tabs-h: thanh tab cả 2 đường kẻ 1px: 62px, điện thoại 54px (dòng tab 60px, 52px).
   Đo trên site 0.3.13 (đăng nhập): thanh tab nằm dưới header 12px ở 783 đến 1440px, 46 đến 58px ở 601 đến 782px.
   Điểm cuộn tới phần (scroll-margin-top) không cộng thanh quản trị: khi đăng nhập WordPress đã đặt
   html { scroll-padding-top: 32px / 46px } nên cộng thêm là tính hai lần (đo trên site: lệch 32px, điện thoại 46px). */
.single-product {
	--ttbd-head-h: 76px;
	--ttbd-ab-h: 0px;
	--ttbd-tabs-h: 62px;
	--ttbd-stick-top: calc(var(--ttbd-head-h) + var(--ttbd-ab-h));
}

.single-product.admin-bar {
	--ttbd-ab-h: 32px;
}

@media (max-width: 782px) {
	.single-product.admin-bar {
		--ttbd-ab-h: 46px;
	}
}

@media (max-width: 767px) {
	.single-product {
		--ttbd-head-h: 60px;
		--ttbd-tabs-h: 54px;
	}
}

@media (max-width: 600px) {
	.single-product.admin-bar {
		--ttbd-ab-h: 0px;
	}
}

/* Thanh tab dính dưới header, bấm cuộn tới 4 phần; phần trống thì không có tab. */
.ttbd-anchor-nav {
	position: sticky;
	top: var(--ttbd-stick-top);
	z-index: 150;
	border-top: 1px solid var(--dms-color-border);
	border-bottom: 1px solid var(--dms-color-border);
	background: var(--dms-color-bg);
}

.ttbd-anchor-nav__list {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--ttbd-space-6);
	scrollbar-width: none;
}

.ttbd-anchor-nav__list::-webkit-scrollbar {
	display: none;
}

.ttbd-anchor-nav__link {
	display: flex;
	flex: none;
	align-items: center;
	gap: var(--dms-fe-space-s);
	height: 60px;
	padding: 0 var(--ttbd-space-6);
	border-bottom: 3px solid transparent;
	color: var(--dms-color-text-2);
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
}

.ttbd-anchor-nav__link:hover,
.ttbd-anchor-nav__link.is-active {
	color: var(--ttbd-color-primary);
}

.ttbd-anchor-nav__link.is-active {
	border-bottom-color: var(--dms-color-action);
}

.ttbd-anchor-nav__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 var(--ttbd-space-2);
	border-radius: 12px;
	background: var(--dms-color-surface);
	color: var(--ttbd-n-700);
	font-size: 12px;
	font-weight: 700;
}

/* 4 phần nối tiếp: Mô tả (trắng), Thông số (xám lưới bản vẽ), Ảnh thực tế (trắng), Câu hỏi (xám nhạt). */
.ttbd-product-section {
	padding: var(--ttbd-space-16) 0;
	background: var(--dms-color-bg);
	scroll-margin-top: calc(var(--ttbd-head-h) + var(--ttbd-tabs-h) + var(--ttbd-space-4));
}

.ttbd-product-section__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--ttbd-space-6);
}

.ttbd-product-section--specs {
	background-color: var(--dms-color-surface);
	background-image: linear-gradient(var(--ttbd-grid-line-light) 1px, transparent 1px), linear-gradient(90deg, var(--ttbd-grid-line-light) 1px, transparent 1px);
	background-size: 24px 24px;
}

.ttbd-product-section--faq {
	border-top: 1px solid var(--dms-color-border);
	border-bottom: 1px solid var(--dms-color-border);
	background: var(--ttbd-color-soft);
}

/* Tiêu đề khối giao diện giữ kiểu chữ H2 (Design system 4.3 dòng 2, 4.4): 40 / 34 / 30px, cách dưới 20 / 16 / 16px. */
.ttbd-section-title {
	margin: 0 0 var(--ttbd-space-5);
	color: var(--ttbd-color-primary);
	font-size: 40px;
	font-stretch: 75%;
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
}

.ttbd-product-section--plain {
	background: var(--dms-color-bg);
}

.ttbd-section-title:has(+ .ttbd-product-section__lead) {
	margin-bottom: var(--ttbd-space-2);
}

.ttbd-product-section__lead {
	max-width: 760px;
	margin: 0 0 var(--ttbd-space-6);
	color: var(--dms-color-text-2);
}

.ttbd-product-section--desc .ttbd-eyebrow {
	margin: 0 0 var(--ttbd-space-4);
}

/* Chữ trong ô Mô tả (người quản lý tự soạn): bỏ khoảng 1.5em của GeneratePress, theo thang 4px (Design system 6.2). */
.ttbd-product-section--desc .ttbd-product-section__content > * {
	margin-top: 0;
	margin-bottom: var(--ttbd-space-4);
}

.ttbd-product-section--desc .ttbd-product-section__content > :last-child {
	margin-bottom: 0;
}

.ttbd-product-section--desc .ttbd-product-section__content h2 {
	margin-bottom: var(--ttbd-space-5);
	color: var(--ttbd-color-primary);
	font-size: 40px;
	font-stretch: 75%;
	font-weight: 800;
	line-height: 1.1;
	text-transform: uppercase;
}

.ttbd-product-section--desc .ttbd-product-section__content * + h2 {
	margin-top: var(--ttbd-space-8);
}

/* H3 trong bài: chữ thường 24 / 22 / 20px, đậm 700, dòng 1.3, Text-Primary, cách dưới 12px (Design system 4.3 dòng 3). */
.ttbd-product-section--desc .ttbd-product-section__content h3 {
	margin-bottom: var(--ttbd-space-3);
	color: var(--dms-color-text);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

.ttbd-product-section--desc .ttbd-product-section__content * + h3 {
	margin-top: var(--ttbd-space-6);
}

.ttbd-product-section--desc .ttbd-product-section__content :is(ul, ol) {
	margin-left: 0;
	padding-left: var(--ttbd-space-6);
}

.ttbd-product-section--desc .ttbd-product-section__content li + li {
	margin-top: var(--ttbd-space-2);
}

/* Bảng trong ô Mô tả (bảng trọng lượng) theo "Bảng quy cách" (Design system 8.6): dòng tiêu đề nền Bg-Inverse chữ
   trắng, hàng chẵn Bg-Soft, viền Border-Default, số cùng độ rộng. Điện thoại: bảng cuộn ngang trong khung. */
.ttbd-product-section--desc .ttbd-product-section__content table {
	width: 100%;
	border: 1px solid var(--dms-color-border);
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.ttbd-product-section--desc .ttbd-product-section__content :is(th, td) {
	padding: var(--ttbd-space-3) var(--ttbd-space-4);
	border: 1px solid var(--dms-color-border);
	text-align: left;
	vertical-align: top;
}

.ttbd-product-section--desc .ttbd-product-section__content th {
	border-color: var(--ttbd-color-primary);
	background: var(--ttbd-color-primary);
	color: var(--ttbd-inverse);
	font-weight: 700;
}

.ttbd-product-section--desc .ttbd-product-section__content tbody tr:nth-child(even) td {
	background: var(--ttbd-color-soft);
}

.ttbd-product-section--desc .ttbd-product-section__content {
	max-width: 720px;
}

/* Lưới 8/12 và 4/12 cho Mô tả, Thông số (thiết kế v1.2): mép phải của Mô tả, bảng Thông số, Câu hỏi thẳng một đường. */
.ttbd-product-section__grid {
	display: grid;
	grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
	gap: 24px;
	align-items: start;
}

.ttbd-product-section__grid > .ttbd-product-section__content {
	max-width: none;
}

/* Vùng chữ Mô tả tối đa 720px (Design system 9.4; 0.3.14, CV-005-03): lưới 8/12 làm cột rộng 752px ở máy tính. Cột thẻ
   báo giá giữ nguyên; phần dư nằm giữa chữ và thẻ. */
.ttbd-product-section--desc .ttbd-product-section__grid > .ttbd-product-section__content {
	max-width: 720px;
}

.ttbd-product-section--faq .ttbd-product-section__content {
	max-width: min(720px, calc((100% - 24px) * 2 / 3));
}

/* Thẻ báo giá cạnh Mô tả: dính dưới header và thanh tab, cách 16px (0.3.14: theo mốc dính chung). */
.ttbd-product-quote {
	position: sticky;
	top: calc(var(--ttbd-stick-top) + var(--ttbd-tabs-h) + var(--ttbd-space-4));
}

.ttbd-product-quote__box {
	padding: var(--ttbd-space-5);
	border: 1px solid var(--dms-color-border);
	border-top: 4px solid var(--ttbd-color-primary);
	background: var(--ttbd-color-soft);
}

.ttbd-product-quote__label {
	display: block;
	color: var(--dms-color-text-2);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ttbd-product-quote__name {
	margin: var(--ttbd-space-1) 0 0;
	color: var(--ttbd-color-primary);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
}

.ttbd-product-badges.ttbd-product-quote__tags {
	margin: var(--ttbd-space-3) 0 0;
}

.ttbd-product-quote__btn {
	display: flex;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: var(--ttbd-space-3);
}

.ttbd-product-quote__tags + .ttbd-product-quote__btn {
	margin-top: var(--ttbd-space-5);
}

.ttbd-product-quote__note {
	margin: 12px 0 0;
	color: var(--ttbd-n-700);
	font-size: 14px;
	line-height: 1.5;
}

.ttbd-product-quote__note a,
.ttbd-specs-aside__check b {
	color: var(--ttbd-color-link);
	font-weight: 700;
}

/* Ô "Dịch vụ đi kèm" dưới nút Nhận báo giá ([ttbd_dich_vu] trong Element E10; 0.3.11). Số đo giữ đúng khối GB cũ. */
.ttbd-services__list {
	display: flex;
	flex-direction: column;
	gap: var(--ttbd-space-3);
	margin: var(--ttbd-space-6) 0 0;
	padding: var(--ttbd-space-4) var(--ttbd-space-5);
	border: 1px solid var(--dms-color-border);
	background: var(--ttbd-color-soft);
	list-style: none;
}

.ttbd-services__item {
	display: flex;
	gap: var(--ttbd-space-3);
	align-items: flex-start;
	margin: 0;
}

.ttbd-services__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--dms-fe-radius);
	background: var(--ttbd-color-primary);
	color: var(--ttbd-inverse);
}

.ttbd-services__name {
	margin: 0;
	color: var(--ttbd-color-primary);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.ttbd-services__desc {
	margin: var(--ttbd-space-1) 0 0;
	color: var(--dms-color-text-2);
	font-size: 14px;
	line-height: 1.5;
}

.ttbd-services__more {
	display: inline-block;
	margin-top: var(--ttbd-space-3);
	color: var(--ttbd-color-link);
	font-size: 14px;
	font-weight: 700;
}

/* Cột phải phần Thông số: ô Kiểm hàng khi nhận, ô Cần quy cách khác. */
.ttbd-specs-aside {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ttbd-specs-aside__check,
.ttbd-specs-aside__ask {
	padding: var(--ttbd-space-5);
	border: 1px solid var(--dms-color-border);
	background: var(--dms-color-bg);
	font-size: 15px;
	line-height: 1.5;
}

.ttbd-specs-aside__check {
	display: flex;
	gap: var(--ttbd-space-3);
	align-items: center;
	padding: var(--ttbd-space-4) var(--ttbd-space-5);
	border-left: 4px solid var(--ttbd-color-primary);
	color: var(--ttbd-n-700);
	text-decoration: none;
}

/* Viền trái 4px, biểu tượng và tiêu đề xanh đậm, rê chuột tiêu đề xanh (Sản phẩm chi tiết hi-fi v1.4, .chk; 0.3.11). */
.ttbd-specs-aside__check b {
	display: block;
	color: var(--ttbd-color-primary);
	font-size: 16px;
}

.ttbd-specs-aside__check:hover {
	color: var(--ttbd-n-700);
}

.ttbd-specs-aside__check:hover b {
	color: var(--ttbd-color-link);
}

.ttbd-specs-aside__check svg {
	flex: none;
	color: var(--ttbd-color-primary);
}

.ttbd-specs-aside__ask .ttbd-specs-aside__title {
	margin: 0;
	color: var(--ttbd-color-primary);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.65;
}

.ttbd-specs-aside__ask p {
	margin: var(--ttbd-space-1) 0 var(--ttbd-space-3);
	color: var(--dms-color-text-2);
	line-height: 1.55;
}

/* Thông số: bảng thuộc tính do WooCommerce in (table.shop_attributes), đặt trong khung nền trắng. */
.ttbd-product-section--specs table.shop_attributes {
	width: 100%;
	margin: 0;
	border: 1px solid var(--dms-color-border);
	border-collapse: collapse;
	background: var(--dms-color-bg);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.ttbd-product-section--specs table.shop_attributes th {
	width: 42%;
	padding: var(--ttbd-space-3) var(--ttbd-space-4);
	border-top: 1px solid var(--dms-color-border);
	background: transparent;
	color: var(--dms-color-text-2);
	font-weight: 600;
	text-align: left;
	vertical-align: top;
}

.ttbd-product-section--specs table.shop_attributes td {
	padding: var(--ttbd-space-3) var(--ttbd-space-4);
	border-top: 1px solid var(--dms-color-border);
	color: var(--dms-color-text);
	font-weight: 600;
}

.ttbd-product-section--specs table.shop_attributes td p {
	margin: 0;
}

/* Ảnh thực tế: lưới 4 ô 4:3; trên 4 ảnh thì ô cuối phủ "+N ảnh". Mỗi ô là link tới ảnh lớn. */
.ttbd-photos {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ttbd-space-3);
	align-items: start;
}

.ttbd-photo {
	position: relative;
	display: block;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	cursor: zoom-in;
}

.ttbd-photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.25s ease-out;
}

.ttbd-photo:hover img {
	transform: scale(1.03);
}

.ttbd-photo:focus-visible {
	outline: var(--ttbd-focus);
	outline-offset: 3px;
}

.ttbd-photo[hidden] {
	display: none;
}

/* Chú thích dưới ảnh, cách ảnh 12px (Design system 6.2: ảnh và chú thích). */
.ttbd-photo__cap {
	display: block;
	margin-top: var(--ttbd-space-3);
	color: var(--dms-color-text-2);
	font-size: 14px;
	line-height: 1.5;
}

/* Lớp "+N ảnh" phủ đúng khung ảnh 4:3, không phủ phần chú thích. */
.ttbd-photo__more {
	position: absolute;
	inset: 0 0 auto;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--ttbd-color-primary) 74%, transparent);
	color: var(--ttbd-inverse);
	font-size: 26px;
	font-stretch: 75%;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* ------------------------------------------
   Thành phần: ttbd-product-single, phần bổ sung 0.3.2, chỉnh khoảng cách theo hi-fi v1.3 ở 0.3.3
   ------------------------------------------ */

/* Hai nút: Nhận báo giá (Core) và Gọi (child) chia đôi một hàng; cột hẹp thì xếp dọc, không rớt lệch. */
.single-product div.product .summary {
	container-type: inline-size;
}

.single-product .summary .dms-quote-button,
.single-product .summary .ttbd-product-call {
	box-sizing: border-box;
	min-height: 52px;
	vertical-align: top;
	white-space: nowrap;
}

/* Hai nút cách nhau 12px: 56% - 6px + 12px + 44% - 6px = 100%. */
/* Chữ trên nút 17 / 17 / 16px, khoảng trong 0 24px (Design system 4.3 dòng 21, 8.1). */
.single-product .summary .dms-quote-button {
	width: calc(56% - 6px);
	padding-right: var(--ttbd-space-6);
	padding-left: var(--ttbd-space-6);
	font-size: 17px;
}

.single-product .summary .ttbd-product-call {
	width: calc(44% - 6px);
	margin-left: var(--ttbd-space-3);
	padding: 0 var(--ttbd-space-6);
	font-size: 17px;
}

.ttbd-product-call svg {
	flex: none;
}

/* Cột thông tin hẹp hơn 500px (tablet): hai nút xếp dọc, mỗi nút hết hàng, để nút Gọi giữ khoảng trong 24px. */
@container (max-width: 500px) {
	.single-product .summary .dms-quote-button,
	.single-product .summary .ttbd-product-call {
		width: 100%;
	}

	.single-product .summary .ttbd-product-call {
		margin: var(--ttbd-space-3) 0 0;
	}
}

/* Phần đầu trang (hi-fi v1.3): cách thanh breadcrumb 32px, cách thanh tab 48px; ảnh và cột thông tin là lưới 2 cột
   bằng nhau, cách nhau 48px (Design system 6.2: giữa hai vùng chữ và ảnh). Khối bọc (ttbd_product_top_open/close)
   giữ ảnh dính chỉ trong phần đầu trang, không trôi xuống thanh tab. Bỏ float, độ rộng 48%, khoảng 2em của WooCommerce. */
.single-product.one-container .site-content {
	padding-top: var(--ttbd-space-8);
	padding-bottom: 0;
}

.ttbd-product-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--ttbd-space-12);
	align-items: start;
	padding-bottom: var(--ttbd-space-12);
}

.single-product div.product .ttbd-product-top > div.images,
.single-product div.product .ttbd-product-top > div.summary {
	float: none;
	width: auto;
	margin: 0;
}

/* GP Premium đặt bề rộng ảnh 50% bằng bộ chọn có #content (Customizer: bề rộng vùng ảnh). min-width giữ ảnh đầy ô lưới
   mà không cần bộ chọn id hay !important. */
.single-product div.product .ttbd-product-top > div.images {
	min-width: 100%;
}

.single-product div.product .ttbd-product-top > .onsale {
	display: none;
}

.single-product .summary > :last-child {
	margin-bottom: 0;
}

/* Mô tả ngắn cách nhãn 16px (hi-fi v1.3), đoạn cuối không cộng thêm khoảng. */
.single-product .summary .woocommerce-product-details__short-description {
	margin-top: var(--ttbd-space-4);
}

.single-product .summary .woocommerce-product-details__short-description > :last-child {
	margin-bottom: 0;
}

/* Ảnh nhỏ dưới ảnh chính: 4 ô, cách nhau và cách ảnh chính 12px. Khoảng cách ô là biến --ttbd-th-gap (điện thoại 8px)
   để phần giữ chỗ khi dựng (bên dưới) tính cùng một số. */
.single-product div.product div.images {
	--ttbd-th-gap: var(--ttbd-space-3);
}

.single-product div.product div.images .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--ttbd-th-gap);
	margin: var(--ttbd-space-3) 0 0;
	padding: 0;
}

.single-product div.product div.images .flex-control-thumbs li {
	float: none;
	width: auto;
	margin: 0;
}

/* GP Premium (module WooCommerce) ép ô ảnh nhỏ tối đa 100px, chừa 5px trên, phải. CSS của GP nạp SAU CSS theme con với
   bộ chọn cùng độ mạnh, nên bộ chọn ở đây thêm khối bọc .ttbd-product-top (0.3.8; bản 0.3.6, 0.3.7 thua thứ tự nạp). */
.single-product div.product .ttbd-product-top div.images .flex-control-thumbs li {
	max-width: none;
	padding: 0;
}

/* Khung ảnh trong lúc WooCommerce dựng thư viện ảnh (0.3.13, lỗi L4; 0.3.14 tính đủ số hàng, TTBD-K50). WooCommerce in
   sẵn style="opacity: 0" lên khung, JS đổi thành 1 khi xong. Giữa chừng, thư viện ảnh (flexslider) bọc ảnh vào một dải
   rộng nhiều lần khung nhưng chưa đặt bề rộng từng ảnh, nên ảnh xếp chồng cao tới 5.500px trong khoảng 0,1 giây: phần
   dưới trang bị đẩy đi rồi kéo về (CLS 0,16 trên máy tính, lớn hơn trên điện thoại). Trong lúc đó giữ khung đúng chiều
   cao cuối: ảnh chính vuông (bề rộng khung) + 12px + số hàng ảnh nhỏ x (ô ảnh nhỏ + khoảng cách hàng).
   - Số hàng --ttbd-th-rows đếm theo số ảnh WooCommerce đã in trong khung: 1 ảnh không có hàng ảnh nhỏ; 2 đến 4 ảnh một
     hàng; 5 đến 8 hai hàng; 9 đến 12 ba hàng... (lưới 4 cột). Đếm tới 40 ảnh (10 hàng); nhiều hơn thì giữ 10 hàng, phần
     dưới còn dịch một khoảng khi dựng (giới hạn ghi ở Hướng dẫn quản trị).
   - --ttbd-th-gap: khoảng cách giữa các ô ảnh nhỏ (12px, điện thoại 8px, khớp lưới .flex-control-thumbs).
   Phần trăm của padding tính theo bề rộng khung. Cần ảnh sản phẩm vuông 1:1 như thiết kế; ảnh khác tỉ lệ thì còn lệch.
   Phụ thuộc: WooCommerce in style="opacity: 0" rồi đổi thành 1 (kiểm lại khi cập nhật WooCommerce); trình duyệt có :has()
   (không có thì chỉ mất phần giữ chỗ, trang vẫn hiển thị đúng sau khi dựng). */
.single-product div.product .ttbd-product-top > div.images[style*="opacity: 0"] {
	--ttbd-th-rows: 0;
	height: 0;
	padding-bottom: 100%;
	overflow: hidden;
}

.single-product div.product .ttbd-product-top > div.images[style*="opacity: 0"]:has(.woocommerce-product-gallery__image:nth-child(2)) {
	padding-bottom: calc(100% + var(--ttbd-space-3) + (var(--ttbd-th-rows) - 1) * var(--ttbd-th-gap) + var(--ttbd-th-rows) * (100% - 3 * var(--ttbd-th-gap)) / 4);
}

/* Số hàng: các quy tắc cùng độ mạnh, quy tắc sau (nhiều ảnh hơn) thắng. */
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(2)) { --ttbd-th-rows: 1; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(5)) { --ttbd-th-rows: 2; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(9)) { --ttbd-th-rows: 3; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(13)) { --ttbd-th-rows: 4; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(17)) { --ttbd-th-rows: 5; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(21)) { --ttbd-th-rows: 6; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(25)) { --ttbd-th-rows: 7; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(29)) { --ttbd-th-rows: 8; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(33)) { --ttbd-th-rows: 9; }
.single-product div.product .ttbd-product-top > div.images:has(.woocommerce-product-gallery__image:nth-child(37)) { --ttbd-th-rows: 10; }

@media (min-width: 1025px) {
	.single-product div.product div.images.woocommerce-product-gallery {
		position: sticky;
		top: calc(var(--ttbd-stick-top) + var(--ttbd-space-6));
	}
}

/* Thanh tab và 4 phần chạy hết bề ngang màn hình, nội dung vẫn trong khung 1200px. --ttbd-sbw là bề rộng thanh cuộn
   (header.js đo), để dải không lố sang phải gây cuộn ngang. */
.single-product .ttbd-anchor-nav,
.single-product .ttbd-product-section {
	clear: both;
	margin-right: calc(50% - 50vw + var(--ttbd-sbw, 0px) / 2);
	margin-left: calc(50% - 50vw + var(--ttbd-sbw, 0px) / 2);
}

/* Thanh quản trị: đã tính trong --ttbd-ab-h ở đầu file (0.3.14 bỏ các mốc 96, 172, 120px riêng). */

/* Bảng thông số: chữ đứng, đậm, nhãn và giá trị cùng hàng (bỏ kiểu nghiêng, đường chấm của WooCommerce). Màn hẹp
   WooCommerce (woocommerce-smallscreen.css) xếp nhãn trên giá trị và đổi khoảng 0.5em: giữ 2 cột, 12px 16px như hi-fi.
   0.3.7: giữ hàng là hàng của bảng và cột nhãn cố định 42% (trước đó mỗi hàng tự co nên cột nhãn lệch nhau ở tablet,
   điện thoại); hàng chẵn nền Bg-Soft, cột nhãn không tô nền (Design system 8.6, Bảng quy cách). */
.woocommerce .ttbd-product-section--specs table.shop_attributes {
	display: table;
	table-layout: fixed;
}

.woocommerce .ttbd-product-section--specs table.shop_attributes tr {
	display: table-row;
}

.woocommerce .ttbd-product-section--specs table.shop_attributes tr:nth-child(odd) :is(th, td) {
	background: transparent;
}

.woocommerce .ttbd-product-section--specs table.shop_attributes tr:nth-child(even) :is(th, td) {
	background: var(--ttbd-color-soft);
}

.woocommerce .ttbd-product-section--specs table.shop_attributes tr :is(th, td) {
	display: table-cell;
	padding: var(--ttbd-space-3) var(--ttbd-space-4);
	text-align: left;
}

.woocommerce .ttbd-product-section--specs table.shop_attributes tr th {
	width: 42%;
}

.ttbd-product-section--specs table.shop_attributes th,
.ttbd-product-section--specs table.shop_attributes td {
	border-bottom: 0;
	vertical-align: middle;
}

.ttbd-product-section--specs table.shop_attributes :is(th, td) {
	font-style: normal;
	line-height: 1.65;
}

.ttbd-product-section--specs table.shop_attributes td p {
	padding: 0;
}

/* Cột phải phần Câu hỏi thường gặp (0.3.2): danh sách câu hỏi nằm trong cột 8/12 của lưới, ô bên phải dùng kiểu ô
   "Cần quy cách khác?". Câu hỏi, câu trả lời là khối chữ đọc: tối đa 720px như Mô tả (Design system 9.4; 0.3.15,
   đồng bộ với CV-005-03), mép trái thẳng với Mô tả. */
.ttbd-product-section--faq .ttbd-product-section__grid > .ttbd-product-section__content {
	max-width: 720px;
}

/* Câu trả lời nhiều đoạn, danh sách (ô FAQ kiểu VATS, 0.3.3): đoạn cách 8px, đoạn cuối không có khoảng dưới. Đặt ở
   shop.css vì common.css đã sát ngân sách; khi bài viết dùng ô FAQ thì chuyển sang common.css. */
.ttbd-faq__a > * {
	margin: 0 0 var(--ttbd-space-2);
}

.ttbd-faq__a > :last-child {
	margin-bottom: 0;
}

.ttbd-faq__a :is(ul, ol) {
	padding-left: var(--ttbd-space-6);
}

.ttbd-faq__a a {
	color: var(--ttbd-color-link);
}

.ttbd-specs-aside__ask .ttbd-faq-aside__more {
	margin: var(--ttbd-space-3) 0 0;
	font-size: 14px;
}

.ttbd-faq-aside__more a {
	color: var(--ttbd-color-link);
	font-weight: 700;
	white-space: nowrap;
}

@media (max-width: 1024px) {
	.ttbd-product-keys > div {
		grid-template-columns: 130px minmax(0, 1fr);
	}

	.ttbd-product-section__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ttbd-product-section--faq .ttbd-product-section__content {
		max-width: 720px;
	}

	.ttbd-product-quote {
		display: none;
	}

	.ttbd-specs-aside {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.ttbd-specs-aside > * {
		flex: 1 1 300px;
	}

	.ttbd-photos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ttbd-product-top {
		gap: var(--ttbd-space-8);
	}

	/* Tablet: thẻ sản phẩm 3 cột cách 16px (Design system 8.7, 6.3). */
	.woocommerce .related ul.products.ttbd-products,
	.woocommerce .wc-columns-container ul.products.ttbd-products,
	:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--ttbd-space-4);
	}

	/* Cỡ chữ tablet (Design system 4.3): H1 52px, H2 và tiêu đề khối 34px, H3 22px. */
	.single-product .summary .product_title {
		font-size: 52px;
	}

	.single-product .summary .product_title + .ttbd-product-badges {
		margin-top: var(--ttbd-space-5);
	}

	.ttbd-section-title,
	.ttbd-product-section--desc .ttbd-product-section__content h2 {
		margin-bottom: var(--ttbd-space-4);
		font-size: 34px;
	}

	.ttbd-product-section--desc .ttbd-product-section__content h3 {
		font-size: 22px;
	}
}

/* Tablet: lề hai bên 32px (Design system 6.3); khung chung GP, khối kêu gọi báo giá đặt ở site.css. */
@media (min-width: 768px) and (max-width: 1024px) {
	.ttbd-product-section__inner,
	.ttbd-anchor-nav__list {
		padding-right: var(--ttbd-space-8);
		padding-left: var(--ttbd-space-8);
	}
}

/* Tablet dọc: ảnh 5 cột, thông tin 7 cột, cách 24px; hai nút xếp dọc. */
@media (min-width: 768px) and (max-width: 899px) {
	.ttbd-product-top {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: var(--ttbd-space-6);
	}

	.single-product .summary .dms-quote-button,
	.single-product .summary .ttbd-product-call {
		width: 100%;
	}

	.single-product .summary .ttbd-product-call {
		margin: var(--ttbd-space-3) 0 0;
	}
}

@media (max-width: 767px) {
	/* Ô "Dịch vụ đi kèm": khoảng trong 16px như khối GB cũ ở điện thoại (0.3.11). */
	.ttbd-services__list {
		padding: var(--ttbd-space-4);
	}

	.ttbd-product-keys > div {
		grid-template-columns: 118px minmax(0, 1fr);
		font-size: 15px;
	}

	.ttbd-anchor-nav__list {
		gap: 0;
		padding: 0 var(--dms-fe-space-m);
	}

	.ttbd-anchor-nav__link {
		height: 52px;
		padding: 0 var(--ttbd-space-4);
		font-size: 15px;
	}

	.ttbd-product-section,
	.single-product .related.products {
		padding: var(--ttbd-space-12) 0;
		scroll-margin-top: calc(var(--ttbd-head-h) + var(--ttbd-tabs-h) + var(--ttbd-space-4));
	}

	/* Cỡ chữ điện thoại (Design system 4.3): H1 40px, H2 và tiêu đề khối 30px, H3 20px, chữ trên nút 16px. */
	.single-product .summary .product_title {
		font-size: 40px;
	}

	.single-product .summary .product_title + .ttbd-product-badges {
		margin-top: var(--ttbd-space-4);
	}

	.ttbd-section-title,
	.ttbd-product-section--desc .ttbd-product-section__content h2 {
		font-size: 30px;
	}

	.ttbd-product-section--desc .ttbd-product-section__content h3 {
		font-size: 20px;
	}

	.single-product .summary .dms-quote-button {
		font-size: 16px;
	}

	.woocommerce .related ul.products.ttbd-products,
	.woocommerce .wc-columns-container ul.products.ttbd-products,
	:is(.woocommerce, .woocommerce-page) ul.products.ttbd-products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ttbd-product-section--desc .ttbd-product-section__content table {
		display: block;
		overflow-x: auto;
	}

	.ttbd-product-section--desc .ttbd-product-section__content th {
		white-space: nowrap;
	}

	/* Phần đầu trang điện thoại: cách breadcrumb 16px, ảnh trên thông tin dưới cách 24px; lề 16px (Design system 6.3). */
	.single-product.one-container .site-content {
		padding-top: var(--ttbd-space-4);
	}

	.ttbd-product-top {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--ttbd-space-6);
		padding-bottom: var(--ttbd-space-8);
	}

	/* Thanh liên hệ đáy màn hình đã có nút Gọi: ẩn nút Gọi trong phần đầu (hi-fi). */
	.single-product .summary .ttbd-product-call {
		display: none;
	}

	.single-product .summary .dms-quote-button {
		width: 100%;
	}

	.single-product div.product div.images {
		--ttbd-th-gap: var(--ttbd-space-2);
	}

	.ttbd-product-section__inner {
		padding: 0 var(--dms-fe-space-m);
	}

	.woocommerce .ttbd-product-section--specs table.shop_attributes tr th {
		width: 46%;
	}

	.ttbd-photos {
		gap: var(--ttbd-space-3);
	}

	.ttbd-photo__more {
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ttbd-photo img {
		transition: none;
	}
}
