/* Giftbox Product – frontend */
.isgb-box {
	margin: 14px 0 18px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: var(--isgb-bg, #fff);
	overflow: hidden;
	font-size: 14px;
	line-height: 1.45;
	transition: box-shadow .3s;
}
.isgb-box, .isgb-scroll, .isgb-archive-label, .isgb-cart-badge, .isgb-free { --_m: var(--isgb-main, #dd3333); }

.isgb-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid #ececec;
	background: linear-gradient(90deg, #fff4e6, #fffaf3 60%, var(--isgb-bg, #fff));
}
.isgb-head-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: var(--_m);
	color: #fff;
	flex: none;
}
.isgb-head-icon svg { width: 17px; height: 17px; }

/* Hiệu ứng hộp quà: lắc nhẹ + vòng sáng lan ra */
.isgb-head-icon { position: relative; }
.isgb-head-icon svg {
	transform-origin: 50% 90%;
	animation: isgb-gift-shake 2.8s ease-in-out infinite;
}
.isgb-head-icon::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: var(--_m);
	z-index: -1;
	animation: isgb-gift-ring 2.8s ease-out infinite;
}
.isgb-head-icon::after {
	content: "";
	position: absolute;
	top: -3px;
	right: -3px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #ffc107;
	box-shadow: 0 0 0 2px #fff;
	animation: isgb-gift-spark 2.8s ease-in-out infinite;
}
.isgb-head { position: relative; z-index: 0; }
@keyframes isgb-gift-shake {
	0%, 55%, 100% { transform: rotate(0) scale(1); }
	60% { transform: rotate(-14deg) scale(1.12); }
	66% { transform: rotate(12deg) scale(1.12); }
	72% { transform: rotate(-9deg) scale(1.08); }
	78% { transform: rotate(6deg) scale(1.04); }
	84% { transform: rotate(-3deg) scale(1); }
}
@keyframes isgb-gift-ring {
	0%, 55% { transform: scale(1); opacity: 0; }
	60% { transform: scale(1); opacity: .45; }
	100% { transform: scale(1.7); opacity: 0; }
}
@keyframes isgb-gift-spark {
	0%, 55%, 100% { transform: scale(0); opacity: 0; }
	65% { transform: scale(1.2); opacity: 1; }
	85% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.isgb-head-icon svg, .isgb-head-icon::before, .isgb-head-icon::after { animation: none; }
	.isgb-head-icon::after { transform: scale(1); opacity: 1; }
}
.isgb-head-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.isgb-title { font-weight: 600; font-size: 15px; color: #222; }
.isgb-sub { font-size: 12px; color: #777; }

.isgb-cond { padding: 8px 14px 0; font-size: 13px; color: #555; }

.isgb-list { list-style: none; margin: 0 !important; padding: 6px 0 !important; }
.isgb-list .isgb-item {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0 !important;
	padding: 6px 14px;
	list-style: none;
}
.isgb-item + .isgb-item { border-top: 1px dashed #eee; }
.isgb-item label {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	margin: 0;
	font-weight: 400;
	font-size: 14px;
	cursor: pointer;
}
.isgb-type-all .isgb-item label { cursor: default; }

/* Ẩn input gốc, dùng .isgb-mark */
.isgb-item .isgb-input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}
.isgb-mark {
	position: relative;
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid #bbb;
	border-radius: 50%;
	transition: border-color .15s, background-color .15s;
}
.isgb-input:checked + .isgb-mark { border-color: var(--_m); }
.isgb-input:focus-visible + .isgb-mark { outline: 2px solid var(--_m); outline-offset: 2px; }

/* Circle */
.isgb-check-circle .isgb-input:checked + .isgb-mark::after {
	content: "";
	position: absolute;
	inset: 2px;
	border-radius: 50%;
	background: var(--_m);
}
/* Square */
.isgb-check-square .isgb-mark { border-radius: 3px; }
.isgb-check-square .isgb-input:checked + .isgb-mark { background: var(--_m); }
.isgb-check-square .isgb-input:checked + .isgb-mark::after,
.isgb-check-check .isgb-input:checked + .isgb-mark::after {
	content: "";
	position: absolute;
	left: 3.5px;
	top: 0;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
/* Check */
.isgb-check-check .isgb-mark { border-color: transparent; }
.isgb-check-check .isgb-input:not(:checked) + .isgb-mark { border-color: #ccc; border-radius: 50%; }
.isgb-check-check .isgb-input:checked + .isgb-mark { border-color: transparent; }
.isgb-check-check .isgb-input:checked + .isgb-mark::after { border-color: var(--_m); left: 4px; width: 6px; height: 11px; border-width: 0 3px 3px 0; top: -2px; }

.isgb-thumb {
	flex: none;
	width: 40px;
	height: 40px;
	padding: 2px;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
}
.isgb-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0 !important; }
.isgb-type-one .isgb-item.is-active .isgb-thumb { border-color: var(--_m); }

.isgb-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.isgb-box .isgb-name { color: #333; font-size: 14px; text-decoration: none; }
.isgb-box a.isgb-name:hover { color: var(--_m); text-decoration: underline; }
.isgb-box .isgb-price,
.isgb-box .isgb-price .woocommerce-Price-amount,
.isgb-box .isgb-price bdi,
.isgb-box .isgb-price .woocommerce-Price-currencySymbol {
	font-size: 14px !important;
	line-height: inherit !important;
	vertical-align: baseline !important;
	top: 0 !important;
}
.isgb-box .isgb-price { color: var(--_m); font-weight: 700; white-space: nowrap; }
.isgb-price del { color: #999; font-weight: 400; margin-right: 2px; }
.isgb-price ins { text-decoration: none; }
.isgb-price .woocommerce-Price-amount { color: inherit; }


/* Tổng giá trị quà – nằm bên phải header */
.isgb-head .isgb-total {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-left: auto;
	text-align: right;
	line-height: 1.3;
}
.isgb-total-label { color: #555; font-size: 13px; }
.isgb-box .isgb-total-value,
.isgb-box .isgb-total-value .woocommerce-Price-amount,
.isgb-box .isgb-total-value bdi {
	color: var(--_m);
	font-size: 16px !important;
	font-weight: 700;
	line-height: inherit !important;
	white-space: nowrap;
}

.isgb-extra { padding: 10px 14px 12px; border-top: 1px solid #ececec; }
.isgb-extra-title { font-weight: 600; margin-bottom: 6px; color: #222; }
.isgb-extra-content p { margin: 0 0 6px; }
.isgb-extra-content p:last-child { margin-bottom: 0; }
.isgb-extra-content ul { list-style: none; margin: 0 !important; padding: 0 !important; }
.isgb-extra-content li {
	position: relative;
	margin: 0 0 5px !important;
	padding-left: 24px;
	list-style: none;
}
.isgb-extra-content li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 3px;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: var(--_m);
}
.isgb-extra-content li::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 5.5px;
	width: 4px;
	height: 7px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.isgb-box.isgb-flash { box-shadow: 0 0 0 3px var(--_m); }

/* Khung quà ở archive (dưới giá) – selector mạnh để Flatsome không ghi đè */
.product-small .isgb-archive-label,
.products .isgb-archive-label,
.isgb-archive-label {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	margin: 10px 0 0 !important;
	padding: 8px 10px !important;
	border: 1px solid #e3e6ec;
	border-radius: 8px;
	background: #f5f6f8 !important;
	text-align: left;
	line-height: 1.3;
}
.isgb-archive-label .isgb-al-text {
	display: block;
	flex: 0 0 auto;
	color: var(--_m);
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap !important;
	word-break: keep-all;
}
.isgb-archive-label .isgb-al-thumbs {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}
.isgb-archive-label .isgb-al-thumb {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 34px !important;
	width: 34px !important;
	height: 34px !important;
	min-width: 0 !important;
	max-width: 34px !important;
	padding: 5px;
	margin: 0 !important;
	box-sizing: border-box;
	border: 1px solid #e3e6ec;
	border-radius: 50%;
	background: #fff;
	overflow: hidden;
}
.isgb-archive-label .isgb-al-thumb img,
.isgb-archive-label img.isgb-al-img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	object-fit: contain;
	opacity: 1 !important;
	position: static !important;
	transform: none !important;
}
.isgb-archive-label .isgb-al-more {
	flex: 0 0 auto;
	color: #555;
	font-size: 13px;
	letter-spacing: 1px;
	line-height: 1;
	padding: 0 2px 4px;
}
@media (max-width: 549px) {
	.isgb-archive-label { padding: 6px 8px !important; gap: 6px; }
	.isgb-archive-label .isgb-al-text { font-size: 12px; }
	.isgb-archive-label .isgb-al-thumbs { gap: 5px; }
	.isgb-archive-label .isgb-al-thumb { flex-basis: 28px !important; width: 28px !important; height: 28px !important; max-width: 28px !important; padding: 4px; }
}

/* Nút cuộn trang */
.isgb-scroll {
	position: fixed;
	right: 18px;
	bottom: 90px;
	z-index: 999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--_m);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
	transition: opacity .25s, transform .25s;
	animation: isgb-bounce 2.4s ease-in-out infinite;
}
.isgb-scroll svg { width: 24px; height: 24px; }
.isgb-scroll.is-hidden { opacity: 0; transform: scale(.6); pointer-events: none; }
@keyframes isgb-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) {
	.isgb-scroll { animation: none; }
}

/* Giỏ hàng */
.isgb-cart-badge {
	display: inline-block;
	margin-right: 4px;
	padding: 0 6px;
	border-radius: 3px;
	background: var(--_m);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	vertical-align: middle;
}
.isgb-free { color: var(--_m); font-weight: 600; }

@media (max-width: 549px) {
	.isgb-head, .isgb-list .isgb-item, .isgb-extra { padding-left: 10px; padding-right: 10px; }
	.isgb-head .isgb-total { flex-direction: column; align-items: flex-end; gap: 0; }
	.isgb-total-label { font-size: 11px; }
	.isgb-box .isgb-total-value, .isgb-box .isgb-total-value .woocommerce-Price-amount, .isgb-box .isgb-total-value bdi { font-size: 15px !important; }
}
