/*
 * 施工事例バッジ（商品ページ・商品一覧）
 * 支給の badge.css が元。2026-11-12 の修正案（プロトタイプ）で配置・配色を変更。
 *
 * 区分（件数で切り替える）:
 *   mtcb--a  50件以上   「人気機種」付き（廃番の商品は「人気機種」を出さない）
 *   mtcb--b  10〜49件
 *   mtcb--c  3〜9件     件数を小さく（直近90日・交換前メーカーは出さない）
 *   mtcb--d  0〜2件     機種の件数は出さず、メーカー全体の件数（50件以上のときだけ）
 * 価格欄のバッジは全区分で同じ配色。一覧のチップは黄（区分A・Bとも）。
 */

.mtcb,
.mtcb * {
	box-sizing: border-box;
}

/* ---------- A 価格欄のバッジ ---------- */
.mtcb {
	position: relative;
	width: 70%;
	max-width: 100%;
	margin: 12px auto 0;
	padding: 12px 16px 5px;
	border: 2px solid #f0d36b;
	border-radius: 10px;
	background: #fffaf0;
	color: #2b2b2b;
	line-height: 1.5;
}
@media (max-width: 600px) {
	.mtcb {
		width: 100%;
		padding: 10px 12px 5px;
	}
}
.mtcb p {
	margin: 0;
}
.mtcb__label {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: #005a93;
	letter-spacing: .03em;
	text-align: center;
}
@media (max-width: 480px) {
	.mtcb__label {
		font-size: 17px;
	}
}
/* 区分D：メーカー全体 */
.mtcb__maker {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #666666;
}
.mtcb__pop {
	position: absolute;
	top: 8px;
	right: 8px;
	padding: 0 6px;
	border-radius: 3px;
	background: #f9be00;
	color: #3d2d00;
	font-size: 12px;
	white-space: nowrap;
}
@media (max-width: 600px) {
	.mtcb__pop {
		top: 5px;
		right: 5px;
		font-size: 10px;
	}
}
/* 件数はバッジの中央、右に直近90日（区分Cは「事例を見る」） */
.mtcb .mtcb__count {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: baseline;
	gap: 6px;
	margin: 2px 0;
}
.mtcb__fig {
	grid-column: 2;
	position: relative;
	white-space: nowrap;
}
.mtcb__num {
	font-size: 48px;
	font-weight: 800;
	line-height: 1.2;
	color: #005a93;
	font-variant-numeric: tabular-nums;
}
.mtcb--c .mtcb__num {
	font-size: 36px;
}
@media (max-width: 480px) {
	.mtcb__num {
		font-size: 40px;
	}
	.mtcb--c .mtcb__num {
		font-size: 32px;
	}
}
.mtcb__unit {
	margin-left: 2px;
	font-size: 18px;
	color: #2b2b2b;
}
.mtcb__recent,
.mtcb__count > .mtcb__link {
	grid-column: 3;
	justify-self: start;
	white-space: nowrap;
	font-size: 13px;
}
.mtcb__recent {
	color: #666666;
}
@media (max-width: 600px) {
	.mtcb__recent {
		font-size: 10px;
	}
}
.mtcb__recent b {
	color: #2b2b2b;
	font-variant-numeric: tabular-nums;
}
/* チェックは数値のすぐ左 */
.mtcb__icon {
	position: absolute;
	top: 50%;
	right: calc(100% + 10px);
	transform: translateY(-50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #f9be00;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mtcb__icon svg {
	width: 26px;
	height: 26px;
}
.mtcb__icon path {
	stroke: #005a93;
}
.mtcb--c .mtcb__icon,
.mtcb--d .mtcb__icon {
	width: 34px;
	height: 34px;
}
.mtcb--c .mtcb__icon svg,
.mtcb--d .mtcb__icon svg {
	width: 19px;
	height: 19px;
}
.mtcb__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 10px;
	font-size: 13px;
	line-height: 1.35;
	color: #666666;
}
.mtcb__link {
	color: #0078c3;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.mtcb__link::after {
	content: " \203A";
}
.mtcb__link:hover,
.mtcb__link:focus-visible {
	text-decoration: underline;
}
.mtcb .mtcb__note {
	margin-top: 6px;
	padding-top: 5px;
	border-top: 1px solid #e6dfc5;
	font-size: 10px;
	line-height: 1.4;
	color: #888888;
	text-align: center;
}
/* 相談ボタンとの間（ボタンの下の口コミとの間と同じ） */
body.woocommerce div.product .mtcb + .product-item__btn-wrap {
	margin-top: 30px;
}

/* チップの移動先を固定ヘッダーの下に出す（「事例を見る」の #sec05 はテーマの目次と共用なので JS で） */
#mtcb {
	scroll-margin-top: 100px;
}
@media screen and (max-width: 768px) {
	#mtcb {
		scroll-margin-top: 80px;
	}
}

/* ---------- B 商品名の下／D 商品一覧カードのチップ ---------- */
.mtcb-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 8px;
	border: 1px solid #bcdcf1;
	border-radius: 6px;
	background: #eef6fc;
	color: #2375a7;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
}
.mtcb-chip--a,
.mtcb-list .mtcb-chip { /* 一覧は件数によらず黄 */
	border-color: #f0d36b;
	background: #fff4cc;
	color: #936800;
}
.mtcb-chip__label {
	font-size: 12px;
}
.mtcb-chip strong {
	font-size: 24px;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}
.mtcb-chip small {
	font-size: 12px;
}

/* 表示B：2行（見出し／件数）。レビューの件数のリンク（product.css の .ttl_reviews a）の余白・色・下線・矢印を打ち消す */
@media screen and (max-width: 768px) {
	body.woocommerce div.product .ttl_reviews:has(> a.mtcb-chip) {
		flex-wrap: wrap;
	}
	/* 狭い画面ではレビューの件数が折り返すので、チップを次の行へ */
	body.woocommerce div.product .ttl_reviews:has(> a.mtcb-chip)::after {
		content: "";
		flex-basis: 100%;
		order: 1;
	}
}
body.woocommerce div.product .ttl_reviews a.mtcb-chip {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	margin-left: 12px;
	padding: 6px 10px;
	color: #005a93;
	text-decoration: none;
}
body.woocommerce div.product .ttl_reviews a.mtcb-chip strong {
	font-size: 28px;
}
@media (max-width: 480px) {
	body.woocommerce div.product .ttl_reviews a.mtcb-chip .mtcb-chip__label {
		font-size: 11px;
	}
	body.woocommerce div.product .ttl_reviews a.mtcb-chip strong {
		font-size: 26px;
	}
}
@media screen and (max-width: 768px) {
	body.woocommerce div.product .ttl_reviews a.mtcb-chip {
		order: 2;
		margin: 6px 0 0;
	}
}
body.woocommerce div.product .ttl_reviews a.mtcb-chip--a {
	color: #6b4f00;
}
body.woocommerce div.product .ttl_reviews a.mtcb-chip::after {
	content: none;
}

/* 表示D：ガス給湯器TOP・商材TOPなどの JSON の一覧。星の行の右に置き、容量・機能の行にまたがらせて行の高さは変えない */
div:has(> .mtcb-list--json) {
	position: relative;
}
div:has(> .mtcb-list--json > a),
div:has(+ div > .mtcb-list--json > a) {
	padding-right: 140px;
}
.mtcb-list--json {
	position: absolute;
	right: 0;
	bottom: 0;
	margin: 0;
	line-height: 1;
	visibility: visible; /* レビューの無い商品は星の行が invisible */
}

/* 表示D：商品カテゴリ・タグの一覧。カードの右上に⑥⑦の半分の大きさで */
ul.products:has(.mtcb-list) > li.product {
	position: relative;
	padding-top: 34px;
}
li.product .mtcb-list {
	position: absolute;
	top: 0;
	right: 0;
	margin: 0;
	line-height: 1;
	pointer-events: none; /* 縮小前の大きさの箱が画像のリンクを覆わないように */
}
li.product .mtcb-chip {
	pointer-events: auto;
	border-color: #dfbf5e;
	background: #fff0b3;
	line-height: 1.3;
	transform: scale(.5);
	transform-origin: top right;
}
li.product .mtcb-chip__label {
	font-size: 16px;
}

/* ---------- C 施工事例欄（#sec05）の集計 ---------- */
.mtcb-sum {
	margin: 0 0 16px;
	line-height: 1.7; /* 見本の行の高さ */
}
.mtcb-sum__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 14px;
	padding-bottom: 8px;
	margin-bottom: 12px;
	border-bottom: 3px solid #0078c3;
}
.mtcb-sum__total {
	font-size: 14px;
	color: #666666;
}
.mtcb-sum__total b {
	font-size: 24px;
	color: #005a93;
	font-variant-numeric: tabular-nums;
}
.mtcb-sum__cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
@media (max-width: 600px) {
	.mtcb-sum__cols {
		grid-template-columns: 1fr;
	}
}
.mtcb-sum__title {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	color: #666666;
}
.mtcb-bars {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 5px;
}
.mtcb-bars li {
	display: grid;
	grid-template-columns: 6em 1fr 2.6em; /* 6文字のメーカー名が1行に収まる幅 */
	align-items: center;
	gap: 8px;
	font-size: 12px;
}
.mtcb-bars__track {
	position: relative;
	height: 12px;
	border-radius: 2px;
	background: #f0f3f5;
}
.mtcb-bars__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	border-radius: 0 3px 3px 0;
	background: #0078c3;
}
.mtcb-bars__fill--other {
	background: #b9c6d0;
}
.mtcb-bars__val {
	text-align: right;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* 表示Cの下の一覧が同じカテゴリの事例のときの小見出し */
.mtcb-sub {
	margin: 0 0 10px;
	padding-left: 8px;
	border-left: 4px solid #0078c3;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: #2b2b2b;
}
