/* =========================================================
   Hem Product Page v2 — trang chi tiết sản phẩm
   Khung do plugin tự dựng, mọi thứ nằm trong .hem-p
   ========================================================= */

.hem-p {
	--red: #d70018;
	--red-dark: #b30014;
	--ink: #111418;
	--ink2: #3d4450;
	--ink3: #6b7280;
	--ink4: #9aa1ad;
	--line: #d8dce2;
	--line2: #e8ebf0;
	--bg: #f7f8fa;
	--green: #15803d;
	--green-bg: #e8f5ec;
	--blue: #1d4ed8;
	--blue-bg: #e8effd;
	--gold: #e8c84a;
	--r: 10px;
	--r-lg: 14px;

	/* Khoảng cách từ mép trên màn hình tới cột dính (sticky).
	   Header dính của theme cao tới mép dưới 155px -> phải lớn hơn số đó,
	   nếu không khối dính chui xuống dưới header và tưởng như không dính. */
	--sticky-top: 170px;

	display: block;
	width: 100%;
	max-width: 100%;
	float: none;
	color: var(--ink2);
	font-size: 14px;
	line-height: 1.6;

	/* Tạo lớp riêng cho toàn bộ khối sản phẩm.
	   Nhờ vậy cột dính không bao giờ trồi lên đè header cố định của Elementor/UAE. */
	position: relative;
	z-index: 0;
}

.hem-p *,
.hem-p *::before,
.hem-p *::after { box-sizing: border-box; }

.hem-p img { max-width: 100%; height: auto; }

.hem-p h1, .hem-p h2, .hem-p h3, .hem-p h4 {
	color: var(--ink);
	line-height: 1.3;
	margin: 0;
}

.hem-p ul, .hem-p ol { margin: 0; padding: 0; }
.hem-p li { list-style: none; margin: 0; }

/* Ẩn phần thừa của WooCommerce trong khung mới. */
.hem-p .woocommerce-product-gallery,
.hem-p .product_meta,
.hem-p .woocommerce-product-details__short-description,
.hem-p .woocommerce-variation-price,
.hem-p .woocommerce-variation-availability,
.hem-p .stock { display: none !important; } /* !important: Astra đặt display ở độ ưu tiên cao */

body.hem-noscroll { overflow: hidden; }

.hem-sec-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.2px;
	margin: 0 0 4px;
}

.hem-sec-sub { font-size: 13.5px; color: var(--ink3); margin: 0 0 16px; }
.hem-empty { color: var(--ink3); font-size: 14px; }

/* =========================================================
   1. KHUNG 2 CỘT
   ========================================================= */

/* Tỷ lệ cột lấy theo trang tham chiếu: ảnh ~60%, cột thông tin ~40%. */
.hem-p-top {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	margin-bottom: 32px;
}

.hem-p-media { min-width: 0; }
.hem-p-info { min-width: 0; }

/* Kéo khối sản phẩm lên sát header hơn — theme để khoảng trắng quá rộng. */
body.hem-single .hem-p { margin-top: -28px; }

/* Breadcrumb đầu trang */
.hem-crumb {
	font-size: 12.5px;
	color: var(--ink3);
	margin-bottom: 16px;
}

.hem-crumb a { color: var(--ink3); text-decoration: none; }
.hem-crumb a:hover { color: var(--red); }
.hem-crumb-sep { margin: 0 7px; color: var(--ink4); }
.hem-crumb .woocommerce-breadcrumb { margin: 0; padding: 0; font-size: inherit; color: inherit; }

/* =========================================================
   2. GALLERY — dựng theo đúng gallery trang /used/
   ========================================================= */

.hem-gal { position: relative; display: flex; flex-direction: column; gap: 12px; }

/* Khung ảnh nằm ngang (4/3) cho rộng bằng cột. Ảnh bên trong KHÔNG kéo giãn —
   xem object-fit: contain ở .hem-gal-slide img, thừa chỗ thì để trắng 2 bên. */
.hem-gal-stage {
	position: relative;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--line);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
}

/* Băng ảnh nằm ngang, đổi ảnh bằng cách trượt cả băng. */
.hem-gal-slides {
	position: absolute;
	inset: 0;
	display: flex;
	transition: transform .35s cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

.hem-gal-slide {
	position: relative;
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: zoom-in;
}

.hem-gal-slide img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain; /* giữ đúng tỷ lệ ảnh gốc, không cắt và không kéo giãn */
	object-position: center;
	display: block;
}

.hem-gal-slide--video { cursor: pointer; }
.hem-gal-video { position: relative; width: 100%; height: 100%; }
.hem-gal-video img { width: 100%; height: 100%; object-fit: cover; }
.hem-gal-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.hem-gal-play {
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	width: 66px; height: 66px;
	border: none; border-radius: 50%;
	background: rgba(215, 0, 24, .92);
	color: #fff; font-size: 22px; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	padding-left: 4px;
	z-index: 3;
}

/* Cờ giảm giá — copy đúng .hcd-main-sale-flag của trang /used/. */
.hem-gal-flag {
	position: absolute;
	top: 20px;
	left: 20px;
	z-index: 10;
	background: #d70018;
	color: #fff;
	font-size: 17px;
	padding: 9px 14px;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(215, 0, 24, .25);
	line-height: 1;
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
}

/* Hai chữ CÙNG cỡ, chỉ khác độ đậm.
   Khác cỡ thì chữ nhỏ luôn bị đội lên so với chữ to -> đây là cách hết lệch hẳn. */
.hem-gal-flag small,
.hem-gal-flag b { font-size: inherit; line-height: 1; }
.hem-gal-flag small { font-weight: 600; }
.hem-gal-flag b { font-weight: 800; }

/* Mũi tên: chỉ là dấu ‹ › trắng, không nền, không viền. */
.hem-p .hem-gal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: #fff !important;
	font-size: 40px !important;
	font-weight: 300 !important;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
	box-shadow: none !important;
	transition: opacity .2s ease;
}

.hem-p .hem-gal-nav:hover { opacity: .7; background: transparent !important; }
.hem-gal-nav[disabled] { display: none; }
.hem-gal-prev { left: 10px; }
.hem-gal-next { right: 10px; }

.hem-gal-counter {
	position: absolute;
	right: 10px; bottom: 8px;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 20px;
	z-index: 3;
}

/* Thumbnail: một hàng ngang, trượt bằng nút ‹ › ở hai đầu. */
.hem-gal-thumbs {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hem-gal-tview {
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.hem-gal-tview::-webkit-scrollbar { display: none; }
.hem-gal-tlist { display: flex; gap: 8px; }

.hem-p .hem-gal-tnav {
	flex: 0 0 30px;
	width: 30px !important;
	height: 30px !important;
	min-width: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--line) !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: var(--ink2) !important;
	font-size: 16px !important;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .1) !important;
}

.hem-p .hem-gal-tnav:hover { border-color: var(--red) !important; color: var(--red) !important; }
.hem-gal-tnav[hidden] { display: none; }

.hem-p .hem-gal-thumb {
	position: relative;
	flex: 0 0 74px;
	width: 74px;
	height: 74px;
	padding: 0 !important;
	min-width: 0 !important;
	border: 1.5px solid var(--line) !important;
	border-radius: 8px !important;
	background: #fff !important;
	overflow: hidden;
	cursor: pointer;
	box-shadow: none !important;
	transition: border-color .15s ease;
}

.hem-gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hem-p .hem-gal-thumb:hover { border-color: #bbb !important; }
.hem-p .hem-gal-thumb.is-active { border-color: var(--red) !important; border-width: 1.5px !important; }

.hem-gal-tplay {
	position: absolute;
	inset: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(17, 20, 24, .42);
	color: #fff; font-size: 15px;
}

/* ---- Xem ảnh lớn ---- */

.hem-lb {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(8, 10, 13, .93);
	display: flex; align-items: center; justify-content: center;
}

.hem-lb[hidden] { display: none; }

.hem-lb-stage {
	width: min(78vw, 78vh);
	aspect-ratio: 1 / 1;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 96px;
}

.hem-lb-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.hem-lb-close, .hem-lb-nav {
	position: absolute;
	border: none;
	background: transparent;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
	transition: opacity .2s ease;
}

.hem-lb-close:hover, .hem-lb-nav:hover { opacity: .6; }
.hem-lb-close { top: 18px; right: 26px; width: 44px; height: 44px; font-size: 40px; font-weight: 300; }
.hem-lb-nav { top: 50%; transform: translateY(-50%); width: 56px; height: 56px; font-size: 46px; font-weight: 300; }
.hem-lb-prev { left: 18px; }
.hem-lb-next { right: 18px; }
.hem-lb-nav[hidden] { display: none; }

.hem-lb-count {
	position: absolute;
	right: 26px; bottom: 106px;
	color: #fff; font-size: 12px; opacity: .8;
}

.hem-lb-thumbs {
	position: absolute;
	left: 0; right: 0; bottom: 14px;
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 0 16px;
	overflow-x: auto;
	scrollbar-width: none;
}

.hem-lb-thumbs::-webkit-scrollbar { display: none; }

.hem-lb-thumb {
	flex: 0 0 62px;
	width: 62px; height: 62px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #2a2d33;
	overflow: hidden;
	cursor: pointer;
	opacity: .55;
	transition: opacity .15s ease, border-color .15s ease;
}

.hem-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hem-lb-thumb:hover { opacity: .85; }
.hem-lb-thumb.is-active { opacity: 1; border-color: #fff; }


/* =========================================================
   3. CỘT PHẢI
   ========================================================= */

.hem-title {
	font-size: 27px;
	font-weight: 700;
	letter-spacing: -.4px;
	margin: 0 0 10px;
}

.hem-rating { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }

.hem-stars {
	position: relative;
	display: inline-block;
	width: 92px; height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%23dfe3e8'%3E%3Cpath d='M12 3l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.8l6.5-.9z'/%3E%3C/svg%3E") repeat-x left center / 18.4px 16px;
}

.hem-stars-fill {
	position: absolute; inset: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M12 3l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5L2.6 9.8l6.5-.9z'/%3E%3C/svg%3E") repeat-x left center / 18.4px 16px;
}

.hem-stars-num { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ---- Bộ chọn phiên bản New / Used ---- */

.hem-pick { margin: 0 0 20px; }

.hem-pick-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 10px;
}

.hem-pick-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* !important: Astra ép padding, màu chữ và bo góc cho mọi <button>. */
.hem-p .hem-pick-btn {
	position: relative;
	flex: 0 1 auto;
	min-width: 108px;
	padding: 11px 27px !important;
	border: 1.5px solid var(--line) !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: var(--ink2) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	text-align: center;
	text-transform: none !important;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none !important;
	overflow: hidden;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.hem-p .hem-pick-btn:hover { border-color: var(--ink4) !important; }

.hem-p .hem-pick-btn.is-active {
	border-color: var(--blue) !important;
	background: var(--blue-bg) !important;
	color: var(--blue) !important;
}

/* Dấu tick vuông ở góc trên phải, bo theo góc thẻ. */
.hem-p .hem-pick-btn.is-active::after {
	content: "";
	position: absolute;
	top: 0; right: 0;
	width: 21px; height: 21px;
	border-radius: 0 8px 0 10px;
	background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 11px;
}

/* Chọn loại bảo hành / màu sắc — dùng chung kiểu nút với "Chọn phiên bản". */
.hem-vpick { display: flex; flex-direction: column; gap: 15px; margin: 0 0 20px; }
.hem-vpick-row.is-hidden { display: none; }
.hem-p .hem-pick-btn.is-disabled { opacity: .38; cursor: not-allowed; text-decoration: line-through; }
.hem-p .hem-pick-btn.is-disabled::after { content: none; }

/* Khoá vì đang chọn máy used — xám hẳn, không gạch ngang (không phải hết hàng). */
.hem-p .hem-pick-btn.is-locked {
	color: var(--ink4) !important;
	background: #f2f3f5 !important;
	border-color: var(--line2) !important;
	cursor: not-allowed;
	pointer-events: none;
}

.hem-p .hem-pick-btn.is-locked::after { content: none; }

/* Bảng chọn biến thể gốc của WooCommerce (kể cả swatch của plugin) — ẩn hết,
   khung mới đã có dãy nút riêng ở trên.
   Ẩn luôn variant switcher của code cũ (không gỡ được bằng remove_action). */
html body.hem-single .hem-p form.cart table.variations,
html body.hem-single .hem-p .variable-items-wrapper,
html body.hem-single .hem-p .woo-selected-variation-item-name,
html body.hem-single .hem-p .hem-variant-switcher { display: none !important; }

/* ---- Khối theo phiên bản đang chọn ---- */

.hem-vpanel[hidden] { display: none; }

.hem-used-note {
	margin: 0 0 16px;
	padding: 11px 14px;
	background: var(--bg);
	border-radius: 9px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--ink2);
}

.hem-used-note b { color: var(--ink); }
.hem-infocol-empty { margin: 0; font-size: 13px; color: var(--ink4); }

.hem-intro {
	font-size: 14px;
	line-height: 1.65;
	color: var(--ink2);
	margin: 0 0 18px;
}

/* ---- Giá ---- */

.hem-price-block {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 11px;
	padding-bottom: 18px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--line);
}

.hem-price-now {
	font-size: 30px;
	font-weight: 800;
	letter-spacing: -.6px;
	color: var(--red);
	line-height: 1.15;
}

.hem-price-old { font-size: 15px; color: var(--ink4); text-decoration: line-through; }
.hem-price-old[hidden], .hem-price-off[hidden] { display: none; }

.hem-price-off {
	font-size: 11.5px;
	font-weight: 700;
	color: var(--red);
	background: #fdecee;
	border-radius: 5px;
	padding: 3px 7px;
}

.hem-price-save { font-size: 12.5px; font-weight: 600; color: var(--green); }

/* Bảo hành — dòng nổi bật ngay dưới giá. */
.hem-warranty {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: -6px 0 18px;
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--green-bg);
	color: var(--green);
	font-size: 13.5px;
	font-weight: 600;
}

.hem-warranty::before {
	content: "";
	width: 16px; height: 16px;
	flex: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 3.5v6c0 5-3.4 9.2-8 10.5-4.6-1.3-8-5.5-8-10.5v-6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---- Hộp 2 ngăn ---- */

.hem-infogrid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var(--line);
	border-radius: var(--r);
	overflow: hidden;
	margin-bottom: 18px;
}

.hem-infogrid.is-single { grid-template-columns: 1fr; }
.hem-infocol { padding: 14px 16px; }
.hem-infocol + .hem-infocol { border-left: 1px solid var(--line); background: var(--bg); }

.hem-p .hem-infocol-title {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--ink);
	margin: 0 0 18px;
}

.hem-check-list li,
.hem-dot-list li {
	position: relative;
	padding-left: 22px;
	font-size: 13px;
	line-height: 1.55;
	margin-bottom: 10px;
	color: var(--ink2);
}

.hem-check-list li:last-child,
.hem-dot-list li:last-child { margin-bottom: 0; }

.hem-check-list li::before {
	content: "";
	position: absolute;
	left: 0; top: 3px;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: var(--green-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / 9px;
}

.hem-dot-list li::before {
	content: "";
	position: absolute;
	left: 6px; top: 8px;
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--red);
}

/* ---- Chọn biến thể + nút mua ---- */

.hem-buy { margin-bottom: 16px; }

.hem-p .variations { width: 100%; margin: 0 0 14px; border: 0; }
.hem-p .variations tbody, .hem-p .variations tr, .hem-p .variations td, .hem-p .variations th { display: block; width: 100%; border: 0; padding: 0; background: none; }
.hem-p .variations tr + tr { margin-top: 12px; }

.hem-p .variations .label label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--ink3);
	margin-bottom: 7px;
}

/* Ô select gốc bị thay bằng dãy nút — vẫn giữ trong DOM để WooCommerce hoạt động. */
.hem-p .variations select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.hem-p .variations .reset_variations { font-size: 12px; color: var(--ink3); }

.hem-swatches { display: flex; flex-wrap: wrap; gap: 8px; }

.hem-swatch {
	border: 1.5px solid var(--line);
	background: #fff;
	border-radius: 8px;
	padding: 9px 15px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ink2);
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}

.hem-swatch:hover { border-color: var(--ink4); }
.hem-swatch.is-active { border-color: var(--red); color: var(--red); background: #fff6f7; }
.hem-swatch.is-disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

.hem-p .single_variation_wrap { margin: 0; }
.hem-p form.cart { margin: 0; display: block; }

.hem-p .quantity {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid var(--line);
	border-radius: 9px;
	overflow: hidden;
	margin: 0 10px 0 0;
	float: none;
	height: 50px;
}

.hem-p .quantity input.qty {
	width: 46px; height: 100%;
	border: 0; text-align: center;
	font-size: 15px; font-weight: 600;
	background: #fff; color: var(--ink);
	-moz-appearance: textfield;
	padding: 0;
}

.hem-p .quantity input.qty::-webkit-outer-spin-button,
.hem-p .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hem-qty-btn {
	width: 38px; height: 100%;
	border: 0; background: #fff;
	color: var(--ink2); font-size: 18px;
	cursor: pointer; line-height: 1;
}

.hem-qty-btn:hover { color: var(--red); }

.hem-p .woocommerce-variation-add-to-cart,
.hem-cart-row {
	display: flex;
	align-items: stretch;
	gap: 10px;
	flex-wrap: wrap;
}

/* !important: Astra ép màu + bo góc nút mua ở độ ưu tiên rất cao. */
.hem-p .single_add_to_cart_button,
.hem-p button.single_add_to_cart_button,
.hem-btn {
	flex: 1 1 200px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 13px 22px !important;
	border: none !important;
	border-radius: 9px !important;
	font-size: 14.5px !important;
	font-weight: 700 !important;
	letter-spacing: .2px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: filter .18s ease;
	background: var(--red) !important;
	color: #fff !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	width: auto !important;
	margin: 0 !important;
	float: none !important;
}

.hem-p .single_add_to_cart_button:hover,
.hem-btn:hover { filter: brightness(1.08); color: #fff !important; }

.hem-btn-contact {
	background: #fff !important;
	color: var(--red) !important;
	border: 1.5px solid var(--red) !important;
	margin-top: 10px !important;
}

.hem-btn-contact:hover { background: #fff6f7 !important; color: var(--red) !important; }
.hem-btn-contact img { flex-shrink: 0; }

.hem-buy-note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ink3);
}

/* ---- 2 thẻ dịch vụ ---- */

.hem-services { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 0; }

.hem-service {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 12px 14px;
	border: 1.5px solid #c7d7f5;
	border-radius: var(--r);
	background: var(--blue-bg);
	text-decoration: none;
	color: var(--ink2);
	transition: border-color .15s ease, background .15s ease;
}

.hem-service:hover { border-color: var(--blue); background: #dde7fb; }
.hem-service-ic { flex: 0 0 auto; color: var(--blue); display: flex; }
.hem-service-txt { display: flex; flex-direction: column; min-width: 0; }
.hem-service-txt b { font-size: 13px; font-weight: 700; color: var(--ink); }
.hem-service-txt small { font-size: 11.5px; color: var(--ink3); }

/* ---- Quà tặng ---- */

.hem-gift {
	position: relative;
	border: 1.5px solid var(--gold);
	border-radius: var(--r);
	background: linear-gradient(135deg, #fffdf3, #fff9e4);
	padding: 14px 16px;
	overflow: hidden;
}

.hem-gift-ribbon {
	position: absolute;
	top: 12px; right: -32px;
	width: 120px;
	transform: rotate(45deg);
	background: var(--red);
	color: #fff;
	font-size: 9.5px; font-weight: 800; letter-spacing: .6px;
	text-align: center; padding: 4px 0;
}

.hem-gift-title { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; padding-right: 70px; }
.hem-gift-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(200, 165, 40, .22); }
.hem-gift-list li:last-child { border-bottom: none; padding-bottom: 0; }
.hem-gift-list img { flex: 0 0 40px; width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.hem-gift-name { flex: 1 1 auto; font-size: 13px; color: var(--ink2); }
.hem-gift-price { font-size: 12.5px; font-weight: 700; color: var(--red); white-space: nowrap; }
.hem-gift-price del { color: var(--ink4); font-weight: 400; font-size: 11px; }
.hem-gift-price ins { text-decoration: none; }

/* =========================================================
   4. DẢI 4 CAM KẾT
   ========================================================= */

/* Nằm trong cột trái, ngay dưới dải thumbnail -> xếp 2 hàng × 2 ô. */
.hem-trust {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border: 1px solid var(--line);
	border-radius: var(--r);
	overflow: hidden;
	margin-top: 30px;
	background: #fff;
}

.hem-trust-item { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
.hem-trust-item:nth-child(odd) { border-right: 1px solid var(--line); }
.hem-trust-item:nth-child(n+3) { border-top: 1px solid var(--line); }
.hem-trust-ic { flex: 0 0 26px; color: var(--red); }
.hem-trust-ic svg { width: 26px; height: 26px; }
.hem-trust-txt { display: flex; flex-direction: column; min-width: 0; }
.hem-trust-txt b { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--ink); line-height: 1.3; }
.hem-trust-txt small { font-size: 11.5px; color: var(--ink3); }

/* Tách hộp quà tặng khỏi cụm dịch vụ bên dưới. */
.hem-vpanel .hem-gift { margin-bottom: 0; }

/* =========================================================
   5. NÚT "XEM THÊM" DÙNG CHUNG
   ========================================================= */

.hem-more-btn {
	display: block;
	margin: 14px auto 0;
	padding: 10px 26px;
	border: 1.5px solid var(--line);
	border-radius: 22px;
	background: #fff;
	color: var(--ink2);
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}


.hem-more-btn[hidden] { display: none; }

/* =========================================================
   6. GỢI Ý MUA KÈM
   ========================================================= */

.hem-suggest {
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: 22px 24px;
	margin-bottom: 32px;
	background: #fff;
}

.hem-suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.hem-suggest-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1.5px solid var(--line);
	border-radius: var(--r);
	cursor: pointer;
	margin: 0;
	transition: border-color .15s ease;
}

.hem-suggest-item.is-checked { border-color: var(--red); background: #fffafa; }
.hem-suggest-check { flex: 0 0 19px; width: 19px; height: 19px; accent-color: var(--red); margin: 0; }
.hem-suggest-item > img { flex: 0 0 62px; width: 62px; height: 62px; object-fit: cover; border-radius: 8px; }
.hem-suggest-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hem-suggest-body a { font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hem-suggest-body a:hover { color: var(--red); }
.hem-suggest-price { font-size: 13.5px; font-weight: 700; color: var(--red); }
.hem-suggest-price del { color: var(--ink4); font-weight: 400; font-size: 11.5px; }
.hem-suggest-price ins { text-decoration: none; }

.hem-suggest-total { margin-top: 14px; font-size: 14px; text-align: right; }
.hem-suggest-total[hidden] { display: none; }
.hem-suggest-total strong { font-size: 19px; font-weight: 800; color: var(--red); }

/* =========================================================
   7. TAB
   ========================================================= */

.hem-p-tabs { margin-bottom: 32px; }

.hem-p .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	border-bottom: 1px solid var(--line);
}

.hem-p .woocommerce-tabs ul.tabs::before,
.hem-p .woocommerce-tabs ul.tabs::after,
.hem-p .woocommerce-tabs ul.tabs li::before,
.hem-p .woocommerce-tabs ul.tabs li::after { display: none !important; } /* !important: WooCommerce vẽ "tai" bo góc bằng pseudo-element */

.hem-p .woocommerce-tabs ul.tabs li {
	margin: 0; padding: 0;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.hem-p .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 12px 20px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
	font-size: 14.5px;
	color: var(--ink3);
	text-decoration: none;
	border-bottom: 2.5px solid transparent;
	margin-bottom: -1px;
}

.hem-p .woocommerce-tabs ul.tabs li.active a,
.hem-p .woocommerce-tabs ul.tabs li a:hover { color: var(--red); }
.hem-p .woocommerce-tabs ul.tabs li.active a { border-bottom-color: var(--red); }
.hem-p .woocommerce-Tabs-panel > h2:first-child { display: none; }

/* ---- Tab Mô tả ---- */

.hem-desc { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 34px; align-items: start; }
.hem-desc-main { min-width: 0; }
.hem-desc-side { display: flex; flex-direction: column; gap: 14px; align-self: stretch; }

/* Chỉ khối bài viết dính theo màn hình khi cuộn; video đứng yên ở trên. */
.hem-desc-sticky { position: sticky; top: var(--sticky-top); }
.hem-desc-clip { position: relative; max-height: 620px; overflow: hidden; }

.hem-desc-clip::after {
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0;
	height: 90px;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
	pointer-events: none;
}

.hem-desc.is-open .hem-desc-clip { max-height: none; }
.hem-desc.is-open .hem-desc-clip::after { display: none; }

/* Chữ trong phần mô tả — trước đây do CSS cũ lo, giờ plugin tự đặt. */
.hem-desc-clip { font-size: 15.5px; line-height: 1.8; color: #333; }
.hem-desc-clip p { margin: 0 0 16px; }

.hem-desc-clip h2 {
	font-size: 20px;
	font-weight: 700;
	color: #111;
	margin: 28px 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--red);
}

.hem-desc-clip h3 { font-size: 17.5px; font-weight: 700; color: #111; margin: 22px 0 10px; }
.hem-desc-clip h4 { font-size: 16px; font-weight: 700; color: #111; margin: 18px 0 8px; }
.hem-desc-clip ul, .hem-desc-clip ol { margin: 0 0 16px; padding-left: 20px; }
.hem-desc-clip ul li { list-style: disc; margin: 0 0 7px; }
.hem-desc-clip ol li { list-style: decimal; margin: 0 0 7px; }
.hem-desc-clip a { color: var(--red); }
.hem-desc-clip img { border-radius: 8px; margin: 8px 0; }

.hem-desc-clip table { width: 100%; border-collapse: collapse; margin: 0 0 16px; background: var(--bg); border-radius: 8px; overflow: hidden; }
.hem-desc-clip table td, .hem-desc-clip table th { padding: 11px 14px; border-bottom: 1px solid #efefef; font-size: 15px; text-align: left; }


.hem-card {
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: #fff;
	padding: 18px 20px;
	box-shadow: none;
}

.hem-p .hem-card-title {
	font-size: 14.5px;
	font-weight: 700;
	margin: 0 0 16px;
	padding-bottom: 11px;
	border-bottom: 1px solid var(--line2);
}

.hem-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; }
.hem-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.hem-post-list { display: flex; flex-direction: column; gap: 12px; }
.hem-post-list a { display: flex; align-items: center; gap: 11px; text-decoration: none !important; color: var(--ink2); }
.hem-post-list a:hover b { color: var(--red); }
.hem-post-list a b, .hem-post-list a small { text-decoration: none !important; }
.hem-post-list img, .hem-post-noimg { flex: 0 0 56px; width: 56px; height: 56px; object-fit: cover; border-radius: 7px; background: var(--bg); }
.hem-post-list span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hem-post-list b { font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.hem-post-list small { font-size: 11px; color: var(--ink4); font-weight: 400; }

/* Mô tả ngắn + nút Đọc thêm */
.hem-intro-wrap { margin: 0 0 18px; }
.hem-intro-wrap .hem-intro { margin: 0 0 4px; }

.hem-p .hem-link-btn {
	border: none !important;
	background: none !important;
	padding: 0 !important;
	min-width: 0 !important;
	box-shadow: none !important;
	color: var(--red) !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	text-decoration: underline;
	text-transform: none !important;
	cursor: pointer;
}

.hem-p .hem-link-btn:hover { opacity: .75; }

/* ---- Bảng thông số ---- */

.hem-specs-clip { max-height: 480px; overflow: hidden; position: relative; }
.hem-specs.is-open .hem-specs-clip { max-height: none; }

.hem-spec-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.hem-spec-table tr:nth-child(odd) { background: var(--bg); }

.hem-spec-table th, .hem-spec-table td {
	padding: 12px 16px;
	font-size: 15px;
	line-height: 1.6;
	text-align: left;
	vertical-align: top;
	border: 1px solid var(--line);
	word-wrap: break-word;
}

.hem-spec-table th { width: 34%; font-weight: 600; color: var(--ink2); }
.hem-spec-table td { color: var(--ink); }

/* =========================================================
   8. HỎI ĐÁP
   ========================================================= */

.hem-faq {
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: 24px;
	margin-bottom: 32px;
	background: #fff;
}

.hem-faq .hem-sec-title { margin-bottom: 16px; }
.hem-faq-list { display: flex; flex-direction: column; }

.hem-faq-item { border-bottom: 1px solid var(--line2); padding: 4px 0; }
.hem-faq-item:last-child { border-bottom: none; }

.hem-faq-item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 13px 0;
	cursor: pointer;
	list-style: none;
}

.hem-faq-item summary::-webkit-details-marker { display: none; }

.hem-faq-item summary h3 {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--ink);
	margin: 0;
}

.hem-faq-item summary::after {
	content: "";
	flex: 0 0 16px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
	transition: transform .18s ease;
}

.hem-faq-item[open] summary::after { transform: rotate(180deg); }
.hem-faq-answer { padding: 0 0 14px; }
.hem-faq-answer p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink2); }

/* =========================================================
   9. SẢN PHẨM TƯƠNG TỰ — thẻ giống hệt trang /used/
   Dùng tiền tố .hem-pcard (không phải .hem-card) để khỏi đụng
   thẻ sidebar ở tab Mô tả — hai bên từng trùng tên gây lệch padding.
   ========================================================= */


.hem-p-related {
	position: relative;
	background: #eef4fd;
	border: 1px solid #d6e3f8;
	border-radius: var(--r-lg);
	padding: 22px 24px 24px;
}

/* Link "Xem tất cả" nằm cùng hàng với tiêu đề — copy .hcd-sec-head của trang /used/. */
.hem-p .hem-related-all {
	position: absolute;
	top: 28px;
	right: 24px;
	font-size: 13px;
	font-weight: 700;
	color: #c0392b;
	text-decoration: none;
}

.hem-p .hem-related-all:hover { text-decoration: underline; }

.hem-p-related .related > h2,
.hem-p-related .upsells > h2 {
	text-transform: none;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.2px;
	margin-bottom: 16px;
}

/* !important: WooCommerce đặt float + width theo % cho từng ô trong lưới. */
.hem-p-related ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 10px;
	margin: 0 !important;
	padding: 8px 0 0 !important;
	list-style: none;
}

/* Lấy 6 thẻ nhưng máy tính chỉ hiện 5 — thẻ thứ 6 để dành cho điện thoại
   (2 cột x 3 hàng thì vừa đẹp). Giống trang /used/.
   !important: woocommerce-layout-grid đặt display:flex cho li.product. */
.hem-p-related ul.products li.hem-pcard-item:nth-child(6) { display: none !important; }

.hem-p-related ul.products::before,
.hem-p-related ul.products::after { display: none !important; }

.hem-p-related ul.products li.hem-pcard-item {
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	list-style: none;

	/*
	 * Ô lưới mặc định không co nhỏ hơn nội dung dài nhất bên trong. Dòng
	 * "Trợ giá đến 10% khi lên đời" để white-space:nowrap nên rộng 176px, ép cả
	 * cột phải rộng 176px -> 2 cột 362px trong khung 316px = thòi ra trên điện
	 * thoại. min-width:0 cho phép ô co lại, chữ dài tự cắt bằng dấu ba chấm.
	 */
	min-width: 0 !important;
}

/* Chặn tiếp ở từng lớp bên trong, để không lớp nào nong thẻ ra. */
.hem-pcard,
.hem-pcard-body,
.hem-pcard-foot { min-width: 0; }

.hem-pcard-ship { overflow: hidden; text-overflow: ellipsis; }

.hem-pcard {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 5px;
	overflow: visible;
	text-decoration: none;
	color: #111;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
	transition: transform .2s ease, box-shadow .2s ease;
}

.hem-pcard:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .1); }

.hem-pcard-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	object-position: center;
	display: block;
	background: #f8f8f8;
	border-radius: 5px 5px 0 0;
}

/* Sản phẩm chưa có ảnh — ô xám kèm biểu tượng máy ảnh, giống .hcd-rel-ph. */
.hem-pcard-ph {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f8f8f8;
	border-radius: 5px 5px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
}

/* Cờ giảm giá — copy y hệt .hcd-rel-sale-flag của trang /used/. */
.hem-pcard-flag {
	position: absolute;
	top: -7px;
	left: 11px;
	z-index: 3;
	background: #d70018;
	color: #fff;
	font-size: 12.5px;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 0 6px 6px 6px;
	box-shadow: 0 2px 5px rgba(215, 0, 24, .2);
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

/* Cùng cỡ chữ như cờ ảnh chính, chỉ khác độ đậm. */
.hem-pcard-flag small,
.hem-pcard-flag b { font-size: inherit; line-height: 1; }
.hem-pcard-flag small { font-weight: 600; }
.hem-pcard-flag b { font-weight: 800; }

.hem-pcard-flag::before {
	content: "";
	position: absolute;
	top: 0; left: 0;
	width: 0; height: 0;
	border-style: solid;
	border-width: 0 0 7px 5px;
	border-color: transparent transparent #81000e transparent;
	transform: translateX(-100%);
}

.hem-pcard-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 10px 12px;
	background: #fff;
	border-radius: 0 0 5px 5px;
}

.hem-pcard-name {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	color: #111827;
	min-height: 36px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hem-pcard-grade {
	font-size: 11px;
	font-weight: 500;
	color: #2563eb;
	margin-top: 4px;
	min-height: 16px;
	line-height: 1.3;
}

.hem-pcard-pricerow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hem-pcard-price { font-size: 15px; font-weight: 700; color: #e30019; line-height: 1; }
.hem-pcard-price-old { font-size: 10.5px; color: #bbb; text-decoration: line-through; white-space: nowrap; }

.hem-pcard-benefits { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }

.hem-pcard-benefit {
	font-size: 11.5px;
	padding: 3px 6px;
	border-radius: 4px;
	background: #e8f0ff;
	color: #2454a6;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Dòng thứ hai màu xám, không phải xanh — .hcd-rel-benefit--support. */
.hem-pcard-benefit.is-support { background: #f5f5f5; color: #555; }

.hem-pcard-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-top: auto;
	padding-top: 8px;
	border-top: 1px solid #dbeafe;
}

.hem-pcard-ship { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 400; color: #2563eb; line-height: 1; white-space: nowrap; }
.hem-pcard-truck { flex: none; }
.hem-pcard-rate { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 400; color: #111; }

/* =========================================================
   10. THANH MUA DÍNH ĐÁY (điện thoại)
   ========================================================= */

.hem-mbar {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 9998;
	display: none;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: #fff;
	border-top: 1px solid var(--line);
	box-shadow: 0 -3px 16px rgba(0, 0, 0, .09);
}

.hem-mbar-price { display: flex; flex-direction: column; line-height: 1.2; }
.hem-mbar-price small { font-size: 10.5px; color: #6b7280; }
.hem-mbar-price strong { font-size: 16px; font-weight: 800; color: #d70018; }
.hem-mbar .hem-btn { flex: 1 1 auto; min-height: 44px; font-size: 13.5px !important; padding: 10px 14px !important; }
.hem-mbar-cart { background: #fff !important; color: #d70018 !important; border: 1.5px solid #d70018 !important; margin-top: 0 !important; }

/* =========================================================
   11. MÀN HÌNH NHỎ
   ========================================================= */

@media (max-width: 1024px) {
	.hem-p-top { grid-template-columns: 1fr; gap: 28px; }
	/* Cột xếp dọc rồi thì khung ngang 4/3 làm ảnh bé lại -> trả về vuông. */
	.hem-gal-stage { aspect-ratio: 1 / 1; }
	.hem-desc { grid-template-columns: 1fr; gap: 24px; }
	.hem-desc-sticky { position: static; }
	.hem-trust { grid-template-columns: 1fr 1fr; }
	.hem-trust-item:nth-child(3) { border-left: 0; }
	.hem-trust-item:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 782px) {
	.hem-gal-thumbs { grid-template-columns: repeat(5, 1fr); gap: 6px; }

	/* Khung ảnh hẹp lại -> cờ giảm giá cũng nhỏ theo cho cân. */
	.hem-gal-flag { top: 12px; left: 12px; padding: 7px 11px; font-size: 14.5px; }

	.hem-title { font-size: 21px; }
	.hem-price-now { font-size: 25px; }
	.hem-lb-stage { width: 92vw; margin-bottom: 86px; }

	.hem-infogrid { grid-template-columns: 1fr; }
	.hem-infocol + .hem-infocol { border-left: 0; border-top: 1px solid var(--line); }

	.hem-price-block { flex-direction: column; align-items: flex-start; }

	/* --- 3 nút mua bằng nhau ---
	   Nút "Thêm vào giỏ" do plugin vẽ, 2 nút Zalo/Facebook do snippet cũ chèn vào,
	   nên cao thấp / bo góc / cỡ chữ / khoảng cách mỗi cái một kiểu. Ép về cùng một
	   khuôn. Bo góc lấy 4px vì snippet cũ ghim cứng nút mua ở 4px, đổi hai nút kia
	   cho khớp dễ hơn là đi giành. */
	html body.hem-single .hem-p .hem-buy .single_add_to_cart_button,
	html body.hem-single .hem-p .hem-buy .hem-btn-zalo,
	html body.hem-single .hem-p .hem-buy .hem-btn-facebook {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 100% !important;
		min-height: 52px !important;
		padding: 13px 18px !important;
		border-radius: 4px !important;
		font-size: 15px !important;
		font-weight: 700 !important;
		margin: 0 0 10px !important;
	}

	html body.hem-single .hem-p .hem-buy .hem-contact-buttons { margin: 0 !important; }
	html body.hem-single .hem-p .hem-buy .hem-btn-facebook { margin-bottom: 0 !important; }

	.hem-suggest, .hem-faq { padding: 18px 16px; }
	.hem-pick-btn { min-width: calc(50% - 4px); }
	.hem-services { grid-template-columns: 1fr; }
	/* minmax(0,1fr) chứ không phải 1fr: `1fr` không co dưới bề rộng nội dung nên
	   tên sản phẩm dài nong ô ra 402px trong khung 316px -> tràn khỏi viền. */
	.hem-suggest-grid { grid-template-columns: minmax(0, 1fr) !important; }
	.hem-suggest-item { min-width: 0 !important; }

	.hem-p .woocommerce-tabs ul.tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
	.hem-p .woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
	.hem-p .woocommerce-tabs ul.tabs li a { white-space: nowrap; padding: 11px 14px; font-size: 12.5px; }

	.hem-spec-table th { width: 42%; }
	.hem-spec-table th, .hem-spec-table td { padding: 10px 11px; font-size: 14px; }
	.hem-desc-clip { font-size: 15px; }

	/* Thẻ sản phẩm tương tự trên điện thoại — copy đúng khối @media của trang /used/. */
	.hem-p-related { padding: 18px 16px 20px; }
	.hem-p .hem-related-all { top: 24px; right: 16px; }
	/* !important: snippet cũ trong Header & Footer đặt `ul.products{grid-template-columns:1fr 1fr!important}`
	   — mà `1fr` không co dưới bề rộng nội dung, nên phải giành lại bằng minmax(0,1fr). */
	.hem-p-related ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
	.hem-p-related ul.products li.hem-pcard-item:nth-child(6) { display: flex !important; }
	.hem-pcard-body { padding: 8px; }
	.hem-pcard-name { font-size: 11px; line-height: 1.3; }
	.hem-pcard-price { font-size: 12px; }
	.hem-pcard-pricerow { flex-direction: column; align-items: flex-start; gap: 0; }
	.hem-pcard-price-old { order: -1; } /* giá cũ lên trên, giá mới xuống dưới */
	.hem-pcard-flag { font-size: 11px; padding: 5px 9px; } /* thẻ hẹp lại thì cờ nhỏ theo */

	.hem-mbar { display: flex; }
	body.hem-single { padding-bottom: 66px; }
	.hem-fab { bottom: 76px !important; } /* !important: đẩy nút chat lên khỏi thanh mua dính đáy */
}

@media (max-width: 480px) {
	.hem-trust { grid-template-columns: 1fr; }
	.hem-trust-item + .hem-trust-item { border-left: 0; border-top: 1px solid var(--line); }
	.hem-trust-item:nth-child(3) { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hem-p * { transition: none !important; }
}

/* =========================================================
   12. GỠ VA CHẠM VỚI CSS CŨ (WPCode snippet 1587)

   Snippet cũ vẫn phải chạy vì trang cũ và trang danh mục còn dùng,
   nhưng nó nạp SAU file này nên thắng ở cùng độ ưu tiên.
   Khối dưới đây nâng độ ưu tiên bằng "body.hem-single" để gỡ đúng
   những chỗ va chạm, không đụng phần còn lại của snippet.

   Xoá cả khối này khi nào snippet 1587 được dọn xong.
   ========================================================= */

/* Snippet cũ đổi tên tab bằng cách ẩn chữ (font-size:0) rồi vẽ lại bằng ::after.
   Khung mới đã ghi đúng tên ngay trong HTML nên phải trả chữ về. */
html body.hem-single .hem-p .wc-tabs li a {
	font-size: 13.5px !important;
	padding: 12px 20px !important;
}

html body.hem-single .hem-p .wc-tabs li a::after,
html body.hem-single .hem-p .wc-tabs li a::before { content: none !important; }

/* Snippet cũ ẩn ô số lượng (bản cũ không dùng tới). */
html body.hem-single .hem-p form.cart .quantity { display: inline-flex !important; }

/* Snippet cũ bọc tab Mô tả thành một thẻ trắng có viền + đổ bóng + padding 36px. */
html body.hem-single .hem-p .woocommerce-Tabs-panel--description {
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	font-size: 14px !important;
	line-height: 1.75 !important;
}

/* Snippet cũ vẽ khung xám quanh bảng biến thể — khung mới dùng nút bấm. */
html body.hem-single .hem-p form.cart table.variations,
html body.hem-single .hem-p form.cart table.variations tr + tr td,
html body.hem-single .hem-p form.cart table.variations tr + tr th {
	border: 0 !important;
	border-top: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	background: none !important;
}

/* Plugin Variation Swatches đã tự dựng nút chọn biến thể.
   Khi có nó thì ẩn dãy nút của plugin này để không hiện hai hàng. */
html body.hem-single .hem-p .variable-items-wrapper ~ .hem-swatches,
html body.hem-single .hem-p .variable-items-wrapper + .hem-swatches { display: none !important; }

/* Snippet WPCode #4638 "Fix hiển thị giá Variation" tự chèn thêm một ô giá
   khi nó không thấy giá nào đang hiện. Khung mới đã có khối giá riêng ở trên,
   nên ô đó thành thừa -> ẩn đi. */
html body.hem-single .hem-p .hem-variation-price-fix { display: none !important; }

/* Ô số lượng: snippet cũ ẩn nó, và ép khối add-to-cart xếp dọc.
   Khung mới cần số lượng nằm cùng hàng với nút mua. */
html body.hem-single .hem-p .woocommerce-variation-add-to-cart {
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
}

html body.hem-single .hem-p form.cart .quantity {
	display: inline-flex !important;
	visibility: visible !important;
	width: auto !important;
}

/* Snippet cũ tô nền xám + viền cho khối "Sản phẩm tương tự".
   Khung mới đã có nền xanh riêng nên gỡ lớp xám bên trong đi. */
html body.hem-single .hem-p .related,
html body.hem-single .hem-p .upsells {
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
}

html body.hem-single .hem-p .related > h2,
html body.hem-single .hem-p .upsells > h2 {
	font-size: 22px !important;
	font-weight: 700 !important;
	color: var(--ink) !important;
}

/* Snippet cũ ép in hoa toàn bộ các tiêu đề. Chỉ viết hoa chữ đầu. */
html body.hem-single .hem-p .related > h2,
html body.hem-single .hem-p .upsells > h2,
html body.hem-single .hem-p .woocommerce-tabs ul.tabs li a,
html body.hem-single .hem-p .hem-sec-title,
html body.hem-single .hem-p .hem-infocol-title,
html body.hem-single .hem-p .hem-card-title {
	text-transform: none !important;
	letter-spacing: 0 !important;
}

/* Nút chọn biến thể do plugin Variation Swatches dựng — mặc áo của khung mới,
   bỏ viền đậm + đổ bóng đen của snippet cũ. */
html body.hem-single .hem-p .variations .label label,
html body.hem-single .hem-p .woo-selected-variation-item-name {
	font-size: 12px !important;
	font-weight: 700 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: var(--ink3) !important;
}

html body.hem-single .hem-p .variable-items-wrapper .variable-item {
	border: 1.5px solid var(--line) !important;
	border-radius: 9px !important;
	padding: 9px 16px !important;
	margin: 0 8px 8px 0 !important;
	min-width: 0 !important;
	height: auto !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	color: var(--ink2) !important;
	background: #fff !important;
	box-shadow: none !important;
}

html body.hem-single .hem-p .variable-items-wrapper .variable-item.selected {
	border-color: var(--blue) !important;
	background: var(--blue-bg) !important;
	color: var(--blue) !important;
}

html body.hem-single .hem-p .variable-items-wrapper .variable-item::after,
html body.hem-single .hem-p .variable-items-wrapper .variable-item::before { content: none !important; }
