/* Trang sản phẩm hygi.vn – phong cách Coolmate (Flatsome) */
:root {
	--tb-primary: var(--fs-color-primary, #1d8fb0);
	--tb-dark: #111;
	--tb-muted: #6b6b6b;
	--tb-line: #e6e6e6;
	--tb-soft: #f3f4f6;
	--tb-badge: #2f45d6;
	--tb-buy: #56c3cf; /* màu nút Thêm vào giỏ + Mua ngay; product.js lấy đúng màu gốc của nút Mua ngay nếu có */
	--tb-radius: 12px;
	--tb-thumb-ratio: 1 / 1; /* ảnh sản phẩm hygi.vn là ảnh vuông; đổi 3 / 4 nếu dùng ảnh dọc */
}

/* ---------- Tiêu đề & meta ---------- */
.product-info .product-title { color: var(--tb-dark); font-size: 1.6em; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.product-info .is-divider { display: none; }
.tb-sub { color: var(--tb-muted); font-size: .9em; line-height: 1.6; margin-bottom: 10px; }
.tb-meta-row {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--tb-line); font-size: .9em;
}
.tb-rating { font-weight: 600; }
.tb-rev-link { color: var(--tb-muted); text-decoration: underline; font-weight: 400; }
.tb-sold { color: var(--tb-muted); }
.tb-rating + .tb-sold { padding-left: 14px; border-left: 1px solid var(--tb-line); }
.tb-share {
	margin: 0 0 0 auto; padding: 0; min-height: 0; background: none; border: 0;
	color: var(--tb-badge); font-size: 1em; text-transform: none; letter-spacing: 0;
	display: inline-flex; align-items: center; gap: 4px; line-height: 1;
}
.tb-share .tb-ic { width: 16px; height: 16px; }

/* ---------- Giá ---------- */
.tb-price { margin-bottom: 14px; }
.tb-price-now { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.tb-price-now .price, .tb-price-now .price .amount { font-size: 1.75em; font-weight: 800; color: var(--tb-dark); margin: 0; }
/* Sản phẩm biến thể đang giảm giá: Woo in <del>giá gốc</del><ins>giá bán</ins> → giá bán trước, giá gốc gạch ngang sau, cùng hàng. */
.tb-price-now .price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.tb-price-now .price ins { order: 1; text-decoration: none; }
.tb-price-now .price del { order: 2; }
.tb-price-now .price del, .tb-price-old { font-size: 1.05rem; color: #999; font-weight: 400; text-decoration: line-through; text-decoration-thickness: 1px; border: 0; opacity: 1; }
.tb-price-now .price del .amount, .tb-price-old .amount { font-size: 1em; font-weight: 400; color: #999; }
/* ₫ của giá gốc nằm cùng dòng (Flatsome đẩy ký hiệu tiền lên cao như chỉ số trên). */
.tb-price-now .price del .woocommerce-Price-currencySymbol, .tb-price-old .woocommerce-Price-currencySymbol { vertical-align: baseline; top: 0; position: static; font-size: 1em; margin-left: 2px; }
.tb-price-now .tb-badge { order: 3; }
.tb-badge, .tb-mini-price em {
	background: var(--tb-badge); color: #fff; font-style: normal; font-weight: 700;
	font-size: .8em; padding: 2px 9px; border-radius: 99px; line-height: 1.6;
}

/* ---------- Mô tả ngắn ---------- */
.product-short-description { font-size: .92em; color: #333; }
.product-short-description ul { margin-left: 1.1em; }

/* ---------- Mã giảm giá & ưu đãi ---------- */
.tb-coupon { background: var(--tb-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: .95em; }
.tb-coupon-top { display: flex; align-items: center; gap: 10px; }
.tb-coupon-top > .tb-ic { color: var(--tb-badge); flex: none; }
.tb-coupon-text { flex: 1; }
.tb-coupon-actions { display: flex; justify-content: flex-end; gap: 22px; margin-top: 8px; }
.tb-coupon-actions button, .tb-cpn .tb-copy {
	display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 0; min-height: 0; background: none; border: 0;
	color: var(--tb-badge); font-size: .9em; font-weight: 400; text-transform: none; letter-spacing: 0; line-height: 1.4;
}
.tb-coupon-actions .tb-more-coupons { text-decoration: underline; }
.tb-coupon-actions .tb-ic { width: 15px; height: 15px; }
.tb-copy.is-done { color: var(--tb-dark); }
.tb-perks { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font-size: .92em; margin-bottom: 18px; }
.tb-perks span { display: inline-flex; align-items: center; gap: 6px; }
.tb-perks .tb-ic { width: 20px; height: 20px; color: var(--tb-badge); }

/* ⓘ: rê chuột / chạm để xem ghi chú */
.tb-tip { position: relative; display: inline-flex; color: #666; cursor: help; margin-left: 6px; }
.tb-tip .tb-ic { width: 18px; height: 18px; color: #666; }
.tb-tip:hover::after, .tb-tip:focus::after {
	content: attr(data-tip); position: absolute; right: -8px; bottom: calc(100% + 8px); z-index: 20; width: 240px;
	background: #111; color: #fff; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; white-space: normal;
}

/* Cửa sổ "Xem thêm" mã giảm giá / bảng size */
.tb-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tb-modal[hidden] { display: none; }
body.tb-modal-open { overflow: hidden; }
.tb-modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 440px; max-height: 80vh; overflow: auto; padding: 16px 18px; }
.tb-modal-img { max-width: 720px; }
.tb-modal-img img { width: 100%; height: auto; display: block; }
.tb-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 1.05em; }
.tb-modal-close { margin: 0; padding: 0 6px; min-height: 0; background: none; border: 0; font-size: 26px; line-height: 1; color: #333; }
.tb-cpn { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; margin-bottom: 10px; border: 1px solid #e5e5e5; border-left: 4px solid var(--tb-badge); border-radius: 10px; }
.tb-cpn-desc { font-size: .88em; color: #444; margin: 2px 0; }
.tb-cpn small { color: #888; }
.tb-cpn .tb-copy { flex: none; border: 1px solid var(--tb-dark); border-radius: 99px; padding: 4px 12px; color: var(--tb-dark); }

/* "Hướng dẫn chọn size" */
.tb-label-row { position: relative; }
.tb-size-guide { position: absolute; right: 0; top: 0; font-weight: 400; font-size: .92em; color: var(--tb-badge); text-decoration: underline; }
table.variations th.label.tb-label-row, table.variations td.label.tb-label-row { width: 100%; display: block; }

/* ---------- Swatch (Flatsome Swatches – kiểu Label) ---------- */
.product-info table.variations, .tb-atc table.variations { margin-bottom: 6px; }
.product-info table.variations th.label, .tb-atc table.variations th.label { font-weight: 600; padding-bottom: 6px; }
.product-info .ux-swatches, .tb-atc .ux-swatches { gap: 10px; }
.product-info .ux-swatch.ux-swatch--label, .tb-atc .ux-swatch.ux-swatch--label {
	min-width: 64px; height: 40px; padding: 0 16px; border-radius: 10px;
	background: #e3e3e3; border: 0; box-shadow: none; font-weight: 500; color: #333;
}
.product-info .ux-swatch.ux-swatch--label.selected, .tb-atc .ux-swatch.ux-swatch--label.selected {
	background: var(--tb-badge); color: #fff; box-shadow: none; outline: none;
}
.product-info .ux-swatch:focus, .tb-atc .ux-swatch:focus { outline: none; }
/* Nhãn "Màu sắc: Trắng", "Size: S" trên một dòng (giá trị đã chọn đi liền sau tên). */
.product-info table.variations th.label label, .tb-atc table.variations th.label label,
.product-info table.variations th.label label + *, .tb-atc table.variations th.label label + * { display: inline; margin: 0; }
/* Không hiện khung chú thích (tooltip) khi rê chuột lên ô màu / size. */
.product-info .ux-swatch .tooltip, .tb-atc .ux-swatch .tooltip, .tooltipster-base.tooltipster-swatch { display: none !important; }
.product-info .ux-swatch.ux-swatch--color,
.tb-atc .ux-swatch.ux-swatch--color,
.product-info .ux-swatch.ux-swatch--image, .tb-atc .ux-swatch.ux-swatch--image {
	width: 64px; height: 36px; min-width: 0; min-height: 0; padding: 3px !important; box-sizing: border-box;
	border-radius: 99px; border: 1px solid #d6d6d6; background: #fff; overflow: hidden; position: relative;
}
/* Phần màu / ảnh nằm gọn trong khung (Flatsome đặt cỡ riêng nên ô Đen, Xanh tràn ra ngoài viền). */
.product-info .ux-swatch--color > *, .tb-atc .ux-swatch--color > *,
.product-info .ux-swatch--image > *, .tb-atc .ux-swatch--image > * {
	position: static !important; display: block; width: 100% !important; height: 100% !important; min-width: 0; margin: 0 !important;
	border-radius: 99px !important; box-shadow: none !important; transform: none !important;
}
.product-info .ux-swatch--color .ux-swatch__text, .tb-atc .ux-swatch--color .ux-swatch__text { display: none !important; }
.product-info .ux-swatch--image img, .tb-atc .ux-swatch--image img { object-fit: cover; }
.product-info .ux-swatch.selected:not(.ux-swatch--label), .tb-atc .ux-swatch.selected:not(.ux-swatch--label) { border-color: var(--tb-badge); box-shadow: 0 0 0 1px var(--tb-badge); }
.product-info .reset_variations, .tb-atc .reset_variations { font-size: .85em; }

/* ---------- Số lượng + Thêm vào giỏ dạng pill ---------- */
.product-info form.cart, .tb-atc form.cart { margin-bottom: 8px; }
.product-info .woocommerce-variation-add-to-cart,
.tb-atc .woocommerce-variation-add-to-cart,
.product-info form.cart:not(.variations_form), .tb-atc form.cart:not(.variations_form) {
	display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px;
	width: 100%; max-width: none;
}
.product-info form.cart .quantity, .tb-atc form.cart .quantity {
	display: inline-flex; align-items: center; justify-content: center; min-width: 120px; margin: 0 !important; height: 50px; z-index: 1;
	border: 1.5px solid var(--tb-dark); border-radius: 99px; background: #fff; overflow: hidden;
}
.product-info form.cart .quantity input, .tb-atc form.cart .quantity input { border: 0; box-shadow: none; background: none; height: 100%; min-height: 0; }
.product-info form.cart .quantity .qty, .tb-atc form.cart .quantity .qty { width: 40px; text-align: center; }
.product-info form.cart .quantity .button.minus,
.tb-atc form.cart .quantity .button.minus,
.product-info form.cart .quantity .button.plus, .tb-atc form.cart .quantity .button.plus { border: 0; background: none; height: 100%; width: 36px; }
.product-info form.cart .single_add_to_cart_button.button, .tb-atc form.cart .single_add_to_cart_button.button {
	flex: 1 1 0; min-width: 0; height: 50px !important; min-height: 0; margin: 0 !important; padding: 0 12px; border-radius: 99px;
	background-color: var(--tb-buy) !important; border-color: var(--tb-buy) !important; color: #fff !important;
	font-weight: 600; text-transform: none; font-size: 1em; letter-spacing: 0; white-space: nowrap;
}
/* Nút "Mua ngay" (plugin mua nhanh) đứng cạnh, rộng bằng nút Thêm vào giỏ, cùng màu (product.js chuyển nút vào hàng). */
.product-info form.cart .tb-buy-now, .tb-atc form.cart .tb-buy-now {
	flex: 1 1 0; min-width: 0; height: 50px !important; min-height: 0 !important; margin: 0 !important; padding: 0 12px !important; border-radius: 99px !important;
	display: inline-flex !important; align-items: center; justify-content: center; white-space: nowrap; text-decoration: none !important; width: auto !important;
	background-color: var(--tb-buy) !important; border: 1px solid var(--tb-buy) !important; color: #fff !important;
	font-weight: 600; text-transform: none; font-size: 1em; letter-spacing: 0; line-height: 1.2; box-shadow: none;
}
.product-info form.cart .tb-buy-now *, .tb-atc form.cart .tb-buy-now * { color: inherit !important; font-size: inherit; margin: 0; }
.tb-buy-now { background-color: var(--tb-buy) !important; border-color: var(--tb-buy) !important; color: #fff !important; border-radius: 99px; }
/* Màn hẹp: số lượng một dòng, hai nút chia đôi dòng dưới. */
@media (max-width: 549px) {
	.product-info form.cart .quantity, .tb-atc form.cart .quantity { flex: 0 0 100%; }
	.product-info form.cart .single_add_to_cart_button.button, .tb-atc form.cart .single_add_to_cart_button.button,
	.product-info form.cart .tb-buy-now, .tb-atc form.cart .tb-buy-now { font-size: .95em; padding: 0 8px !important; }
	.product-info form.cart .single_add_to_cart_button.button::before, .tb-atc form.cart .single_add_to_cart_button.button::before { display: none; }
}
.product-info form.cart .tb-buy-now small, .tb-atc form.cart .tb-buy-now small, .tb-buy-now .devvn_buy_now_text_note { display: none; }
.product-info form.cart .single_add_to_cart_button.disabled, .tb-atc form.cart .single_add_to_cart_button.disabled { opacity: .85; }

.tb-desc-link {
	display: block; text-align: center; font-weight: 600; text-decoration: underline;
	color: var(--tb-dark); margin: 6px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--tb-line);
}
/* Icon túi trước chữ "Thêm vào giỏ" */
.single_add_to_cart_button.button::before {
	content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M6 7h12l-1 13H7z'/%3E%3Cpath d='M9 7a3 3 0 0 1 6 0'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M6 7h12l-1 13H7z'/%3E%3Cpath d='M9 7a3 3 0 0 1 6 0'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tb-title { font-size: 1.75em; font-weight: 700; line-height: 1.25; color: var(--tb-dark); margin: 0 0 4px; }
.tb-sku { color: var(--tb-muted); }
.product-info .product_meta { display: none; } /* SKU + danh mục đã có ở trên */

/* ---------- Chính sách ---------- */
.tb-policy {
	display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px;
	background: var(--tb-soft); border-radius: var(--tb-radius); padding: 16px; margin: 0 0 20px; font-size: .82em; line-height: 1.4;
}
.tb-policy-item { display: flex; align-items: center; gap: 10px; }
.tb-policy-item .tb-ic {
	flex: none; width: 36px; height: 36px; padding: 6px; border: 1.5px solid var(--tb-dark); border-radius: 8px;
}

/* ---------- Gợi ý xem thêm ---------- */
.tb-suggest { border-top: 1px solid var(--tb-line); padding-top: 14px; }
.tb-suggest h4 { color: var(--tb-dark); font-size: .95em; text-transform: uppercase; margin-bottom: 10px; }
.tb-suggest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tb-mini { display: block; min-width: 0; color: var(--tb-dark); font-size: .82em; }
.tb-mini-img { position: relative; display: block; background: var(--tb-soft); border-radius: 6px; overflow: hidden; }
.tb-mini-img img { display: block; width: 100%; height: auto; aspect-ratio: var(--tb-thumb-ratio); object-fit: cover; }
.tb-mini-cart {
	position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%;
	background: #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.tb-mini-cart .tb-ic { width: 16px; height: 16px; }
.tb-mini-name { display: block; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-mini-price { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.tb-mini-price em { font-size: .85em; padding: 0 6px; background: var(--tb-dark); }

/* ---------- Tab mô tả ---------- */
.woocommerce-tabs .tabs { justify-content: center; }
.tb-desc-top { display: grid; grid-template-columns: 1fr 1.9fr; gap: 28px; align-items: start; margin-bottom: 24px; }
.tb-features { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-feature { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: .85em; text-align: center; max-width: 90px; }
.tb-feature-ic {
	width: 52px; height: 52px; display: grid; place-items: center;
	border: 2.5px solid var(--tb-badge); border-radius: 12px; color: var(--tb-badge);
}
.tb-feature-ic .tb-ic { width: 30px; height: 30px; }
.tb-spec { width: 100%; border-collapse: collapse; font-size: .88em; }
.tb-spec th, .tb-spec td { border: 0; border-bottom: 1px solid var(--tb-line); padding: 10px 0; vertical-align: top; text-align: left; }
.tb-spec th { width: 34%; color: var(--tb-muted); font-weight: 500; font-size: .85em; text-transform: uppercase; }
.tb-origin { font-weight: 700; font-size: .9em; margin-top: 12px; color: #444; }
.tb-desc-img img { width: 100%; border-radius: 16px; background: var(--tb-soft); }

.tb-desc-content { position: relative; overflow: hidden; transition: max-height .35s ease; }
.tb-desc-content.is-collapsed { max-height: 240px; }
.tb-desc-content.is-collapsed::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
	background: linear-gradient(rgba(255,255,255,0), #fff);
}
.tb-desc-more { text-align: center; margin-top: 12px; }
.tb-more-btn {
	background: #fff; border: 1.5px solid var(--tb-dark); border-radius: 99px; color: var(--tb-dark);
	padding: 0 28px; min-height: 38px; text-transform: uppercase; font-size: .85em;
}

/* ---------- Thanh freeship (giỏ hàng, mini cart, checkout) ---------- */
.tb-fs { background: var(--tb-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .9em; }
.tb-fs-bar { height: 6px; border-radius: 99px; background: #dcdcdc; margin-top: 6px; overflow: hidden; }
.tb-fs-bar span { display: block; height: 100%; background: var(--tb-primary); border-radius: inherit; }

/* Ảnh sản phẩm dính khi cuộn cột thông tin (như Coolmate) */
@media (min-width: 850px) {
	.product-main .product-gallery { position: sticky; top: 90px; align-self: flex-start; }
}

/* ---------- Mobile ---------- */
@media (max-width: 849px) {
	.tb-desc-top { grid-template-columns: 1fr; }
	.tb-policy { grid-template-columns: 1fr; }
	.product-info .product-title { font-size: 1.3em; }
}

.tb-fs-heavy { background: #fff7e6; border: 1px solid #ffd591; border-radius: 10px; padding: 10px 14px; font-size: .9em; line-height: 1.5; margin-bottom: 14px; }

/* ---------- Quà tặng kèm đơn ---------- */
.tb-gift { flex: 0 0 100%; width: 100%; background: var(--tb-soft); border-radius: 14px; padding: 14px 16px; margin: 4px 0 14px; }
.tb-gift-h { font-weight: 600; margin-bottom: 10px; }
.tb-gift-row { display: flex; align-items: center; gap: 12px; }
.tb-gift-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--tb-badge); }
.tb-gift-img { position: relative; flex: 0 0 64px; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #fff; }
.tb-gift-img img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.tb-gift-tag { position: absolute; left: 2px; top: 2px; font-size: 14px; line-height: 1; background: #ff7a45; border-radius: 4px; padding: 2px; }
.tb-gift-body { flex: 1; min-width: 0; }
.tb-gift-name { color: var(--tb-muted); font-size: .95em; margin-bottom: 6px; }
.tb-gift-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-gift-opts select { width: auto; min-width: 120px; height: 38px; margin: 0; border-radius: 99px; padding: 0 30px 0 14px; font-size: .9em; background-color: #fff; }
.tb-gift-var, .tb-gift-note { font-size: .85em; color: var(--tb-muted); }
.tb-gift-price { text-align: right; white-space: nowrap; }
.tb-gift-price b { display: block; font-size: 1.1em; }
.tb-gift-price del { color: #999; font-size: .85em; }
.tb-gift-badge { display: inline-block; background: #ff7a45; color: #fff; font-size: .75em; font-weight: 600; border-radius: 4px; padding: 1px 6px; margin-right: 4px; vertical-align: 1px; }
.tb-gift:has(.tb-gift-check input:not(:checked)) .tb-gift-body, .tb-gift:has(.tb-gift-check input:not(:checked)) .tb-gift-price, .tb-gift:has(.tb-gift-check input:not(:checked)) .tb-gift-img { opacity: .45; }
@media (max-width: 549px) { .tb-gift-row { flex-wrap: wrap; } .tb-gift-body { flex-basis: calc(100% - 110px); } .tb-gift-price { margin-left: auto; } }

/* ---------- Video sản phẩm (ảnh đầu) ---------- */
.tb-video { position: absolute; inset: 0; z-index: 2; background: transparent; cursor: pointer; }
.tb-video video, .tb-video iframe, .tb-video img { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; margin: 0; }
/* Hiện đủ video: giữ tỉ lệ, phần trống tô nền (Giao diện Hygi → Video sản phẩm). */
.tb-video.is-contain { background: #f2f3f5; }
.tb-video.is-contain video { object-fit: contain; }
.tb-video.is-poster .tb-video-play, .tb-video-play {
	position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
	background: rgba(0,0,0,.55); color: #fff; font-size: 26px; line-height: 64px; text-align: center; padding-left: 4px;
}
.tb-video-badge {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
	width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.5); color: #fff; font-size: 11px; line-height: 28px; text-align: center; letter-spacing: -2px;
}
.tb-video-badge:not(.is-playing) { letter-spacing: 0; padding-left: 2px; }
