/**
 * 多商品关联 —— 后台 metabox 样式
 */
.yxs-woo-multi { position: relative; }

.yxs-woo-multi__search { position: relative; display: flex; gap: 6px; margin-bottom: 8px; }
.yxs-woo-multi__search input { flex: 1; min-width: 0; }

.yxs-woo-multi__suggest {
	position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
	background: #fff; border: 1px solid #c3c4c7; border-top: none; box-shadow: none;
	max-height: 240px; overflow-y: auto;
}
.yxs-woo-multi__opt {
	display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer;
	border: 0; border-bottom: 1px solid #f0f0f1; background: transparent; font-size: 13px;
}
.yxs-woo-multi__opt:last-child { border-bottom: none; }
.yxs-woo-multi__opt:hover { background: #f6f7f7; }
.yxs-woo-multi__opt.is-checked { background: #f0f6fc; }
.yxs-woo-multi__opt .yxs-woo-multi__cb {
	width: 14px; height: 14px; min-width: 14px; flex: 0 0 14px;
	margin: 0; cursor: pointer;
}
.yxs-woo-multi__opt .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yxs-woo-multi__opt .i { color: #646970; font-family: monospace; font-size: 12px; }
.yxs-woo-multi__opt .s { color: #a7aaad; font-size: 12px; }

.yxs-woo-multi__list { display: flex; flex-direction: column; gap: 4px; }

.yxs-woo-item {
	display: flex; align-items: center; gap: 8px; padding: 8px 10px;
	background: #fafafa; border: 1px solid #e2e4e7; border-radius: 4px;
	font-size: 13px;
}
.yxs-woo-item.is-dragging { opacity: .4; }
.yxs-woo-item__sort {
	color: #a7aaad; cursor: grab; font-size: 14px; line-height: 1; padding: 0 2px; user-select: none;
}
.yxs-woo-item__sort:active { cursor: grabbing; }
.yxs-woo-item__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yxs-woo-item__title code { background: #f0f0f1; padding: 1px 5px; border-radius: 3px; font-size: 11px; color: #646970; }
.yxs-woo-item__status { color: #a7aaad; font-size: 12px; }
.yxs-woo-item__edit { font-size: 12px; text-decoration: none; }
.yxs-woo-item__edit:hover { text-decoration: underline; }
.yxs-woo-item__remove { margin-left: auto; color: #b32d2e; font-size: 16px; line-height: 1; padding: 0 4px; }
.yxs-woo-item__remove:hover { color: #8a1d1e; }

.yxs-woo-multi__empty { margin: 0; color: #a7aaad; }

/* ============ 前台商品卡片列表 ============ */
.yxs-purchase-cards {
	display: flex; flex-wrap: wrap; gap: 16px;
	margin-top: 16px; margin-bottom: 8px;
	justify-content: flex-start;
}
.yxs-purchase-card {
	display: block; text-decoration: none; color: inherit;
	flex: 0 0 calc(25% - 12px); /* 一行 4 个：(100% - 3*16px gap) / 4 */
	min-width: 200px;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
	padding: 16px; text-align: center; transition: box-shadow .2s, border-color .2s;
	cursor: pointer;
}
.yxs-purchase-card:hover { border-color: #000; box-shadow: none; transform: translateY(-1px); }
.yxs-purchase-card.is-disabled { pointer-events: none; opacity: .6; }
.yxs-purchase-card.is-disabled .yxs-purchase-card__cta { background: #9ca3af; border-color: #9ca3af; }
.yxs-purchase-card__image {
	width: 100%; aspect-ratio: 1; margin: 0 auto 12px;
	overflow: hidden; border-radius: 6px; background: #f9fafb;
	display: flex; align-items: center; justify-content: center;
}
.yxs-purchase-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yxs-purchase-card__name { font-weight: 600; margin-bottom: 6px; font-size: 13px; line-height: 1.3; }
.yxs-purchase-card__price { margin-bottom: 12px; font-size: 16px; font-weight: 700; color: #000; }
.yxs-purchase-card__price .woocommerce-Price-amount { font-weight: 700; color: #000; }
.yxs-purchase-card__cta {
	display: inline-block; padding: 8px 22px; background: #000; color: #fff;
	border-radius: 4px; font-size: 13px;
	border: 1px solid #000;
}
.yxs-purchase-card:hover .yxs-purchase-card__cta { background: #333; border-color: #333; }

@media (max-width: 900px) {
	.yxs-purchase-card { flex: 0 0 calc(33.333% - 11px); min-width: 160px; }
}
@media (max-width: 600px) {
	.yxs-purchase-card { flex: 0 0 calc(50% - 8px); min-width: 140px; padding: 12px; }
}
