@charset "UTF-8";

/* ====================================
	共通スタイル
 ==================================== */

.visually-hidden {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.caption>li>span.color-red {
	color: var(--sharp-red);
	margin: 0;
}

/* 比較表 */
/* 表のスクロールコントロール */
.table-scroll-controls {
	display: flex;
	align-items: end;
	justify-content: space-between;
}

/* 凡例エリア */
.scroll-legend {
	display: flex;
	align-items: end;
}

.legend-text {
	font-size: 1.2rem;
}

/* スクロールボタン */
.scroll-buttons {
	display: none;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;
}

/* スクロールボタン */
.btn-scroll {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 10px 5px;
	cursor: pointer;
	color: var(--gray-400);
	transition: opacity 0.2s ease;
}

.btn-scroll:hover:not(:disabled) {
	opacity: 0.7;
}

.btn-scroll:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.btn-scroll svg {
	inline-size: 1.4rem;
	block-size: 2.24rem;
	display: block;
}

/* 比較表ラッパー - スクロールコンテナ */
.compare-table-wrapper {
	inline-size: 100%;
	block-size: 950px;
	overflow: auto;
	border: 1px solid var(--gray-100);
	margin-top: 1rem;
	scroll-snap-type: x mandatory;
	scroll-padding-left: 110px;
	touch-action: pan-x pan-y;
	overscroll-behavior: none;
}

/* テーブル本体 */
.compare-table {
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	inline-size: max-content;
}

.compare-table thead th {
	position: sticky;
	top: 0;
	border-bottom: 1px solid var(--gray-100);
	border-right: 1px solid var(--gray-100);
}

/* 左上の空白セル */
.compare-table thead th.table-header-empty {
	position: sticky;
	left: 0;
	top: 0;
	z-index: 1;
	inline-size: 110px;
	min-inline-size: 110px;
	max-inline-size: 110px;
	background: #f5f5f5;
	border-right: 1px solid var(--gray-100);
	scroll-snap-align: start;
}

/* 製品ヘッダーセル */
.product-header-cell {
	padding: 0;
	vertical-align: top;
	background-color: #f5f5f5;
	transition: background-color 0.15s ease;
	scroll-snap-align: start;
	overflow-wrap: break-word;
}

/* 製品カード */
.product-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	inline-size: 100%;
	padding: 3rem 0.5rem 1.6rem;
	position: relative;
}

.product-new-badge {
	position: absolute;
	top: 0;
	left: 0;
	padding: 0 0.4em;
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	background-color: var(--sharp-red);
	text-align: center;
	z-index: 1;
}

.btn-product-remove {
	display: grid;
	place-items: center;
	position: absolute;
	top: 0;
	right: 0;
	z-index: 1;
	padding: 10px;

	svg {
		inline-size: 10px;
		block-size: 10px;
	}

	&:hover {
		background-color: rgba(0, 0, 0, 0.05);
		border-radius: 50%;
	}

	&:focus-visible {
		outline: 3px solid var(--blue-500);
		outline-offset: 2px;
		border-radius: 50%;
	}
}

.product-info {
	text-align: center;
}

/* リンクエリア設定 */
.product-link a {
	display: block;
	text-align: center;
	text-decoration: none;

	img {
		transition: opacity 0.3s ease;
	}

	&:hover {
		text-decoration: underline;
		text-decoration-thickness: 2px;
		text-underline-position: from-font;
		text-underline-offset: 2px;

		img {
			opacity: 0.7;
		}
	}
}

.product-category {
	font-size: 1rem;
	font-weight: 300;
}

.product-model {
	font-size: 1.4rem;
	font-weight: 700;
}

.product-capacity {
	display: block;
	font-size: 1.2rem;
	font-weight: 400;
}

.product-image {
	display: grid;
	place-items: center;
	aspect-ratio: 1 / 1;
	inline-size: 100%;
	max-inline-size: 100px;
	margin: 0.8rem auto 0;
	transition: opacity 0.3s ease;
}

.product-year {
	display: inline-block;
	margin-top: 0.8rem;
	padding: 0 0.5em;
	font-size: 1.1rem;
	font-weight: 300;
	border: 1px solid #000;
	text-align: center;
}

/* 仕様項目行 */
.compare-table tbody tr {
	border-bottom: 1px solid var(--gray-100);
}

/* 左列固定（項目名セル） */
.spec-name-cell {
	position: sticky;
	left: 0;
	inline-size: 110px;
	min-inline-size: 110px;
	max-inline-size: 110px;
	padding: 24px 5px 10px;
	background-color: var(--gray-50);
	border-right: 1px solid var(--gray-100);
	border-bottom: 1px solid var(--gray-100);
	vertical-align: middle;
	text-align: left;
	transition: background-color 0.15s ease;
	scroll-snap-align: start;
	overflow-wrap: break-word;
}

.spec-name-text {
	display: block;
	font-size: 1.2rem;
	font-weight: 500;
	line-height: 1.4;
}

.btn-spec-info {
	display: block;
	inline-size: 18px;
	block-size: 18px;
	border-radius: 50%;
	transition: opacity 0.2s ease;

	&:hover {
		opacity: 0.7;
	}

	svg {
		display: block;
	}
}

/* 行の削除ボタン */
.btn-spec-remove {
	position: absolute;
	top: 0;
	right: 0;
	display: grid;
	place-items: center;
	padding: 10px;

	svg {
		inline-size: 10px;
		block-size: 10px;
	}

	&:hover {
		background-color: rgba(0, 0, 0, 0.05);
		border-radius: 50%;
	}

	&:focus-visible {
		outline: 3px solid var(--blue-500);
		outline-offset: 2px;
		border-radius: 50%;
	}
}

/* 仕様値セル */
.spec-value-cell {
	inline-size: 110px;
	max-inline-size: 110px;
	padding: 8px 5px;
	border-right: 1px solid var(--gray-100);
	border-bottom: 1px solid var(--gray-100);
	font-size: 1.2rem;
	text-align: center;
	transition: background-color 0.15s ease;
	scroll-snap-align: start;
	word-break: break-all;
}

/* ホバー時のハイライト - マウス操作時のみ */
@media (hover: hover) {

	/* 行がホバーされた時 */
	.compare-table .row-highlighted {
		background-color: var(--red-50);
	}

	/* 列がホバーされた時 */
	.compare-table .col-highlighted {
		background-color: var(--red-50);
	}

	/* 製品カード部分（ヘッダー）の背景色も変更 */
	.compare-table .col-highlighted .product-card {
		background-color: var(--red-50);
	}

	/* 行と列が交差するセル（交点） */
	.compare-table .row-highlighted.col-highlighted {
		background-color: var(--red-50);
	}

	.compare-table .row-highlighted.col-highlighted .product-card {
		background-color: var(--red-50);
	}
}

/* 絞り込み項目が選ばれた行（黄色） - 常に表示 */
.compare-table tr.row-filtered th,
.compare-table tr.row-filtered td {
	background-color: var(--yellow-50);
}

/* 製品列の削除アニメーション */
.compare-table thead th.product-header-cell.is-removing,
.compare-table tbody td.spec-value-cell.is-removing {
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

/* 仕様行の削除アニメーション */
.compare-table tbody tr.is-removing-row {
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

/* エアコン専用・畳数リスト */
.room-size-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.7rem 5%;
}


/* ==========================================
	ホバー、マウスポインタがサポートされている環境
=========================================== */
@media (hover:hover) and (pointer: fine) {

	/* 絞り込み行(黄色) に カーソル行(赤) が重なった時 */
	.compare-table tr.row-filtered th.row-highlighted,
	.compare-table tr.row-filtered td.row-highlighted {
		background-color: var(--orange-50);
	}

	/* 絞り込み行(黄色) に カーソル列(赤) が重なった時 */
	.compare-table tr.row-filtered th.col-highlighted,
	.compare-table tr.row-filtered td.col-highlighted {
		background-color: var(--orange-50);
	}

	/* 交差点 */
	.compare-table tr.row-filtered th.row-highlighted.col-highlighted,
	.compare-table tr.row-filtered td.row-highlighted.col-highlighted {
		background-color: var(--orange-50);
	}
}

/* ====================================
	768px未満専用スタイル
===================================== */
@media screen and (width < 768px) {

	.legend-text {
		margin-top: 5rem;
	}

	.btn-spec-info {
		margin-top: 0.4rem;
	}
}

/* ====================================
	768px以上専用スタイル
===================================== */
@media screen and (width >=768px) {

	/* global.css上書き */
	:is(.caption.disc, .caption.ast, .caption.dia, .caption.kome, .caption.hoshi, .caption.normal)>li {
		text-indent: -2em;
	}

	/* スクロールボタン表示 */
	.scroll-buttons {
		display: flex;
	}

	/* 比較表 */
	.compare-table-wrapper {
		scroll-padding-left: 260px;
	}

	.compare-table thead th.table-header-empty {
		inline-size: 260px;
		min-inline-size: 260px;
		max-inline-size: 260px;
	}

	/* 製品カード */
	.product-card {
		padding: 3rem 0.5rem 3rem;
	}

	.product-new-badge {
		font-size: 1.2rem;
	}

	.product-category {
		font-size: 1.2rem;
	}

	.product-model {
		font-size: 2rem;
	}

	.product-capacity {
		font-size: 1.4rem;
	}

	.product-year {
		font-size: 1.2rem;
	}

	.product-image {
		max-inline-size: 130px;
		margin: 1.6rem auto 0;
	}

	.spec-name-cell {
		inline-size: 260px;
		min-inline-size: 260px;
		max-inline-size: 260px;
		padding: 1.4rem 44px 1.4rem 1rem;
	}

	.spec-name-text {
		display: inline-block;
		font-size: 1.4rem;
	}

	.btn-spec-info {
		display: inline-block;
		inline-size: 20px;
		block-size: 20px;
		margin-left: 10px;
		vertical-align: middle;
	}

	/* 仕様行の削除ボタン */
	.btn-spec-remove {
		top: 50%;
		transform: translateY(-50%);
		right: 5px;
	}

	.spec-value-cell {
		inline-size: 210px;
		max-inline-size: 210px;
		padding: 14px 10px;
		font-size: 1.4rem;
	}

	/* エアコン専用・畳数リスト */
	.room-size-list {
		grid-template-columns: repeat(3, 1fr);
		gap: 0.8rem 3%;
	}
}