/**
 * P1-4: 商品ページ「お好きなショップから購入できます」セクションのスタイル。
 *
 * モバイルファースト。テーマ erii-waso が定義する CSS カスタムプロパティ
 * （--color-primary / --color-secondary。html/product1.html の
 * .header-cart{color:var(--color-primary)} 等から確認済み）を優先的に使い、
 * 未定義環境向けのフォールバック値（テーマの実測色 #d4878f 等）も併記する。
 * 既存の「お買い物カゴに追加」ボタン（.single_add_to_cart_button）とは
 * 見た目のトーンを合わせつつ、副導線であることが分かるよう控えめな
 * アウトラインボタンにしている。
 *
 * 対応する問題ID: P1-4
 */

.esen-channel-selector {
	margin: 28px 0 0;
	padding: 20px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0;
	background: #fdfaf8;
	box-sizing: border-box;
}

.esen-channel-selector * {
	box-sizing: border-box;
}

.esen-channel-selector__heading {
	margin: 0 0 14px;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-primary, #3a3a3a);
}

.esen-channel-selector__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.esen-channel-selector__item {
	padding: 14px 16px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 0;
	background: #fff;
}

.esen-channel-selector__item--official {
	border: 2px solid var(--color-primary, #c06a85);
	background: var(--color-bg-white, #fff);
}

.esen-channel-selector__item--official .esen-channel-selector__item-title {
	color: var(--color-primary-text, #a64f6b);
}

.esen-channel-selector__item-title {
	margin: 0 0 6px;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-primary, #3a3a3a);
}

.esen-channel-selector__item-desc {
	margin: 0 0 8px;
	font-size: 0.85rem;
	line-height: 1.7;
	color: #555;
}

.esen-channel-selector__item-desc--out-of-stock {
	color: #a33;
	font-weight: 600;
}

.esen-channel-selector__stock {
	margin: 0 0 6px;
	font-size: 0.85rem;
}

.esen-channel-selector__stock p {
	margin: 0;
}

.esen-channel-selector__hint {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.6;
	color: #777;
}

.esen-channel-selector__link {
	display: inline-block;
	margin-top: 6px;
	padding: 8px 20px;
	border: 1px solid var(--color-secondary, #d4878f);
	border-radius: 0;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--color-secondary, #d4878f);
	background: transparent;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.esen-channel-selector__link:hover,
.esen-channel-selector__link:focus {
	background-color: var(--color-secondary, #d4878f);
	color: #fff;
}

.esen-channel-selector__fallback {
	padding: 12px 16px;
	border: 1px dashed rgba(0, 0, 0, 0.14);
	border-radius: 0;
	background: #fafafa;
}

.esen-channel-selector__fallback p {
	margin: 0 0 8px;
	font-size: 0.85rem;
	line-height: 1.6;
	color: #555;
}

.esen-channel-selector__fallback-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
}

.esen-channel-selector__fallback-list a {
	font-size: 0.8rem;
	color: var(--color-secondary, #d4878f);
	text-decoration: underline;
}

.esen-channel-selector__notice {
	margin: 14px 0 0;
	padding-top: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	font-size: 0.75rem;
	line-height: 1.7;
	color: #888;
}

.esen-channel-selector__more {
	margin-top: 16px;
}

.esen-channel-selector__more-toggle {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 4px;
	min-height: 44px;
	padding: 6px 0;
	font-size: 0.85rem;
	color: var(--color-text-light, #6e6375);
	user-select: none;
}

.esen-channel-selector__more-toggle::-webkit-details-marker {
	display: none;
}

.esen-channel-selector__more-toggle span {
	display: inline-block;
	transition: transform 0.2s ease;
}

.esen-channel-selector__more[open] .esen-channel-selector__more-toggle span {
	transform: rotate(180deg);
}

.esen-channel-selector__more .esen-channel-selector__list {
	margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.esen-channel-selector__more-toggle span {
		transition: none;
	}
}

/* 640px以上: 商品枠を2列グリッドに（公式枠のみ全幅で最上段に固定）。 */
@media (min-width: 640px) {
	.esen-channel-selector__list {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.esen-channel-selector__item {
		flex: 1 1 calc(50% - 6px);
	}

	.esen-channel-selector__item--official,
	.esen-channel-selector__fallback {
		flex-basis: 100%;
	}
}
