/* Frequently Bought Together by Dattk + Claude */
.xcca-box {
	--xcca-primary: #2f9e4f;
	--xcca-soft: #f0f9f2;
	--xcca-border: #cfe8d6;
	--xcca-bg: #fff;
	--xcca-summary-bg: #f7f8f8;
	--xcca-price: #111;
	--xcca-btn-bg: #2f9e4f;
	--xcca-btn-hover: #25823f;
	--xcca-btn-text: #fff;
	--xcca-img: 48px;
	--xcca-promo: #e5202e;
	--xcca-line: #e6e8eb;
	--xcca-muted: #6b7280;

	background: var(--xcca-bg);
	border: 1px solid var(--xcca-line);
	border-radius: 16px;
	padding: 20px;
	margin: 20px 0;
	color: #1f2937;
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
	max-width: 100%;
	min-width: 0;
}
.xcca-box *,
.xcca-box *::before,
.xcca-box *::after { box-sizing: border-box; }

/* ---------- Header ---------- */
.xcca-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 14px;
}
.xcca-eyebrow {
	font-size: 11px;
	font-weight: 700;
	color: var(--xcca-primary);
	letter-spacing: .02em;
	margin-bottom: 4px;
}
.xcca-box .xcca-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 4px;
	padding: 0;
	color: #111;
	text-transform: none;
}
.xcca-box .xcca-subtitle {
	font-size: 13px;
	color: var(--xcca-muted);
	margin: 0;
}
.xcca-note {
	font-size: 13px;
	margin-top: 6px;
}
.xcca-note p { margin: 0; }
.xcca-box .xcca-toggle-all {
	flex: 0 0 auto;
	background: #fff;
	color: #1f2937;
	border: 1px solid var(--xcca-line);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	min-height: 0;
	margin: 0;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: border-color .15s, color .15s;
}
.xcca-box .xcca-toggle-all:hover { border-color: var(--xcca-primary); color: var(--xcca-primary); }

/* ---------- Layout ---------- */
.xcca-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 270px;
	gap: 16px;
	align-items: start;
}
.xcca-list,
.xcca-summary,
.xcca-head__text,
.xcca-main__info,
.xcca-item__info { min-width: 0; }

/* ---------- Checkbox ---------- */
.xcca-box .xcca-check {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	cursor: pointer;
	display: block;
}
.xcca-box .xcca-check input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}
.xcca-check__box {
	display: block;
	width: 18px;
	height: 18px;
	border: 2px solid #c4ccd6;
	border-radius: 4px;
	background: #fff center / 12px no-repeat;
	transition: background-color .15s, border-color .15s;
}
.xcca-check input:checked + .xcca-check__box {
	background-color: var(--xcca-primary);
	border-color: var(--xcca-primary);
	background-image: 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.xcca-check input:focus-visible + .xcca-check__box {
	outline: 2px solid var(--xcca-primary);
	outline-offset: 2px;
}
.xcca-check input:disabled + .xcca-check__box { opacity: .4; }

/* ---------- Sản phẩm chính ---------- */
.xcca-main {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--xcca-line);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}
.xcca-main.is-checked {
	border-color: var(--xcca-border);
	background: var(--xcca-soft);
}
.xcca-main__thumb {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	background: #fff;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.xcca-main__thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.xcca-main__info { flex: 1; min-width: 0; }
.xcca-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 6px;
}
.xcca-badge {
	background: var(--xcca-primary);
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 5px;
	text-transform: uppercase;
}
.xcca-chip {
	background: #fff;
	border: 1px solid var(--xcca-line);
	color: #374151;
	font-size: 11.5px;
	padding: 2px 8px;
	border-radius: 5px;
}
.xcca-main__name {
	font-size: 16px;
	font-weight: 700;
	color: #111;
	line-height: 1.3;
}
.xcca-main__price {
	flex: 0 0 auto;
	text-align: right;
}
.xcca-main__regular {
	display: block;
	color: #9ca3af;
	font-size: 12px;
}
.xcca-main__now {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}
.xcca-pct {
	background: var(--xcca-soft);
	color: var(--xcca-primary);
	border: 1px solid var(--xcca-border);
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 5px;
}
.xcca-main__sale {
	font-size: 20px;
	font-weight: 800;
	color: var(--xcca-price);
	white-space: nowrap;
}

/* ---------- Phụ kiện ---------- */
.xcca-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 10px;
}
.xcca-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid var(--xcca-line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s;
}
.xcca-item.is-checked { border-color: var(--xcca-primary); }
.xcca-item:not(.is-checked) .xcca-item__thumb img { opacity: .55; }
.xcca-item__thumb {
	flex: 0 0 var(--xcca-img);
	width: var(--xcca-img);
	height: var(--xcca-img);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: 6px;
}
.xcca-item__thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: opacity .15s;
}
.xcca-item__info { flex: 1; min-width: 0; }
.xcca-box .xcca-item__name {
	display: block;
	font-size: 12.5px;
	color: #1f2937;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-decoration: none;
}
.xcca-box .xcca-item__name:hover { color: var(--xcca-primary); }
.xcca-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin-top: 3px;
}
.xcca-item__price {
	font-size: 13px;
	font-weight: 700;
	color: var(--xcca-price);
	white-space: nowrap;
}
.xcca-item__regular {
	font-size: 11px;
	color: #9ca3af;
	white-space: nowrap;
}
.xcca-tag,
.xcca-box select.xcca-variant {
	font-size: 11px;
	line-height: 1.4;
	color: #374151;
	background: #f3f4f6;
	border: 1px solid var(--xcca-line);
	border-radius: 5px;
	padding: 1px 6px;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.xcca-box select.xcca-variant {
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 1px 18px 1px 6px;
	box-shadow: none;
	cursor: pointer;
	background-color: #fff;
	background-position: right 4px center;
	background-size: 10px;
}

/* ---------- Tóm tắt ---------- */
.xcca-summary {
	position: sticky;
	top: 90px;
	background: var(--xcca-summary-bg);
	border: 1px solid var(--xcca-line);
	border-radius: 12px;
	padding: 16px;
}
.xcca-summary__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}
.xcca-summary__title { font-weight: 700; font-size: 14px; color: #111; }
.xcca-count {
	font-size: 11px;
	font-weight: 700;
	color: var(--xcca-primary);
	background: var(--xcca-soft);
	border: 1px solid var(--xcca-border);
	padding: 2px 8px;
	border-radius: 999px;
	white-space: nowrap;
}
.xcca-row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 13px;
	margin: 6px 0;
}
.xcca-row > span:last-child { font-weight: 600; white-space: nowrap; }
.xcca-row--save > span:last-child { color: var(--xcca-primary); }
.xcca-row--combo { color: var(--xcca-promo); font-weight: 600; }
.xcca-row--combo > span:last-child { color: var(--xcca-promo); font-weight: 700; }
.xcca-divider { border-top: 1px solid var(--xcca-line); margin: 12px 0; }
.xcca-total-label { font-size: 12px; color: var(--xcca-muted); }
.xcca-total {
	font-size: 26px;
	font-weight: 800;
	color: var(--xcca-price);
	line-height: 1.2;
	margin: 2px 0 12px;
}
/* Dòng ưu đãi combo – nổi bật màu đỏ */
.xcca-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--xcca-promo);
	background: #fff;
	border: 1.5px dashed var(--xcca-promo);
	border-radius: 10px;
	padding: 9px 11px;
	margin-bottom: 10px;
}
.xcca-hint__icon { flex: 0 0 18px; }
.xcca-hint.is-ok {
	color: #fff;
	background: var(--xcca-promo);
	border: 1.5px solid var(--xcca-promo);
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 4px 12px -6px var(--xcca-promo);
}

.xcca-box .xcca-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	min-height: 0;
	border: 0;
	border-radius: 10px;
	background: var(--xcca-btn-bg);
	color: var(--xcca-btn-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color .15s;
}
.xcca-box .xcca-btn:hover { background: var(--xcca-btn-hover); color: var(--xcca-btn-text); }
.xcca-box .xcca-btn:focus-visible { outline: 2px solid var(--xcca-btn-hover); outline-offset: 2px; }
.xcca-box .xcca-btn:disabled { opacity: .5; cursor: not-allowed; }
.xcca-btn.is-loading .xcca-btn__icon {
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: xcca-spin .7s linear infinite;
}
.xcca-btn.is-loading .xcca-btn__icon * { display: none; }
@keyframes xcca-spin { to { transform: rotate(360deg); } }

.xcca-msg {
	font-size: 12.5px;
	margin-top: 8px;
	padding: 7px 9px;
	border-radius: 8px;
	color: var(--xcca-primary);
	background: var(--xcca-soft);
}
.xcca-msg.is-error { color: #b42318; background: #fef3f2; }
.xcca-msg a { font-weight: 700; color: inherit; text-decoration: underline; }
.xcca-ship {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	font-size: 12px;
	color: var(--xcca-primary);
}
.xcca-ship svg { flex: 0 0 auto; }

/* ---------- Responsive (theo breakpoint Flatsome) ---------- */
@media (max-width: 1100px) {
	.xcca-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 849px) {
	.xcca-body { grid-template-columns: minmax(0, 1fr); }
	.xcca-summary { position: static; }
}
@media (max-width: 549px) {
	.xcca-box { padding: 14px 12px; margin: 14px 0; border-radius: 12px; }

	.xcca-head { flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; }
	.xcca-head__text { flex: 1 1 100%; }
	.xcca-box .xcca-title { font-size: 17px; }
	.xcca-box .xcca-subtitle { font-size: 12.5px; }
	.xcca-box .xcca-toggle-all { padding: 6px 12px; font-size: 12px; }

	/* Sản phẩm chính: ô tick | ảnh | tên, giá nằm dưới tên */
	.xcca-main {
		display: grid;
		grid-template-columns: 18px 56px minmax(0, 1fr);
		align-items: center;
		gap: 4px 10px;
		padding: 12px 10px;
	}
	.xcca-main__thumb { width: 56px; height: 56px; flex: none; grid-row: span 2; }
	.xcca-main .xcca-check { grid-row: span 2; }
	.xcca-main__name { font-size: 14.5px; }
	.xcca-badges { margin-bottom: 4px; gap: 4px; }
	.xcca-badge { font-size: 9.5px; padding: 2px 6px; }
	.xcca-chip { font-size: 11px; padding: 1px 6px; }
	.xcca-main__price {
		grid-column: 3;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 2px 8px;
		text-align: left;
	}
	.xcca-main__regular { order: 2; }
	.xcca-main__now { justify-content: flex-start; gap: 6px; }

	/* Phụ kiện: 1 cột, tên tối đa 2 dòng */
	.xcca-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
	.xcca-item { padding: 8px; gap: 8px; }
	.xcca-item__thumb { flex-basis: 44px; width: 44px; height: 44px; }
	.xcca-box .xcca-item__name {
		white-space: normal;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		font-size: 13px;
		line-height: 1.3;
	}

	.xcca-summary { padding: 14px 12px; }
	.xcca-box .xcca-total { font-size: 22px; }
	.xcca-box .xcca-main__sale { font-size: 17px !important; }
	.xcca-box .xcca-btn { padding: 13px 12px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
	.xcca-box * { transition: none !important; animation-duration: 1.5s !important; }
}

/* ---------- Chống theme ghi đè giá (Flatsome / custom CSS) ---------- */
.xcca-box del,
.xcca-box ins {
	background: none !important;
	opacity: 1 !important;
	text-decoration: line-through;
}
.xcca-box ins { text-decoration: none; }
.xcca-box .xcca-item__price {
	font-size: 13px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: var(--xcca-price) !important;
}
.xcca-box .xcca-item__regular {
	font-size: 11px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	color: #9ca3af !important;
}
.xcca-box .xcca-main__sale {
	font-size: 20px !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	color: var(--xcca-price) !important;
}
.xcca-box .xcca-main__regular {
	font-size: 12px !important;
	font-weight: 400 !important;
	color: #9ca3af !important;
}
.xcca-box .xcca-total {
	color: var(--xcca-price) !important;
}
.xcca-box .xcca-tag,
.xcca-box select.xcca-variant {
	display: inline-block;
	width: auto !important;
	max-width: 100%;
	flex: 0 1 auto;
}

@media (max-width: 549px) {
	.xcca-box .xcca-main__sale { font-size: 17px !important; }
}
