/* ==========================================================
   比較表コンポーネント
   ========================================================== */

/* ── スクロールラッパー（スマホ横スクロール対応） ── */
.ucs-comparison-table-wrap {
	margin-block: 2rem;
}

.ucs-comparison-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: 8px;
	border: 1px solid var(--wp--preset--color--border, #e5e7eb);
	/* スクロール可能な領域をスクリーンリーダー・キーボードで認識させる */
}

/* ── テーブル本体 ── */
.ucs-comparison-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	font-size: 0.875rem;
	/* 最小列幅を確保してスマホで潰れないように */
	min-width: 560px;
}

.ucs-comparison-table th,
.ucs-comparison-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--wp--preset--color--border, #e5e7eb);
	vertical-align: middle;
	text-align: center;
}

/* ── 行ヘッダー（左列ラベル） ── */
.ucs-comparison-table__label-col,
.ucs-comparison-table tbody th {
	text-align: left;
	background: var(--wp--preset--color--bg-light, #f9fafb);
	font-weight: 600;
	color: var(--wp--preset--color--text-muted, #6b7280);
	white-space: nowrap;
	width: 130px;
	min-width: 130px;
	position: sticky;
	left: 0;
	z-index: 1;
	border-right: 2px solid var(--wp--preset--color--border, #e5e7eb);
}

/* ── 商品列ヘッダー ── */
.ucs-comparison-table__product-col {
	min-width: 160px;
	vertical-align: top;
	padding-block: 16px;
}

.ucs-comparison-table__rank {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 700;
	background: var(--wp--preset--color--primary, #4a7c6f);
	color: #fff;
	padding: 2px 8px;
	border-radius: 20px;
	margin-bottom: 8px;
}

.ucs-comparison-table__product-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: inherit;
}

.ucs-comparison-table__product-link:hover .ucs-comparison-table__product-name {
	color: var(--wp--preset--color--primary, #4a7c6f);
	text-decoration: underline;
}

.ucs-comparison-table__product-img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	border-radius: 4px;
}

.ucs-comparison-table__product-name {
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.4;
}

.ucs-comparison-table__brand {
	font-size: 0.75rem;
	color: var(--wp--preset--color--text-muted, #6b7280);
	display: block;
}

/* ── データセル ── */
.ucs-comparison-table td {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--text-base, #374151);
}

/* ── NA ── */
.ucs-nd {
	color: var(--wp--preset--color--text-light, #9ca3af);
}

/* ── チェック / バツ ── */
.ucs-check {
	color: var(--wp--preset--color--primary, #4a7c6f);
	font-weight: 700;
}
.ucs-cross {
	color: #9ca3af;
}

/* ── CTAセル ── */
.ucs-comparison-table__cta-row td {
	padding-block: 12px;
}

.ucs-comparison-table__cta-row .ucs-btn + .ucs-btn {
	margin-top: 6px;
}

/* ── 行ホバー ── */
.ucs-comparison-table tbody tr:hover td {
	background: var(--wp--preset--color--bg-light, #f9fafb);
}

/* スクロールインジケーター（スマホ向け） */
@media (max-width: 768px) {
	.ucs-comparison-table-scroll::after {
		content: '';
		display: block;
		height: 0;
	}
}
