/**
 * Chi tiết sản phẩm — layout tóm tắt + box lưu ý mua hàng.
 * Nút chính: tông #002855 (giữ brand theme con).
 */

/* —— Khung sản phẩm: ảnh max 400px | nội dung co giãn | sidebar max 317px (container site 1480px) —— */
.single-product div.product.type-product .product-container {
	max-width: 1480px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
	box-sizing: border-box;
}

.single-product .product-main .row.content-row {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	column-gap: 1.75rem;
	row-gap: 1.25rem;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.single-product .product-main .row.content-row>.col {
	float: none;
}

/* Ảnh: tối đa 400px, không co theo % Flatsome */
.single-product .product-main .row.content-row>.product-gallery.col {
	flex: 0 0 auto;
	width: min(400px, 100%) !important;
	max-width: 400px !important;
	padding-left: 0;
	position: relative; /* Badge cần relative wrapper */
}

/* Cột ảnh (large-X col) trong product-main cũng cần relative cho badge overlay */
.single-product .product-main .row > div[class*="large-"].col:first-child {
	position: relative;
}

/* Giữa: phần còn lại — flex-grow 1 chia theo không gian trống */
.single-product .product-main .row.content-row>.product-info.summary.col {
	flex: 1 1 0;
	min-width: 0;
	width: auto !important;
	max-width: none !important;
}

/* Sidebar: tối đa 317px (layout có sidebar — Flatsome ẩn cột trên medium) */
.single-product .product-main .row.content-row>#product-sidebar.col:not(.mfp-hide) {
	flex: 0 0 auto;
	width: 317px !important;
	max-width: 317px !important;
	padding-right: 0;
}

@media screen and (max-width: 849px) {
	.single-product .product-main .row.content-row {
		flex-wrap: wrap;
	}

	.single-product .product-main .row.content-row>.product-gallery.col {
		flex: 1 1 100%;
		width: 100% !important;
		max-width: 400px;
		margin-left: auto;
		margin-right: auto;
	}

	.single-product .product-main .row.content-row>.product-info.summary.col {
		flex: 1 1 100%;
		width: 100% !important;
	}
}

/* —— Vùng summary —— */
.single-product #product-page .product-summary,
.single-product div.product .summary.entry-summary {
	max-width: 100%;
}

.single-product .product_title.entry-title,
.single-product h1.product_title {
	font-size: clamp(1.35rem, 2.8vw, 1.75rem);
	font-weight: 700;
	color: #002855;
	line-height: 1.3;
	margin: 0 0 0.5rem;
	letter-spacing: -0.01em;
}

.single-product .ddg-product-title-divider {
	height: 2px;
	width: 100%;
	max-width: 200px;
	background: linear-gradient(90deg, #002855, rgba(0, 40, 85, 0.15));
	border-radius: 2px;
	margin: 0 0 1rem;
}

/* Giá + tình trạng */
.single-product .ddg-price-stock-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin: 0 0 1.25rem;
	padding: 0.65rem 0 1rem;
	border-bottom: 1px solid #ececec;
}

.single-product .ddg-price-stock-row .ddg-meta-label {
	font-size: 0.9375rem;
	color: #666;
	font-weight: 500;
	margin-right: 0.25rem;
}

.single-product .ddg-price-col .ddg-price-inline-wrap,
.single-product .ddg-price-col .price-wrapper {
	display: inline-block;
	vertical-align: baseline;
}

.single-product .ddg-price-col .woocommerce-Price-amount,
.single-product .ddg-price-col .price {
	font-size: 1.35rem;
	font-weight: 700;
	color: #c51230 !important;
}

.single-product .ddg-stock-col {
	text-align: right;
	flex: 1 1 auto;
	min-width: 140px;
}

.single-product .ddg-stock-col .ddg-stock-value.is-in-stock {
	color: #2d8a46;
	font-weight: 700;
	font-size: 1rem;
}

.single-product .ddg-stock-col .ddg-stock-value.is-out-of-stock {
	color: #a94442;
	font-weight: 700;
}

@media screen and (max-width: 48em) {
	.single-product .ddg-price-stock-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.single-product .ddg-stock-col {
		text-align: left;
	}
}

/* —— Hàng giỏ hàng trang sản phẩm: Số lượng (pill) + THÊM VÀO GIỎ + MUA NGAY —— */
.single-product form.cart {
	margin-top: 0.35rem;
}

.single-product .ddg-cart-actions-row--product-inner {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.85rem 1.1rem;
	width: 100%;
	min-width: 0;
}

.single-product .ddg-cart-actions-row--product-inner .ddg-variation-qty-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.55rem 0.85rem;
	min-width: 0;
}

.single-product .ddg-cart-actions-row--product-inner .ddg-qty-label {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1a1a1a;
	white-space: nowrap;
}

/* Cụm số pill (+/−) */
.single-product .ddg-qty-pill {
	display: inline-flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 0;
	padding: 0.2rem 0.35rem;
	background: #eceff4;
	border-radius: 999px;
	border: none;
	box-sizing: border-box;
}

.single-product .ddg-qty-pill__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.35rem;
	height: 2.35rem;
	min-width: 2.35rem;
	min-height: 2.35rem;
	aspect-ratio: 1;
	padding: 0;
	margin: 0;
	border: none !important;
	border-radius: 50% !important;
	box-sizing: border-box;
	background: #fff;
	color: #002855;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 0;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.single-product .ddg-qty-pill__btn:hover {
	background: #f8fafc;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.single-product .ddg-qty-pill__btn:active {
	transform: scale(0.96);
}

.single-product .ddg-qty-pill input.qty {
	width: 2.75rem;
	min-width: 2.75rem;
	max-width: 3.5rem;
	min-height: 2.35rem;
	margin: 0 0.15rem;
	padding: 0 0.25rem;
	border: none;
	background: transparent;
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	color: #1a1a1a;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
}

.single-product .ddg-qty-pill input.qty::-webkit-outer-spin-button,
.single-product .ddg-qty-pill input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.single-product .ddg-qty-pill input.qty:focus {
	outline: none;
	box-shadow: none;
}

/* Hai nút pill */
.single-product .ddg-cart-button-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem 0.75rem;
	margin-left: auto;
	min-width: 0;
}

.single-product .ddg-btn-addtocart.single_add_to_cart_button,
.single-product .ddg-cart-button-group .single_add_to_cart_button.ddg-btn-addtocart {
	min-height: 2.85rem;
	padding: 0.55rem 1.35rem;
	border-radius: 999px !important;
	border: none !important;
	background: #e31837 !important;
	color: #fff !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.045em;
	text-transform: uppercase;
	line-height: 1.2;
	box-shadow: 0 2px 8px rgba(227, 24, 55, 0.35);
	transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.single-product .ddg-btn-addtocart.single_add_to_cart_button:hover:not(:disabled),
.single-product .ddg-cart-button-group .single_add_to_cart_button.ddg-btn-addtocart:hover:not(:disabled) {
	filter: brightness(1.05);
	box-shadow: 0 4px 14px rgba(227, 24, 55, 0.45);
}

/* Mua ngay: tông hệ thống #002855 (cùng brand nút/heading theme con) */
.single-product .ddg-buy-now-button {
	min-height: 2.85rem;
	padding: 0.55rem 1.35rem;
	border-radius: 999px !important;
	border: none !important;
	background: #002855 !important;
	border-color: #002855 !important;
	color: #fff !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.045em;
	text-transform: uppercase;
	line-height: 1.2;
	box-shadow: 0 2px 8px rgba(0, 40, 85, 0.28);
	cursor: pointer;
	transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.single-product .ddg-buy-now-button:hover:not(:disabled) {
	filter: brightness(1.06);
	box-shadow: 0 4px 14px rgba(0, 40, 85, 0.35);
}

.single-product .ddg-btn-addtocart.single_add_to_cart_button:disabled,
.single-product .ddg-buy-now-button:disabled {
	opacity: 0.52;
	cursor: not-allowed;
	filter: none;
	box-shadow: none;
}

/* ── Box lưu ý mua hàng ── */
.ddg-purchase-note {
	margin: 1.25rem 0 0;
	border-radius: 10px;
	border: 1.5px solid #d4a843;
	background: #fffef5;
	box-shadow: 0 2px 12px rgba(180, 140, 30, 0.1);
	overflow: hidden;
}

/* Header giống box cam kết: navy + chữ vàng */
.ddg-purchase-note__header {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 16px;
	background: #002855;
	color: #f5c842;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.13em;
	text-transform: uppercase;
}

.ddg-purchase-note__header svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: #f5c842;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

/* Body chứa các section */
.ddg-purchase-note__body {
	padding: 12px 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Mỗi section: heading + list */
.ddg-purchase-note__section {
	margin: 0;
}

.ddg-purchase-note__section + .ddg-purchase-note__section {
	padding-top: 10px;
	border-top: 1px solid rgba(212, 168, 67, 0.35);
}

/* Heading mỗi mục — đậm, màu navy */
.ddg-purchase-note__heading {
	margin: 0 0 5px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #002855;
	text-transform: uppercase;
	line-height: 1.3;
}

/* Danh sách — bullet điểm vàng */
.ddg-purchase-note__list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
	color: #444;
	line-height: 1.55;
}

.ddg-purchase-note__list li {
	padding-left: 1.1rem;
	position: relative;
	margin-bottom: 3px;
}

.ddg-purchase-note__list li:last-child {
	margin-bottom: 0;
}

.ddg-purchase-note__list li::before {
	content: '•';
	position: absolute;
	left: 0;
	top: 0;
	color: #c08820;
	font-weight: 700;
	font-size: 0.9rem;
	line-height: 1.55;
}

/* Text đơn giản (không phải list) */
.ddg-purchase-note__text {
	margin: 0;
	font-size: 0.85rem;
	color: #555;
	line-height: 1.55;
}

/* Nội dung tùy chỉnh per-product (HTML tự do) */
.ddg-purchase-note--custom {
	padding: 12px 16px 14px;
}

.ddg-purchase-note--custom p {
	margin: 0 0 0.6rem;
	font-size: 0.87rem;
	color: #444;
	line-height: 1.55;
}

.ddg-purchase-note--custom p:last-child {
	margin-bottom: 0;
}

.ddg-purchase-note--custom strong {
	color: #002855;
	font-weight: 700;
}

.ddg-purchase-note--custom ul {
	padding-left: 0;
	list-style: none;
	margin: 0 0 0.6rem;
	font-size: 0.85rem;
	color: #444;
	line-height: 1.55;
}

.ddg-purchase-note--custom ul li {
	padding-left: 1.1rem;
	position: relative;
	margin-bottom: 3px;
}

.ddg-purchase-note--custom ul li::before {
	content: '•';
	position: absolute;
	left: 0;
	color: #c08820;
	font-weight: 700;
	font-size: 0.9rem;
}

/* —— Không có giá: ẩn vùng giá, hiện "Liên hệ báo giá" —— */
.single-product .ddg-price-hidden {
	display: none !important;
}

.single-product .ddg-contact-price {
	font-size: 1.15rem;
	font-weight: 700;
	color: #c51230;
	margin-right: 0;
}

/* —— Xem thêm / Thu gọn mô tả sản phẩm —— */
.ddg-desc-readmore-wrap {
	position: relative;
	overflow: hidden;
	transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient fade khi đang thu gọn */
.ddg-desc-readmore-wrap.ddg-desc--collapsed::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 56px;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 100%);
	pointer-events: none;
}

/* Nút Xem thêm / Thu gọn */
.ddg-readmore-btn-wrap {
	text-align: center;
	margin-top: 0.75rem;
}

.ddg-readmore-btn {
	display: inline-block;
	padding: 0.45rem 1.35rem;
	border: 1.5px solid #2E5C8A;
	border-radius: 999px;
	background: transparent;
	color: #2E5C8A;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	line-height: 1.5;
}

.ddg-readmore-btn:hover {
	background: #2E5C8A;
	color: #fff;
}

/* ══════════════════════════════════════════════════════════
   BADGE PHÔI GƯƠNG — overlay góc trên trái ảnh sản phẩm
   ══════════════════════════════════════════════════════════ */
.ddg-substrate-badge {
	position: absolute;
	top: 18px;
	left: 20px;
	z-index: 10;
	width: 90px;
	height: 116px;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	isolation: isolate;
}

/* Lớp ngoài: viền vàng dáng khiên giống badge mẫu */
.ddg-substrate-badge__ring {
	position: relative;
	width: 90px;
	height: 116px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3px;
	box-sizing: border-box;
	clip-path: polygon(50% 0%, 92% 12%, 92% 74%, 50% 100%, 8% 74%, 8% 12%);
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.18)),
		linear-gradient(165deg, #f6d57a 0%, #d59f2a 32%, #9e6818 66%, #f0c856 100%);
	filter: drop-shadow(0 8px 14px rgba(0, 24, 52, 0.34));
}

.ddg-substrate-badge__ring::before {
	content: '';
	position: absolute;
	top: 4px;
	left: 50%;
	z-index: 3;
	width: 62px;
	height: 29px;
	transform: translateX(-50%);
	clip-path: polygon(50% 0%, 100% 42%, 80% 100%, 20% 100%, 0% 42%);
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 52%) 0 0 / 34% 100% no-repeat,
		linear-gradient(160deg, #dd2636 0%, #9b1528 100%) 0 0 / 34% 100% no-repeat,
		linear-gradient(150deg, #204b96 0%, #071f55 100%) 50% 0 / 34% 100% no-repeat,
		linear-gradient(150deg, #0b2a62 0%, #061739 100%) 100% 0 / 34% 100% no-repeat;
	box-shadow: inset 0 0 0 1px rgba(255, 222, 124, 0.42);
}

.ddg-substrate-badge__ring::after {
	content: '';
	position: absolute;
	inset: 7px 9px 13px;
	z-index: 2;
	clip-path: polygon(50% 0%, 91% 12%, 91% 72%, 50% 100%, 9% 72%, 9% 12%);
	border: 1px solid rgba(244, 203, 82, 0.6);
	border-bottom-color: rgba(255, 225, 126, 0.82);
	box-sizing: border-box;
	opacity: 0.9;
}

/* Lớp trong: nền navy cao, có đáy nhọn */
.ddg-substrate-badge__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-align: center;
	padding: 35px 7px 15px;
	box-sizing: border-box;
	clip-path: polygon(50% 0%, 92% 12%, 92% 74%, 50% 100%, 8% 74%, 8% 12%);
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.11) 0%, transparent 38%),
		linear-gradient(180deg, #123a74 0%, #08295c 44%, #041b42 100%);
	overflow: hidden;
}

.ddg-substrate-badge__inner::before {
	content: '';
	position: absolute;
	top: 29px;
	left: 14px;
	right: 14px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(245, 204, 80, 0.78), transparent);
}

.ddg-substrate-badge__inner::after {
	content: '';
	position: absolute;
	right: 9px;
	top: 18px;
	bottom: 18px;
	width: 16px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
	transform: skewX(-12deg);
	opacity: 0.7;
}

.ddg-substrate-badge__line1 {
	position: relative;
	z-index: 4;
	display: block;
	font-size: 0.46rem;
	font-weight: 800;
	letter-spacing: 0.045em;
	text-transform: uppercase;
	color: #ffffff;
	line-height: 1.05;
	margin-bottom: 4px;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.24);
	white-space: nowrap;
}

.ddg-substrate-badge__line2 {
	position: relative;
	z-index: 4;
	display: block;
	font-size: 0.84rem;
	font-weight: 900;
	letter-spacing: 0.025em;
	text-transform: uppercase;
	color: #f4c74e;
	line-height: 1.02;
	text-shadow: 0 1px 0 rgba(70, 42, 0, 0.38);
	white-space: nowrap;
}

.ddg-substrate-badge__line3 {
	position: relative;
	z-index: 4;
	display: block;
	font-size: 0.35rem;
	font-weight: 800;
	letter-spacing: 0.025em;
	text-transform: uppercase;
	color: #ffffff;
	line-height: 1.1;
	margin-top: 7px;
	padding-top: 5px;
	border-top: 1px solid rgba(245, 204, 80, 0.52);
	white-space: nowrap;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* ══════════════════════════════════════════════════════════
   BOX CAM KẾT CHẤT LƯỢNG
   ══════════════════════════════════════════════════════════ */
.ddg-quality-box {
	margin: 0.5rem 0 1.25rem;
	border-radius: 10px;
	border: 1.5px solid #d4a843;
	/* Nền trắng/kem rất nhạt, gần như trắng */
	background: #fffef5;
	box-shadow: 0 2px 12px rgba(180, 140, 30, 0.1);
	overflow: hidden;
}

/* Header dải màu xanh navy đậm + chữ vàng */
.ddg-quality-box__header {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 8px 16px;
	background: #002855;
	color: #f5c842;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.13em;
	text-transform: uppercase;
}

.ddg-quality-box__header svg {
	width: 15px;
	height: 15px;
	fill: #f5c842;
	flex-shrink: 0;
}

/* Tiêu đề chính */
.ddg-quality-box__title {
	text-align: center;
	font-size: 1rem;
	font-weight: 700;
	color: #111;
	margin: 10px 16px 3px;
	line-height: 1.3;
}

/* Subtitle */
.ddg-quality-box__subtitle {
	text-align: center;
	font-size: 0.77rem;
	color: #777;
	margin: 0 16px 10px;
	line-height: 1.45;
}

.ddg-quality-box__divider {
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, #d4a843 20%, #d4a843 80%, transparent 100%);
	margin: 0 12px;
	opacity: 0.6;
}

/* Hàng 3 icon tính năng — layout ngang nhỏ gọn */
.ddg-quality-box__features {
	display: flex;
	align-items: center;
	justify-content: space-evenly;
	padding: 10px 10px 12px;
	gap: 6px;
}

.ddg-quality-box__feature {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 5px;
	flex: 1;
	padding: 0 2px;
	text-align: left;
	position: relative;
}

/* Đường kẻ dọc phân cách */
.ddg-quality-box__feature + .ddg-quality-box__feature::before {
	content: '';
	position: absolute;
	left: 0;
	top: 15%;
	bottom: 15%;
	width: 1px;
	background: #d4a843;
	opacity: 0.4;
}

/* Icon nhỏ gọn */
.ddg-quality-box__feature-icon {
	width: 24px;
	height: 24px;
	min-width: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #c08820;
	border-radius: 50%;
	box-sizing: border-box;
	background: #fff;
	padding: 4px;
	flex-shrink: 0;
}

.ddg-quality-box__feature-icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: #7a5500;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ddg-quality-box__feature-label {
	font-size: 0.68rem;
	font-weight: 600;
	color: #333;
	line-height: 1.25;
	white-space: nowrap;
}

/* ── Related products: 6 cột full width ── */
.related-products-wrapper {
	clear: both;
}

.related-products-wrapper .related.products {
	margin: 0;
}

.related-products-wrapper .related.products h2 {
	text-align: center;
	margin-bottom: 24px;
	font-size: 1.4rem;
}

/* Grid 6 cột */
.related-products-wrapper ul.products {
	display: grid !important;
	grid-template-columns: repeat(6, 1fr) !important;
	gap: 16px !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 auto !important;
	float: none !important;
	justify-items: center;
}

.related-products-wrapper ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
	.related-products-wrapper ul.products {
		grid-template-columns: repeat(4, 1fr) !important;
	}
}

@media (max-width: 640px) {
	.related-products-wrapper ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}


/* ═══════════════════════════════════════════════════════════════════
   LUXURY SPARKLE — TikTok-style lấp lánh ảnh sản phẩm
   ═══════════════════════════════════════════════════════════════════ */

/* ── Keyframes ── */

/* Entrance: ảnh trượt lên + fade in */
@keyframes ddg-img-enter {
	from { opacity: 0; transform: translateY(16px) scale(0.975); }
	to   { opacity: 1; transform: translateY(0)    scale(1);     }
}

/* Ngôi sao 4 cánh: xuất hiện → scale lên → xoay → biến mất */
@keyframes ddg-sparkle-pop {
	0%   { opacity: 0;   transform: scale(0)    rotate(var(--rot, 0deg)); }
	20%  { opacity: 1;   transform: scale(1.15) rotate(var(--rot, 0deg)); }
	55%  { opacity: 0.9; transform: scale(0.9)  rotate(calc(var(--rot, 0deg) + 30deg)); }
	100% { opacity: 0;   transform: scale(0)    rotate(calc(var(--rot, 0deg) + 60deg)); }
}

/* Glow vàng rung nhẹ trên gallery sau entrance */
@keyframes ddg-glow-idle {
	0%, 100% { box-shadow: 0 8px 32px rgba(212, 168, 67, 0.12), 0 2px 8px rgba(0,0,0,0.10); }
	50%       { box-shadow: 0 8px 40px rgba(212, 168, 67, 0.22), 0 2px 8px rgba(0,0,0,0.10); }
}

/* ── Gallery wrapper ── */
.single-product .woocommerce-product-gallery {
	position: relative;
	border-radius: 12px;
	overflow: visible;       /* sparkle có thể tràn ra ngoài viền ảnh */
	isolation: isolate;

	animation:
		ddg-img-enter  0.65s cubic-bezier(0.22, 1, 0.36, 1) both,
		ddg-glow-idle  4s   ease-in-out 0.8s infinite;
}

/* Clip overflow chỉ với ảnh bên trong, không clip sparkle */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
	border-radius: 12px;
	overflow: hidden;
}

/* ── Gold vignette frame (inset) ── */
.single-product .woocommerce-product-gallery::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
	border-radius: 12px;
	box-shadow:
		inset 0 0 0 1.5px rgba(212, 168, 67, 0.35),
		inset 0 0 28px 0   rgba(180, 130, 20, 0.07);
}

/* ── Ảnh chính: hover zoom ── */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img,
.single-product .woocommerce-product-gallery__wrapper img {
	transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
	display: block;
}

.single-product .woocommerce-product-gallery:hover .woocommerce-product-gallery__image img,
.single-product .woocommerce-product-gallery:hover .woocommerce-product-gallery__wrapper img {
	transform: scale(1.032);
}

/* ── Sparkle layer (JS tạo ra) ── */
.ddg-sparkle-layer {
	position: absolute;
	inset: -18px;           /* tràn ra ngoài để sparkle xuất hiện ở rìa ảnh */
	z-index: 20;
	pointer-events: none;
	overflow: visible;
}

/* ── Mỗi sparkle: ngôi sao 4 cánh bằng CSS ── */
.ddg-sparkle {
	position: absolute;
	pointer-events: none;
	transform-origin: center;
	animation: ddg-sparkle-pop var(--dur, 1000ms) ease-in-out forwards;
}

/* Cánh dọc */
.ddg-sparkle::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 0;
	width: 28%;
	height: 100%;
	transform: translateX(-50%);
	background: radial-gradient(
		ellipse at center,
		var(--sc, #ffe066) 0%,
		rgba(255, 224, 102, 0.6) 50%,
		transparent 100%
	);
	border-radius: 50%;
}

/* Cánh ngang */
.ddg-sparkle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 28%;
	transform: translateY(-50%);
	background: radial-gradient(
		ellipse at center,
		var(--sc, #ffe066) 0%,
		rgba(255, 224, 102, 0.6) 50%,
		transparent 100%
	);
	border-radius: 50%;
}

/* ── Thumbnail strip ── */
.single-product .flex-control-thumbs li img {
	border-radius: 6px;
	transition: box-shadow 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
	opacity: 0.72;
}

.single-product .flex-control-thumbs li img:hover,
.single-product .flex-control-thumbs li img.flex-active {
	opacity: 1;
	box-shadow: 0 0 0 2px #d4a843, 0 4px 12px rgba(212, 168, 67, 0.32);
	transform: translateY(-2px);
}

/* ── Mobile: đơn giản hoá ── */
@media (max-width: 600px) {
	.single-product .woocommerce-product-gallery {
		animation: ddg-img-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
	}
	/* Giảm số sparkle bằng cách thu nhỏ layer */
	.ddg-sparkle-layer {
		inset: -8px;
	}
}

