/**
 * AffiBlocks フロント表示スタイル（FR-BLOCK / NFR-COMPAT-01）。
 * テーマ側の影響を受けにくいよう affib- プレフィックスで完結させ、
 * 色・角丸はCSS変数（設定画面で上書き）で制御する。
 */

:root {
	--affib-btn-rakuten: #bf0000;
	--affib-btn-amazon: #e68a00;
	--affib-btn-yahoo: #ff0033;
	--affib-btn-moshimo: #2e8b57;
	--affib-btn-rakuten-travel: #0f6bb2;
	--affib-radius: 6px;
	--affib-header-bg: #1c2b4a;
	--affib-header-text: #ffffff;
	--affib-border: #e2e4e9;
	--affib-stripe: #f7f8fa;
}

/* ---- 共通パーツ ---- */

.affib-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 6px 0;
	align-items: flex-end;
}

/* すべてのボタンを等幅にして、「ひとこと」の有無でサイズが変わらないようにする。
   幅が広くなりすぎないよう上限を設ける。 */
.affib-buttons > .affib-btn,
.affib-buttons > .affib-btn-wrap {
	flex: 1 1 110px;
	max-width: 220px;
	min-width: 0;
}

.affib-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 12px;
	border-radius: var(--affib-radius);
	color: #fff !important;
	font-weight: 700;
	font-size: 0.85em;
	line-height: 1.3;
	white-space: nowrap;
	text-decoration: none !important;
	transition: opacity 0.15s ease;
	box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
	/* width:100% で使われる場面（.affib-btn-wrap内など）で
	   paddingぶんはみ出さないようにする（NFR-COMPAT-01） */
	box-sizing: border-box;
	max-width: 100%;
}

/* ボタン末尾の矢印は非表示（不要のため） */
.affib-btn-arrow {
	display: none;
}

.affib-btn:hover {
	opacity: 0.85;
	color: #fff;
}

.affib-btn--rakuten { --affib-btn-c: var(--affib-btn-rakuten); background-color: var(--affib-btn-c); }
.affib-btn--amazon { --affib-btn-c: var(--affib-btn-amazon); background-color: var(--affib-btn-c); }
.affib-btn--yahoo { --affib-btn-c: var(--affib-btn-yahoo); background-color: var(--affib-btn-c); }
.affib-btn--moshimo { --affib-btn-c: var(--affib-btn-moshimo); background-color: var(--affib-btn-c); }
.affib-btn--rakuten-travel { --affib-btn-c: var(--affib-btn-rakuten-travel); background-color: var(--affib-btn-c); }

.affib-btn--custom { --affib-btn-c: var(--affib-header-bg, #1c2b4a); background-color: var(--affib-btn-c); }
.affib-btn--travel-jalan { --affib-btn-c: #f26a21; background-color: var(--affib-btn-c); }
.affib-btn--travel-ikkyu { --affib-btn-c: #123a5e; background-color: var(--affib-btn-c); }
.affib-btn--travel-agoda { --affib-btn-c: #6d3fc0; background-color: var(--affib-btn-c); }

/* アウトライン（枠線）スタイル */
.affib-btn--outline {
	background: transparent !important;
	color: var(--affib-btn-c) !important;
	border: 2px solid var(--affib-btn-c);
	box-shadow: none;
}

/* 価格非表示設定：ボタン位置がズレないよう高さだけ確保 */
.affib-price--placeholder {
	visibility: hidden;
	display: block;
	min-height: 1.4em;
}

.affib-price {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
}

.affib-price-value {
	font-size: 1.25em;
	font-weight: 700;
	color: #c9302c;
}

.affib-price-note,
.affib-review-note,
.affib-review-count {
	font-size: 0.75em;
	color: #6b7280;
}

.affib-review-star {
	color: #f5a623;
}

.affib-review--none {
	color: #9ca3af;
}

/* ★5つの視覚的な星（部分塗り）。全ブロック共通のレビュー表示 */
.affib-review {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
}

.affib-stars {
	position: relative;
	display: inline-block;
	line-height: 1;
	font-size: 1.05em;
	letter-spacing: 1px;
}

.affib-stars-base {
	color: #d8dbe0;
}

.affib-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: #f5a623;
	pointer-events: none;
}

.affib-review-value {
	font-weight: 700;
}

.affib-review-link {
	font-size: 0.78em;
	color: #2271b1;
	text-decoration: underline;
	white-space: nowrap;
}

.affib-review-link:hover {
	color: #135e96;
}

/* セール文言リボン（ボタン群の上に表示） */
.affib-sale-ribbon {
	text-align: center;
	color: #d81b3f;
	font-weight: 700;
	font-size: 0.88em;
	margin: 6px 0 2px;
}

/* 商品ごとのマイクロコピー（ボタン上のひとこと） */
.affib-microcopy {
	text-align: center;
	color: #e07800;
	font-weight: 700;
	font-size: 0.85em;
	margin: 4px 0 2px;
}

/* ボタン別ひとこと：対象ボタンの真上に固定（ボタン本体の幅・サイズは変えない） */
.affib-btn-wrap {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 3px;
}

.affib-btn-wrap > .affib-btn {
	width: 100%;
}

.affib-btn-copy {
	text-align: center;
	color: #e07800;
	font-weight: 700;
	font-size: 0.72em;
	line-height: 1.3;
	white-space: normal;
}

/* サイト紹介の単独CTAは等幅にせず中央・内容幅のまま */
.affib-siteintro .affib-buttons > .affib-btn {
	flex: 0 1 auto;
}

/* セール文言マーキー（右から左へ流す） */
.affib-sale-ribbon--marquee {
	overflow: hidden;
	white-space: nowrap;
}

.affib-sale-ribbon--marquee .affib-sale-ribbon-inner {
	display: inline-block;
	padding-left: 100%;
	animation: affib-marquee 10s linear infinite;
}

@keyframes affib-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-100%); }
}

.affib-buttons--center {
	justify-content: center;
}

/* イチオシバッジ（金メダル風・王冠つき） */
.affib-pick-badge {
	display: inline-block;
	position: relative;
	padding: 5px 16px 5px 30px;
	background: linear-gradient(160deg, #ffe9a8 0%, #f5b912 35%, #d99400 75%, #f5c542 100%);
	color: #7a4a00;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
	font-weight: 800;
	font-size: 0.8em;
	letter-spacing: 0.04em;
	line-height: 1.4;
	white-space: nowrap;
	border: 2px solid #fff;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(160, 105, 0, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.affib-pick-badge::before {
	content: '\1F451'; /* 王冠 */
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-52%);
	font-size: 1.05em;
	text-shadow: none;
}

.affib-pick-badge--corner {
	position: absolute;
	top: -14px;
	right: -8px;
	z-index: 2;
	transform: rotate(4deg);
	font-size: 0.85em;
}

.affib-card {
	position: relative;
}

/* 比較テーブル・リストのイチオシ強調 */
.affib-compare tbody tr.affib-row--pick td,
.affib-compare--striped tbody tr.affib-row--pick td {
	background: #fff8e6;
}

.affib-compare tbody tr.affib-row--pick td:first-child {
	border-left: 3px solid #f5a623;
}

.affib-list-item--pick {
	border-color: #f5a623;
	border-width: 2px;
	background: #fffdf5;
}

.affib-hotelcard--pick {
	border-color: #f5a623;
	border-width: 2px;
	background: #fffdf5;
}

/* 口コミ引用（単品カード下） */
.affib-quotes {
	margin-top: 12px;
}

.affib-quotes-title {
	font-size: 0.82em;
	font-weight: 700;
	color: #6b7280;
	margin-bottom: 6px;
}

.affib-quote {
	position: relative;
	margin-bottom: 8px;
	padding: 10px 14px 10px 30px;
	background: var(--affib-stripe);
	border-radius: 10px;
	font-size: 0.88em;
	line-height: 1.6;
}

.affib-quote::before {
	content: '\201C';
	position: absolute;
	left: 10px;
	top: 4px;
	font-size: 1.6em;
	color: #f5a623;
	font-weight: 700;
}

.affib-features {
	margin: 0;
	padding-left: 1.2em;
	list-style: disc;
	font-size: 0.9em;
	text-align: left;
}

.affib-features li {
	margin: 0 0 2px;
}

.affib-credit {
	margin-top: 8px;
	font-size: 0.72em;
	color: #6b7280;
	text-align: right;
}

.affib-credit a {
	color: inherit;
}

.affib-image {
	max-width: 100%;
	height: auto;
	border-radius: calc(var(--affib-radius) / 2);
}

.affib-noimage {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100px;
	height: 100px;
	background: #f0f0f1;
	color: #9ca3af;
	font-size: 0.8em;
	border-radius: calc(var(--affib-radius) / 2);
}

/* ---- 単品カード ---- */

.affib-card {
	max-width: var(--affib-card-max, 640px);
	margin: 1.5em auto;
	padding: 16px;
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	background: #fff;
	box-sizing: border-box;
}

.affib-card-sale-banner {
	margin: -16px -16px 12px;
	padding: 8px 16px;
	background: linear-gradient(90deg, #d81b3f, #f0506e);
	color: #fff;
	font-weight: 700;
	text-align: center;
	border-radius: var(--affib-radius) var(--affib-radius) 0 0;
}

.affib-card--sale {
	border-color: #d81b3f;
	border-width: 2px;
}

.affib-card-image {
	text-align: center;
	margin-bottom: 12px;
}

.affib-card-image .affib-image {
	width: auto;
	max-width: min(100%, var(--affib-card-img, 320px));
	height: auto;
}

.affib-card-title {
	font-weight: 700;
	font-size: 1.05em;
	margin-bottom: 12px;
	line-height: 1.5;
}

.affib-card-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
}

.affib-card-table th,
.affib-card-table td {
	padding: 8px 10px;
	border: 1px solid var(--affib-border);
	vertical-align: top;
	text-align: left;
}

.affib-card-table th {
	width: 32%;
	background: var(--affib-stripe);
	font-weight: 600;
	white-space: nowrap;
}

/* ---- 比較テーブル ---- */

.affib-compare-wrap {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	margin: 1.5em 0;
}

.affib-compare {
	display: table;
	width: max-content;
	min-width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

/* 列を潰さず内容ぶんの幅を確保 → はみ出したぶんは横スクロール（スワイプ）で見る */
.affib-compare th,
.affib-compare td {
	white-space: nowrap;
}

.affib-compare thead th {
	background: var(--affib-header-bg);
	color: var(--affib-header-text);
	padding: 10px 12px;
	text-align: center;
	white-space: nowrap;
	border: 1px solid var(--affib-header-bg);
}

.affib-compare tbody td {
	padding: 10px 12px;
	border: 1px solid var(--affib-border);
	text-align: center;
	vertical-align: middle;
	background: #fff;
}

.affib-compare--striped tbody tr:nth-child(even) td {
	background: var(--affib-stripe);
}

/* 商品名は3行までで省略し、行の高さバランスが崩れないようにする */
.affib-compare-title {
	font-weight: 600;
	text-align: left;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.5;
	max-height: 4.5em;
}

/* 商品名・特徴は折り返す（td の nowrap より詳細度を高くして確実に上書き）。
   max-width で横に広がりすぎないようにする。 */
.affib-compare td.affib-compare-cell--features {
	text-align: left;
	white-space: normal;
	min-width: 160px;
	max-width: 280px;
}

.affib-compare td.affib-compare-cell--title {
	white-space: normal;
	min-width: 150px;
	max-width: 260px;
}

/* 価格・レビュー・画像列は内容ぶんに詰めてバランスを取る */
.affib-compare th,
.affib-compare td.affib-compare-cell--price,
.affib-compare td.affib-compare-cell--review,
.affib-compare td.affib-compare-cell--image {
	width: 1%;
}

.affib-compare-cell--price {
	white-space: nowrap;
}

.affib-compare-title {
	word-break: break-word;
}

/* 比較テーブルの画像は見やすいサイズ・自然な比率で表示 */
.affib-compare td.affib-compare-cell--image {
	white-space: normal;
}

.affib-compare-cell--image img.affib-image {
	width: 110px;
	height: auto;
	border-radius: 6px;
}

.affib-compare-cell--buttons .affib-btn {
	padding: 8px 12px;
	font-size: 0.85em;
	white-space: nowrap;
}

/* 先頭列スティッキー（FR-BLOCK-02） */
.affib-compare-wrap--sticky .affib-compare th:first-child,
.affib-compare-wrap--sticky .affib-compare td:first-child {
	position: sticky;
	left: 0;
	z-index: 1;
}

.affib-compare-wrap--sticky .affib-compare tbody td:first-child {
	background: #fff;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

/* ---- リスト ---- */

.affib-list {
	margin: 1.5em 0;
	counter-reset: affib-rank;
}

.affib-list-item {
	position: relative;
	display: flex;
	gap: 16px;
	padding: 16px;
	margin-bottom: 12px;
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	background: #fff;
}

.affib-list-rank {
	position: absolute;
	top: -10px;
	left: -10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--affib-header-bg);
	color: var(--affib-header-text);
	font-weight: 700;
}

.affib-list-image {
	flex: 0 0 var(--affib-list-img, 140px);
	align-self: flex-start;
}

.affib-list-image .affib-image {
	width: 100%;
	height: auto;
}

.affib-list-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.affib-list-title {
	font-weight: 700;
	line-height: 1.5;
}

/* ---- ホテル比較（カード型・レスポンシブ） ---- */

.affib-hotelcards {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 1.5em 0;
}

.affib-hotelcard {
	position: relative;
	flex: 1 1 0;
	min-width: 260px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px;
	border: 1px solid var(--affib-border);
	border-radius: calc(var(--affib-radius) + 4px);
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}

.affib-hotelcard:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* タイトル：見出しタグを使わずテーマ装飾を排除。2行ぶんの高さに固定して
   カード間で画像の開始位置（＝以降の行）を揃える。 */
.affib-hotelcard-title {
	margin: 0;
	min-height: 3em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--affib-header-bg);
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.5;
}

.affib-hotelcard-images {
	display: flex;
	gap: 8px;
}

.affib-hotelcard-images figure {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
}

.affib-hotelcard-images img {
	width: 100%;
	height: 110px;
	aspect-ratio: auto;
	object-fit: cover;
	border-radius: calc(var(--affib-radius) / 2);
	display: block;
}

.affib-noimage--fill {
	width: 100%;
	height: 110px;
	border-radius: calc(var(--affib-radius) / 2);
}

.affib-hotelcard-imgcap {
	margin-top: 2px;
	font-size: 0.72em;
	color: #6b7280;
	text-align: center;
}

.affib-hotelcard-rating {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 1.05em;
}

.affib-hotelcard-reviewcount {
	font-size: 0.78em;
	color: #6b7280;
}

/* 施設紹介文：高さを揃えつつ、切れずに中でスクロールして全文読める */
.affib-hotelcard-special {
	margin: 0;
	padding: 10px 12px;
	background: var(--affib-stripe);
	border-radius: calc(var(--affib-radius) / 2);
	font-size: 0.85em;
	line-height: 1.6;
	height: 7.6em;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.affib-hotelcard-scores {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 14px;
}

.affib-hotelcard-scores li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 4px 0;
	border-bottom: 1px dashed var(--affib-border);
	font-size: 0.88em;
}

.affib-hotelcard-score-label {
	color: #6b7280;
}

.affib-hotelcard-score-value {
	font-weight: 700;
}

.affib-hotelcard-facts {
	margin: 0;
}

.affib-hotelcard-facts dt {
	margin-top: 6px;
	font-size: 0.76em;
	font-weight: 600;
	color: #6b7280;
}

.affib-hotelcard-facts dd {
	margin: 2px 0 0;
	font-size: 0.9em;
	line-height: 1.5;
}

/* Googleマップ埋め込み（クリックで読み込み） */
.affib-hotelcard-map iframe {
	width: 100%;
	height: 180px;
	border: 0;
	border-radius: calc(var(--affib-radius) / 2);
	display: block;
}

.affib-map-load {
	width: 100%;
	padding: 10px;
	background: var(--affib-stripe);
	border: 1px dashed var(--affib-border);
	border-radius: calc(var(--affib-radius) / 2);
	color: #2271b1;
	font-size: 0.85em;
	font-weight: 600;
	cursor: pointer;
}

.affib-map-load:hover {
	background: #eef2f7;
}

.affib-map-close {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 6px;
	background: #f0f2f5;
	border: 1px solid var(--affib-border);
	border-radius: calc(var(--affib-radius) / 2);
	color: #50575e;
	font-size: 0.8em;
	cursor: pointer;
}

.affib-map-close:hover {
	background: #e5e8ee;
}

/* 地図〜予約ボタンをカード下端にまとめて固定（カード間で位置が揃う） */
.affib-hotelcard .affib-hotelcard-map {
	margin-top: auto;
}

.affib-hotelcard .affib-buttons {
	margin-top: 0;
	padding-top: 4px;
	justify-content: center;
}

/* 地図非表示設定のときはボタンを下端に固定 */
.affib-hotelcard:not(:has(.affib-hotelcard-map)) .affib-buttons {
	margin-top: auto;
}

/* ---- ランキング比較 ---- */

.affib-ranking {
	margin: 1.5em 0;
}

.affib-ranking-item {
	margin-bottom: 20px;
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.affib-ranking-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	color: #fff;
	font-weight: 700;
	background: var(--affib-header-bg);
}

.affib-ranking-no {
	flex: 0 0 auto;
	padding: 2px 10px;
	background: rgba(255, 255, 255, 0.22);
	border-radius: 999px;
	font-size: 0.9em;
	white-space: nowrap;
}

.affib-ranking-title {
	line-height: 1.5;
}

.affib-ranking-item--1 .affib-ranking-head {
	background: linear-gradient(135deg, #d99400, #f5b912);
	color: #5b3a00;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.affib-ranking-item--1 .affib-ranking-no::before {
	content: '\1F451 ';
}

.affib-ranking-item--1 {
	border: 2px solid #f5b912;
}

.affib-ranking-item--2 .affib-ranking-head {
	background: linear-gradient(135deg, #8e9aa6, #c0c8d0);
	color: #333;
}

.affib-ranking-item--3 .affib-ranking-head {
	background: linear-gradient(135deg, #a05f2c, #c98a52);
}

.affib-ranking-body {
	display: flex;
	gap: 16px;
	padding: 16px;
}

.affib-ranking-image {
	flex: 0 0 160px;
	text-align: center;
}

.affib-ranking-image .affib-image {
	max-width: 100%;
	height: auto;
}

.affib-ranking-info {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

/* ---- サイト紹介 ---- */

.affib-siteintro {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 680px;
	margin: 1.5em auto;
	padding: 16px;
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 画像を上に大きく表示 */
.affib-siteintro-image {
	display: block;
	width: 100%;
}

.affib-siteintro-image img {
	width: 100%;
	height: auto;
	max-height: 340px;
	object-fit: cover;
	border-radius: calc(var(--affib-radius) / 2);
	display: block;
}

.affib-siteintro-cta {
	margin-bottom: 0;
}

.affib-siteintro-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.affib-siteintro-title {
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.5;
}

.affib-siteintro-desc {
	margin: 0;
	font-size: 0.9em;
	line-height: 1.7;
	color: #444;
}

.affib-siteintro .affib-buttons {
	margin-top: auto;
}

/* ---- 価格推移 ---- */

.affib-trend-row {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.affib-sparkline {
	color: #2271b1;
	vertical-align: middle;
}

.affib-trend {
	font-weight: 700;
	font-size: 0.82em;
	padding: 2px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

.affib-trend--down {
	color: #00753b;
	background: #eafaf1;
}

.affib-trend--up {
	color: #b32d2e;
	background: #fdeeee;
}

/* ---- インラインボタン ---- */

.affib-minibtn-wrap {
	margin: 0.8em 0;
}

.affib-minibtn {
	padding: 8px 22px;
	border-radius: 999px;
	font-size: 0.88em;
}

/* ---- この記事の商品まとめ ---- */

.affib-postitems {
	margin: 1.5em 0;
	padding: 14px 16px;
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	background: #fff;
}

.affib-postitems-heading {
	font-weight: 700;
	padding-bottom: 8px;
	margin-bottom: 8px;
	border-bottom: 2px solid var(--affib-header-bg);
}

.affib-postitems-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px dashed var(--affib-border);
}

.affib-postitems-row:last-of-type {
	border-bottom: none;
}

.affib-postitems-thumb {
	flex: 0 0 60px;
}

.affib-postitems-thumb .affib-image {
	width: 60px;
	height: 60px;
	object-fit: contain;
}

.affib-postitems-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.affib-postitems-title {
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.4;
}

.affib-postitems-btn {
	flex: 0 0 auto;
	padding: 7px 14px;
	font-size: 0.82em;
	white-space: nowrap;
}

/* ---- 追従CTAバー ---- */

.affib-ctabar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	display: flex;
	align-items: center;
	padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
	box-sizing: border-box;
	/* スクロールギミック（下スクロールで隠す・上スクロールで再表示）用のトランジション。 */
	transition: transform 0.3s ease;
}

/* デザイン：バー（白背景の帯・従来の見た目） */
.affib-ctabar--bar {
	background: #fff;
	border-top: 1px solid var(--affib-border);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* デザイン：オーバーレイ（半透明の黒帯） */
.affib-ctabar--overlay {
	background: rgba(0, 0, 0, 0.75);
}

.affib-ctabar--overlay .affib-ctabar-message,
.affib-ctabar--overlay .affib-ctabar-title {
	color: #fff;
}

/* デザイン：フローティング（背景なし・ピル型ボタンだけが浮く） */
.affib-ctabar--floating {
	background: transparent;
	/* バー自体は透明で操作を邪魔しない。ボタン・閉じるボタンだけクリック可能にする。 */
	pointer-events: none;
}

.affib-ctabar--floating .affib-ctabar-row,
.affib-ctabar--floating .affib-ctabar-close {
	pointer-events: auto;
}

.affib-ctabar--floating .affib-btn,
.affib-ctabar--floating .affib-ctabar-btn {
	padding: 14px 22px;
	font-size: 0.95em;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ピル型ボタン */
.affib-ctabar--rounded .affib-btn,
.affib-ctabar--rounded .affib-ctabar-btn {
	border-radius: 999px;
}

/* スクロールギミック：下スクロールで下に隠す（front.jsがクラス付与） */
.affib-ctabar--scroll-hidden {
	transform: translateY(130%);
}

/* エディタ内プレビュー（ServerSideRender）では固定表示にしない。スクロールギミックも対象外。 */
.affib-ctabar--preview {
	position: relative;
	box-shadow: none;
	left: auto;
	right: auto;
	bottom: auto;
}

.affib-ctabar--preview.affib-ctabar--scroll-hidden {
	transform: none;
}

.affib-ctabar-inner {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 720px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.affib-ctabar-message {
	text-align: center;
	color: #e07800;
	font-weight: 700;
	font-size: 0.78em;
}

.affib-ctabar-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.affib-ctabar-thumb {
	flex: 0 0 40px;
}

.affib-ctabar-thumb .affib-image,
.affib-ctabar-thumb .affib-noimage {
	width: 40px;
	height: 40px;
	object-fit: contain;
}

.affib-ctabar-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.82em;
	font-weight: 600;
}

.affib-ctabar-row .affib-buttons {
	flex: 1 1 auto;
	margin: 0;
	gap: 6px;
}

.affib-ctabar-row .affib-buttons > .affib-btn,
.affib-ctabar-row .affib-buttons > .affib-btn-wrap {
	flex: 1 1 90px;
}

.affib-ctabar-row .affib-btn,
.affib-ctabar-btn {
	padding: 7px 14px;
	font-size: 0.82em;
}

.affib-ctabar-close {
	position: absolute;
	top: -10px;
	right: 8px;
	width: 22px;
	height: 22px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--affib-border);
	background: #fff;
	color: #50575e;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.affib-ctabar-close:hover {
	background: #f0f2f5;
}

/* スマホ幅（600px以下）のみ表示 */
@media (min-width: 601px) {
	.affib-ctabar--mobile-only {
		display: none;
	}
}

/* フローティングデザイン：狭い画面ではボタンを折り返して中央寄せにする */
@media (max-width: 600px) {
	.affib-ctabar--floating .affib-ctabar-row {
		flex-wrap: wrap;
		justify-content: center;
	}
}

/* ---- FAQ（よくある質問） ---- */

.affib-faq {
	margin: 1.5em 0;
}

.affib-faq-item {
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	margin-bottom: 10px;
	background: #fff;
	overflow: hidden;
}

.affib-faq-item summary {
	position: relative;
	padding: 12px 40px 12px 16px;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	list-style: none;
}

.affib-faq-item summary::-webkit-details-marker {
	display: none;
}

.affib-faq-item summary::after {
	content: '▶';
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.8em;
	color: #6b7280;
	transition: transform 0.15s ease;
}

.affib-faq-item[open] summary::after {
	transform: translateY(-50%) rotate(90deg);
}

.affib-faq-item summary:hover {
	background: var(--affib-stripe);
}

.affib-faq-a {
	margin: 0 16px 14px 20px;
	padding-left: 12px;
	border-left: 3px solid var(--affib-header-bg);
	font-size: 0.92em;
	line-height: 1.7;
}

/* ---- メリット・デメリット ---- */

.affib-proscons {
	margin: 1.5em 0;
}

.affib-proscons-title {
	font-weight: 700;
	font-size: 1.05em;
	margin-bottom: 10px;
}

.affib-proscons-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.affib-proscons-col {
	border: 1px solid var(--affib-border);
	border-radius: var(--affib-radius);
	overflow: hidden;
	background: #fff;
}

.affib-proscons-head {
	padding: 10px 14px;
	font-weight: 700;
	text-align: center;
}

.affib-proscons-col--pros .affib-proscons-head {
	color: var(--affib-pros-c, #2e8b57);
}

.affib-proscons-col--cons .affib-proscons-head {
	color: var(--affib-cons-c, #d81b3f);
}

.affib-proscons-list {
	margin: 0;
	padding: 12px 16px;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 0.92em;
	line-height: 1.6;
}

.affib-proscons-list li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.affib-proscons-icon {
	flex: 0 0 auto;
	font-weight: 700;
}

.affib-proscons-col--pros .affib-proscons-icon {
	color: var(--affib-pros-c, #2e8b57);
}

.affib-proscons-col--cons .affib-proscons-icon {
	color: var(--affib-cons-c, #d81b3f);
}

/* デザインバリエーション：card＝ヘッダ帯に淡色背景（デフォルト） */
.affib-proscons--card .affib-proscons-col--pros .affib-proscons-head {
	background-color: #e8f7ee; /* color-mix非対応ブラウザ向けフォールバック */
	background-color: color-mix( in srgb, var(--affib-pros-c, #2e8b57) 12%, #fff );
}

.affib-proscons--card .affib-proscons-col--cons .affib-proscons-head {
	background-color: #fdecec;
	background-color: color-mix( in srgb, var(--affib-cons-c, #d81b3f) 12%, #fff );
}

/* デザインバリエーション：fill＝列全体を淡色背景で塗る */
.affib-proscons--fill .affib-proscons-col--pros {
	background-color: #e8f7ee;
	background-color: color-mix( in srgb, var(--affib-pros-c, #2e8b57) 8%, #fff );
}

.affib-proscons--fill .affib-proscons-col--cons {
	background-color: #fdecec;
	background-color: color-mix( in srgb, var(--affib-cons-c, #d81b3f) 8%, #fff );
}

/* デザインバリエーション：simple＝枠なし・アイコンとラベル色のみ */
.affib-proscons--simple .affib-proscons-col {
	border: none;
	background: transparent;
}

.affib-proscons--simple .affib-proscons-head {
	text-align: left;
}

/* ---- レスポンシブ（FR-BLOCK-05） ---- */

/* タブレット幅：比較テーブルは横スクロール前提なのでスワイプしやすくしておく */
@media (max-width: 782px) {
	.affib-compare-wrap {
		-webkit-overflow-scrolling: touch;
	}
}

@media (max-width: 600px) {
	/* ---- 共通：画像は必ずコンテナ内に収める ---- */
	.affib-image,
	.affib-noimage,
	.affib-siteintro-image img,
	.affib-hotelcard-images img {
		max-width: 100%;
		height: auto;
	}

	/* ---- 共通：ボタン群。1列で全幅にし、はみ出し・切れを防ぐ ---- */
	.affib-buttons {
		gap: 6px;
	}

	.affib-buttons > .affib-btn,
	.affib-buttons > .affib-btn-wrap {
		flex-basis: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.affib-btn,
	.affib-btn-wrap {
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}

	/* ボタン文言が長い場合は折り返して幅からはみ出させない */
	.affib-btn {
		white-space: normal;
		word-break: break-word;
	}

	/* ---- 単品カード ---- */
	.affib-card {
		padding: 12px;
	}

	.affib-card-sale-banner {
		margin: -12px -12px 12px;
	}

	/* auto layoutのままだと購入ボタン列（td）の内容幅に引っ張られ、
	   見出し列（th）が極端に狭くなって1文字ずつ縦書き状態になる。
	   table-layoutをfixedにして見出し列の幅を固定し、それを防ぐ。 */
	.affib-card-table {
		table-layout: fixed;
	}

	.affib-card-table th {
		width: 34%;
		min-width: 5em;
		padding: 8px 6px;
		white-space: normal;
		word-break: break-word;
	}

	.affib-card-table td {
		padding: 8px 6px;
		word-break: break-word;
	}

	/* ---- 比較テーブル ----
	   列数が多いテーブル自体は崩さず横スクロールで見せる方針のまま。
	   購入ボタン列だけは縦積み・全幅にして、スクロール幅を無駄に広げず見やすくする。 */
	.affib-compare-cell--buttons .affib-buttons {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}

	.affib-compare-cell--buttons .affib-btn {
		width: 100%;
		white-space: normal;
	}

	/* ---- リスト ---- */
	.affib-list-item {
		flex-direction: column;
	}

	.affib-list-image {
		flex-basis: auto;
		text-align: center;
	}

	/* ---- ホテル比較カードはスマホで縦積み（1列）に ---- */
	.affib-hotelcard {
		flex-basis: 100%;
		padding: 14px;
	}

	.affib-hotelcard-scores {
		grid-template-columns: 1fr;
	}

	/* ---- ランキング ---- */
	.affib-ranking-body,
	.affib-siteintro {
		flex-direction: column;
	}

	.affib-ranking-image,
	.affib-siteintro-image {
		flex-basis: auto;
		text-align: center;
	}

	.affib-ranking-image .affib-image {
		max-width: 100%;
	}

	/* ---- この記事の商品まとめ：狭い幅ではサムネ＋本文＋ボタンを縦積みに ---- */
	.affib-postitems {
		padding: 12px;
	}

	.affib-postitems-row {
		flex-wrap: wrap;
	}

	.affib-postitems-btn {
		flex-basis: 100%;
		text-align: center;
	}

	/* ---- インラインボタン ---- */
	.affib-minibtn-wrap {
		max-width: 100%;
	}

	/* ---- 追従CTAバー：サムネ・商品名を切り詰めてボタンを確保 ---- */
	.affib-ctabar-title {
		font-size: 0.78em;
	}

	.affib-ctabar-row .affib-buttons > .affib-btn,
	.affib-ctabar-row .affib-buttons > .affib-btn-wrap {
		flex-basis: 70px;
	}

	/* ---- メリット・デメリット：1列に ---- */
	.affib-proscons-grid {
		grid-template-columns: 1fr;
	}
}
