/**
 * MyMoods Composite UI
 * 濃度フィルタを2択のボタン（セグメンテッドコントロール）として見せる。
 * 既存デザインを壊さないよう、色は本文色を継承して最小限の装飾にとどめる。
 */

.component_filters .component_filter.mmcui-strength {
	margin: 0 0 1.25em;
	padding: 0;
	border: 0;
}

.component_filters .component_filter.mmcui-strength .component_filter_title {
	margin: 0 0 0.5em;
	padding: 0;
	border: 0;
	cursor: default;
}

.component_filters .component_filter.mmcui-strength .component_filter_name {
	display: block;
	cursor: default;
	padding: 0;
}

/* 本体のアコーディオン開閉アイコン（FontAwesomeCPの:before）を消す。
   padding-leftを0にした結果、アイコンがテキストの先頭に重なって
   三角形の異物のように見えていた。 */
.component_filters .component_filter.mmcui-strength .component_filter_name::before,
.component_filters .component_filter.mmcui-strength .component_filter_name::after {
	content: none !important;
	display: none !important;
}

.component_filters .component_filter.mmcui-strength .component_filter_name_text {
	font-weight: 600;
	font-size: 0.95em;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

.component_filters .component_filter.mmcui-strength .component_filter_content {
	display: block !important;
	padding: 0;
	border: 0;
}

.component_filters .component_filter.mmcui-strength ul.component_filter_options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none none;
	border: 0;
}

.component_filters .component_filter.mmcui-strength ul.component_filter_options li.component_filter_option {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	list-style: none;
	background: none;
	border: 0;
}

.component_filters .component_filter.mmcui-strength li.component_filter_option > a.toggle_filter_option {
	display: block;
	min-width: 6em;
	padding: 0.65em 1.4em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: inherit;
	opacity: 0.55;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* 本体テンプレートのチェックボックス風装飾を無効化 */
.component_filters .component_filter.mmcui-strength li.component_filter_option > a.toggle_filter_option::before,
.component_filters .component_filter.mmcui-strength li.component_filter_option > a.toggle_filter_option::after {
	display: none !important;
	content: none !important;
}

.component_filters .component_filter.mmcui-strength li.component_filter_option > a.toggle_filter_option:hover,
.component_filters .component_filter.mmcui-strength li.component_filter_option > a.toggle_filter_option:focus {
	opacity: 1;
}

.component_filters .component_filter.mmcui-strength li.component_filter_option.selected > a.toggle_filter_option {
	background-color: #111;
	border-color: #111;
	color: #fff;
	opacity: 1;
	cursor: default;
}

/* 解除できてしまう導線は出さない */
.component_filters .component_filter.mmcui-strength .reset_component_filter,
.component_filters .component_filter.mmcui-strength .aria_button {
	display: none !important;
}

/* ------------------------------------------------------------------
 * カート直前の合計金額（.composite_price）を隠す。
 * 価格表示は商品タイトル直下の1か所（.product__price、JSで濃度に応じて
 * 追従させる）だけにする。ここは合計を出さないだけで、カート追加の
 * 内部計算には影響しない。
 * ------------------------------------------------------------------ */
.composite_data .composite_price {
	display: none !important;
}

/* ------------------------------------------------------------------
 * ページ間の切替ボタン（セット商品：点数 × 濃度）
 * 見た目はページ内トグルと合わせる。押すと該当ページへ移動する。
 * ------------------------------------------------------------------ */

.mmcui-page-toggles {
	margin: 0 0 1.5em;
}

.mmcui-page-toggle {
	margin: 0 0 0.75em;
}

.mmcui-page-toggle__label {
	display: block;
	margin: 0 0 0.4em;
	font-weight: 600;
	font-size: 0.95em;
	letter-spacing: 0.02em;
	opacity: 0.85;
}

ul.mmcui-page-toggle__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none none;
}

ul.mmcui-page-toggle__options > li {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	list-style: none;
}

ul.mmcui-page-toggle__options > li > a,
ul.mmcui-page-toggle__options > li > span {
	display: block;
	min-width: 5em;
	padding: 0.6em 1.3em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: inherit;
	opacity: 0.55;
	transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

ul.mmcui-page-toggle__options > li > a:hover,
ul.mmcui-page-toggle__options > li > a:focus {
	opacity: 1;
}

ul.mmcui-page-toggle__options > li.selected > span {
	background-color: #111;
	border-color: #111;
	color: #fff;
	opacity: 1;
	cursor: default;
}

/* ------------------------------------------------------------------
 * 在庫切れの選択肢（disabledはassets/mm-composite-ui.jsが付与）。
 * ブラウザ既定でも大抵グレー表示になるが、明示して確実にする。
 * ------------------------------------------------------------------ */
select[id^="component_options_"] option:disabled {
	color: #999;
}


/* ------------------------------------------------------------------
   追加POD（No.91: スターターキットの2箱目・3箱目）
   ------------------------------------------------------------------ */

/* 開くまで追加枠は隠す（Composite本体JSの表示処理より優先） */
.mmcui-addon-hidden {
	display: none !important;
}

/* 「＋ PODの追加注文はこちら」トグル */
.mmcui-addon-trigger {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	margin: 0 0 16px;
	padding: 14px 18px;
	text-align: left;
	background: #fff;
	border: 1.5px dashed rgba(37, 0, 193, 0.45); /* mymoods-blue */
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mmcui-addon-trigger:hover,
.mmcui-addon-trigger:focus-visible {
	border-color: #2500c1;
	background: rgba(37, 0, 193, 0.04);
}

.mmcui-addon-trigger__row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mmcui-addon-trigger__plus {
	font-weight: 700;
	color: #2500c1;
}

.mmcui-addon-trigger__label {
	font-weight: 700;
	font-size: 15px;
	color: #111;
}

.mmcui-addon-trigger__note {
	font-size: 12.5px;
	color: #2500c1;
	padding-left: 22px;
}

/* カートボタン直前の送料アピール */
.mmcui-ship-appeal {
	margin: 4px 0 14px;
	padding: 10px 14px;
	border-radius: 8px;
	background: rgba(37, 0, 193, 0.06);
	color: #2500c1;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.6;
}

.mmcui-ship-appeal.is-free {
	background: #e7f5ee;
	color: #145f3e;
}

.mmcui-ship-appeal.is-free::before {
	content: "✓ ";
}

/*
 * ★iPhone で「POD を選んだあと画面が横に伸びてスクロールしにくい」対策
 *   （2026-08-13・小田さん報告）
 *
 * 画面が伸びているのではない。ページの横幅は選択の前後で一切変わっていない
 * （scrollWidth も clientWidth も 390 のまま。実測: setup-scripts/overflow91.js）。
 *
 * 正体は iOS Safari の自動ズーム。**文字サイズが 16px 未満のフォーム部品を
 * タップすると読みやすいように勝手に拡大し、閉じても縮小して戻らない。**
 * 拡大されたまま残るので「横に伸びて、スライドしにくい」ように見える。
 *
 * テーマ assets/mymoods-composite.css が
 *   .composite_form .component_options_select { font-size: 1.5rem }
 * を指定しており、ルート10px設定のため 15px = 16px 未満で条件に当たっていた。
 * （同じページの数量入力欄は 16px で、こちらはズームしない）
 *
 * テーマを直すにはベンダーへのPRが要るので、こちらのプラグインから上書きする。
 * 指の操作をする端末だけに当てる（pointer: coarse）ので、
 * マウス操作のPC表示は 15px のまま変わらない。
 *
 * ⚠️ 16px より小さくしないこと。1px 下げるだけで同じ不具合が再発する。
 */
@media (pointer: coarse) {

	.composite_form .component_options_select,
	.composite_component .component_options_select {
		font-size: 16px;
	}
}

/*
 * ★iPhone で「フレーバーを選ぶとページが横に伸びて横スクロールできてしまう」対策
 *   （2026-08-13・小田さんの画面録画から特定）
 *
 * Safari(WebKit) だけで起きる。Chrome/Edge では再現しない。
 *
 * 症状: 名前の長いフレーバーを選ぶと、選んだ瞬間にページ幅が広がる。
 *       実測（WebKitで再現）:
 *         スターターキット 390px → 590px（+200px）
 *         POD単品ページ                  （+75px）
 *       画面には何も無い灰色の余白が右に出て、指が横に滑って操作しづらくなる。
 *
 * 原因: <select> の「選択中の文字」が長いと、WebKit はその文字幅
 *       （例「（ニコチン3%）MANGO PEACH WATERMELON × MINT ICE – $20.00 (23.1% off)」
 *        ＝543px）を選択欄を包む枠 .component_options_select_wrapper の
 *       レイアウト幅として採用してしまう。select 自体は width:100% で
 *       300px に収まっているのに、包んでいる枠だけが 543px に広がり、
 *       ページ全体を押し広げる。
 *
 * ★これは文字サイズの問題ではない（上の16px化とは別件）。
 *   15px に戻しても +167px はみ出すことを実測済み。
 *
 * 直し方の選定（WebKitで「最初からCSSを入れた状態」で検証した結果）:
 *   max-width:100%  … 後から当てれば直るが、**発生は防げない**（+200px のまま）
 *   min-width:0     … 同上（+200px のまま）
 *   overflow:hidden … **発生そのものを防げる唯一の指定**（両商品ともOK）
 * → overflow:hidden を採用。
 *   後から当てて直る指定は、一度レイアウトを作り直させているだけで
 *   予防にならない。必ず「最初から入れた状態」で確認すること。
 *
 * 見た目への影響: この枠の中身は <select> だけで、はみ出して見せたい要素は無い。
 * ドロップダウンの矢印は select の背景画像なので切れない。
 * iOSの選択リストはOS側が描くので影響しない。
 */
.composite_form .component_options_select_wrapper,
.composite_component .component_options_select_wrapper {
	overflow: hidden;
}
