/* =========================================================
   サン・エールキッチン お弁当注文フォーム
   モバイルファースト設計（375px〜）
   ========================================================= */

.tbo {
	--tbo-green: #7a9a3f;
	--tbo-green-dark: #5f7a2f;
	--tbo-yellow: #f7d24b;
	--tbo-yellow-light: #fdf6dd;
	--tbo-orange: #ef8a1f;
	--tbo-red: #d3381c;
	--tbo-text: #33291f;
	--tbo-muted: #6f6459;
	--tbo-line: #e2ddd3;
	--tbo-bg: #fffdf7;
	--tbo-radius: 12px;
	--tbo-shadow: 0 2px 8px rgba(51, 41, 31, .08);

	color: var(--tbo-text);
	font-size: 16px;
	line-height: 1.7;
	-webkit-text-size-adjust: 100%;
	word-break: break-word;
	max-width: 1000px;
	margin-left: auto;
	margin-right: auto;
}

.tbo *,
.tbo *::before,
.tbo *::after {
	box-sizing: border-box;
}

.tbo img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* hidden 属性を確実に効かせる。
   （.tbo-loading などに display を指定しているため、
     ブラウザ標準の [hidden]{display:none} が打ち消されてしまうのを防ぐ） */
.tbo[hidden],
.tbo [hidden] {
	display: none !important;
}

/* スマホでは固定バーの分だけ余白を確保 */
.tbo[data-bar-visible="1"] {
	padding-bottom: 96px;
}

/* ---------------------------------------------------------
   お知らせ・メッセージ
   --------------------------------------------------------- */
.tbo-msg {
	border-radius: var(--tbo-radius);
	padding: 16px;
	margin: 0 0 24px;
	font-size: 15px;
}

.tbo-msg h3 {
	margin: 0 0 8px;
	font-size: 17px;
	line-height: 1.4;
}

.tbo-msg p {
	margin: 0 0 4px;
}

.tbo-msg p:last-child {
	margin-bottom: 0;
}

.tbo-msg--info {
	background: var(--tbo-yellow-light);
	border: 1px solid #eddba8;
}

.tbo-msg--warn {
	background: #fdeceb;
	border: 1px solid #f2b8b2;
}

/* ---------------------------------------------------------
   セクション
   --------------------------------------------------------- */
.tbo-sec {
	margin: 0 0 36px;
}

.tbo-sec__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 19px;
	line-height: 1.4;
	font-weight: 700;
	margin: 0 0 10px;
	padding: 0 0 10px;
	border-bottom: 3px solid var(--tbo-yellow);
}

.tbo-step {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--tbo-green);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
}

.tbo-sec__lead {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--tbo-muted);
}

/* ---------------------------------------------------------
   メニューカード
   --------------------------------------------------------- */
.tbo-cat {
	margin: 0 0 28px;
}

.tbo-cat__title {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 6px;
	padding: 6px 12px;
	background: var(--tbo-green);
	color: #fff;
	border-radius: 6px;
}

.tbo-cat__desc {
	font-size: 14px;
	color: var(--tbo-muted);
	margin: 0 0 12px;
}

/* 画面幅ではなく、実際に使える幅に合わせて自動で列数が決まる */
.tbo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 14px;
}

.tbo-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 2px solid var(--tbo-line);
	border-radius: var(--tbo-radius);
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s;
}

.tbo-card.is-selected {
	border-color: var(--tbo-orange);
	box-shadow: 0 0 0 3px rgba(239, 138, 31, .15);
}

.tbo-card__img {
	background: #f3f1ea;
}

.tbo-card__img img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.tbo-card__body {
	padding: 12px 14px 0;
	flex: 1 1 auto;
}

.tbo-card__name {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 4px;
	line-height: 1.4;
}

.tbo-card__price {
	font-size: 22px;
	font-weight: 700;
	color: var(--tbo-red);
	margin: 0 0 8px;
	line-height: 1.2;
}

.tbo-card__price small {
	font-size: 12px;
	font-weight: 400;
	color: var(--tbo-muted);
	margin-left: 2px;
}

.tbo-card__note {
	font-size: 16px;
}

.tbo-card__desc {
	font-size: 13px;
	line-height: 1.6;
	color: var(--tbo-muted);
	margin: 0 0 10px;
}

.tbo-card__min {
	font-size: 13px;
	color: var(--tbo-orange);
	font-weight: 700;
	margin: 0 0 10px;
}

/* ---------------------------------------------------------
   数量ステッパー（指で押しやすい 48px）
   --------------------------------------------------------- */
.tbo-stepper {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0;
	padding: 12px 14px 14px;
	margin-top: auto;
}

.tbo-stepper__btn {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	font-size: 24px;
	line-height: 1;
	font-weight: 700;
	color: var(--tbo-green-dark);
	background: #f3f5ec;
	border: 2px solid var(--tbo-green);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	touch-action: manipulation;
	user-select: none;
}

.tbo-stepper__btn:first-of-type {
	border-radius: 8px 0 0 8px;
}

.tbo-stepper__btn:last-of-type {
	border-radius: 0 8px 8px 0;
}

.tbo-stepper__btn:active {
	background: var(--tbo-green);
	color: #fff;
}

.tbo-stepper__btn:disabled {
	opacity: .35;
	cursor: default;
}

.tbo-stepper__input {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 110px;
	height: 52px;
	text-align: center;
	font-size: 20px;
	font-weight: 700;
	color: var(--tbo-text);
	border: 2px solid var(--tbo-green);
	border-left: none;
	border-right: none;
	border-radius: 0;
	background: #fff;
	-moz-appearance: textfield;
}

.tbo-stepper__input::-webkit-outer-spin-button,
.tbo-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------------------------------------------------------
   オプション（お茶）
   --------------------------------------------------------- */
/* auto-fit：品目が少ないときは空き列を作らず、横幅いっぱいに広げる */
.tbo-optlist {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 12px;
}

/* 名称・価格を上、数量を下に積む縦並び。
   flex-wrap は使わない（column 指定と併用すると右側に折り返してしまうため） */
.tbo-opt {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	background: #fff;
	border: 2px solid var(--tbo-line);
	border-radius: var(--tbo-radius);
	padding: 12px 14px;
}

.tbo-opt.is-selected {
	border-color: var(--tbo-orange);
}

.tbo-opt__name {
	display: block;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.4;
}

.tbo-opt__price {
	display: block;
	color: var(--tbo-red);
	font-weight: 700;
}

.tbo-opt .tbo-stepper {
	padding: 0;
	justify-content: flex-start;
}

/* ---------------------------------------------------------
   入力欄
   --------------------------------------------------------- */
.tbo-field {
	margin: 0 0 22px;
}

.tbo-label {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-weight: 700;
	font-size: 15px;
	margin: 0 0 6px;
}

.tbo-req {
	display: inline-block;
	background: var(--tbo-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 3px;
}

/* font-size:16px 未満だと iOS Safari が自動ズームするため 16px を死守 */
.tbo-input {
	display: block;
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	font-size: 16px;
	line-height: 1.5;
	font-family: inherit;
	color: var(--tbo-text);
	background: #fff;
	border: 2px solid var(--tbo-line);
	border-radius: 8px;
	-webkit-appearance: none;
	appearance: none;
}

select.tbo-input {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2333291f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
	padding-right: 40px;
}

.tbo-textarea {
	min-height: 96px;
	resize: vertical;
}

.tbo-input:focus {
	outline: none;
	border-color: var(--tbo-green);
	box-shadow: 0 0 0 3px rgba(122, 154, 63, .2);
}

.tbo-input.is-error {
	border-color: var(--tbo-red);
	background: #fff8f7;
}

.tbo-help {
	font-size: 13px;
	color: var(--tbo-muted);
	margin: 6px 0 0;
	line-height: 1.6;
}

.tbo-err {
	color: var(--tbo-red);
	font-size: 14px;
	font-weight: 700;
	margin: 6px 0 0;
	padding-left: 20px;
	position: relative;
}

.tbo-err::before {
	content: "!";
	position: absolute;
	left: 0;
	top: 3px;
	width: 16px;
	height: 16px;
	line-height: 16px;
	text-align: center;
	font-size: 12px;
	border-radius: 50%;
	background: var(--tbo-red);
	color: #fff;
}

.tbo-err--global {
	background: #fdeceb;
	border: 1px solid #f2b8b2;
	border-radius: 8px;
	padding: 12px 12px 12px 34px;
	margin: 16px 0;
}

.tbo-err--global::before {
	left: 12px;
	top: 15px;
}

/* ラジオ */
.tbo-radios {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.tbo-radio {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 10px 14px;
	border: 2px solid var(--tbo-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 15px;
}

.tbo-radio input {
	width: 22px;
	height: 22px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: var(--tbo-green);
}

.tbo-radio:has(input:checked) {
	border-color: var(--tbo-orange);
	background: #fff8ee;
}

/* ハニーポット */
.tbo-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------------------------------------------------------
   ボタン
   --------------------------------------------------------- */
.tbo-actions {
	margin: 28px 0 0;
}

.tbo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 56px;
	padding: 14px 20px;
	font-size: 17px;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.4;
	border-radius: 999px;
	border: 2px solid transparent;
	cursor: pointer;
	text-align: center;
	touch-action: manipulation;
	transition: opacity .15s, background .15s;
}

.tbo-btn--primary {
	background: var(--tbo-orange);
	color: #fff;
	box-shadow: 0 3px 0 #c96f10;
}

.tbo-btn--primary:active {
	transform: translateY(2px);
	box-shadow: 0 1px 0 #c96f10;
}

.tbo-btn--ghost {
	background: #fff;
	color: var(--tbo-muted);
	border-color: var(--tbo-line);
}

.tbo-btn:disabled {
	opacity: .5;
	cursor: default;
}

.tbo-actions--split {
	display: grid;
	gap: 12px;
}

.tbo-cancelbox {
	margin: 40px 0 0;
	padding: 16px;
	border: 1px dashed var(--tbo-line);
	border-radius: var(--tbo-radius);
	text-align: center;
}

.tbo-cancelbox p {
	font-size: 14px;
	color: var(--tbo-muted);
	margin: 0 0 10px;
}

/* ---------------------------------------------------------
   確認画面
   --------------------------------------------------------- */
.tbo-review {
	border: 2px solid var(--tbo-line);
	border-radius: var(--tbo-radius);
	overflow: hidden;
	margin: 0 0 20px;
	background: #fff;
}

.tbo-review__head {
	background: var(--tbo-yellow-light);
	padding: 10px 14px;
	font-weight: 700;
	font-size: 15px;
	border-bottom: 1px solid var(--tbo-line);
}

.tbo-review__row {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border-bottom: 1px solid #f0ede6;
	font-size: 15px;
}

.tbo-review__row:last-child {
	border-bottom: none;
}

.tbo-review__key {
	font-size: 13px;
	color: var(--tbo-muted);
	font-weight: 700;
}

.tbo-review__val {
	white-space: pre-wrap;
}

.tbo-review__item {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid #f0ede6;
	font-size: 15px;
}

.tbo-review__item span:last-child {
	flex: 0 0 auto;
	font-weight: 700;
}

.tbo-review__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 14px;
	background: var(--tbo-yellow-light);
	font-weight: 700;
	font-size: 16px;
}

.tbo-review__total strong {
	font-size: 24px;
	color: var(--tbo-red);
}

/* ---------------------------------------------------------
   完了画面
   --------------------------------------------------------- */
.tbo-done {
	text-align: center;
	padding: 24px 16px 32px;
	background: var(--tbo-yellow-light);
	border-radius: var(--tbo-radius);
}

.tbo-done__icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: var(--tbo-green);
	color: #fff;
	font-size: 34px;
	line-height: 64px;
	font-weight: 700;
}

.tbo-done h2 {
	font-size: 21px;
	margin: 0 0 12px;
}

.tbo-done p {
	font-size: 15px;
	margin: 0 0 10px;
	text-align: left;
}

.tbo-done__no {
	display: inline-block;
	background: #fff;
	border: 2px solid var(--tbo-green);
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 19px;
	font-weight: 700;
	margin: 0 0 16px;
}

.tbo-done__contact {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--tbo-line);
	font-size: 14px;
	color: var(--tbo-muted);
	text-align: center !important;
}

/* ---------------------------------------------------------
   固定合計バー
   --------------------------------------------------------- */
.tbo-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	background: rgba(255, 255, 255, .97);
	border-top: 2px solid var(--tbo-yellow);
	box-shadow: 0 -2px 10px rgba(51, 41, 31, .12);
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.tbo-bar__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 900px;
	margin: 0 auto;
}

.tbo-bar__sum {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.3;
}

.tbo-bar__qty {
	display: block;
	font-size: 13px;
	color: var(--tbo-muted);
}

.tbo-bar__total {
	display: block;
	font-size: 14px;
	font-weight: 700;
}

.tbo-bar__total strong {
	font-size: 22px;
	color: var(--tbo-red);
}

.tbo-bar__total small {
	font-size: 11px;
	font-weight: 400;
	color: var(--tbo-muted);
}

.tbo-bar__btn {
	flex: 0 0 auto;
	width: auto;
	min-height: 48px;
	font-size: 15px;
	padding: 10px 18px;
}

/* ---------------------------------------------------------
   ローディング
   --------------------------------------------------------- */
.tbo-loading {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(255, 255, 255, .8);
	display: flex;
	align-items: center;
	justify-content: center;
}

.tbo-loading__box {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	padding: 18px 24px;
	border-radius: var(--tbo-radius);
	box-shadow: var(--tbo-shadow);
	font-weight: 700;
}

.tbo-spinner {
	width: 22px;
	height: 22px;
	border: 3px solid var(--tbo-line);
	border-top-color: var(--tbo-green);
	border-radius: 50%;
	animation: tbo-spin .8s linear infinite;
}

@keyframes tbo-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tbo-spinner {
		animation-duration: 2s;
	}
	.tbo * {
		transition: none !important;
	}
}

/* =========================================================
   レイアウト切り替え（コンテナクエリ）

   サイドバー付きのページなど、画面は広くてもフォームの表示幅が
   狭いケースがあるため、画面幅ではなく「フォームが実際に使える幅」
   で判定する。対応していない古いブラウザでは、そのまま
   スマホ向けの1列レイアウトになるだけで、利用に支障はない。
   ========================================================= */
.tbo-stage {
	container-type: inline-size;
	container-name: tbo;
}

/* 中くらいの幅：見出しを大きく、確認画面を2列に */
@container tbo (min-width: 560px) {
	.tbo-sec__title {
		font-size: 21px;
	}

	.tbo-review__row {
		flex-direction: row;
		align-items: baseline;
		gap: 16px;
	}

	.tbo-review__key {
		flex: 0 0 150px;
	}

	.tbo-review__val {
		flex: 1 1 auto;
	}

	.tbo-actions {
		display: flex;
		justify-content: center;
	}

	.tbo-btn {
		width: auto;
		min-width: 260px;
	}

	.tbo-actions--split {
		display: grid;
		grid-template-columns: 1fr 2fr;
		gap: 12px;
	}

	.tbo-actions--split .tbo-btn {
		width: 100%;
		min-width: 0;
	}
}

/* 広い幅：入力欄の項目名を左に配置 */
@container tbo (min-width: 700px) {
	.tbo-field {
		display: grid;
		grid-template-columns: 190px 1fr;
		gap: 4px 20px;
		align-items: start;
	}

	.tbo-label {
		padding-top: 12px;
		margin: 0;
	}

	.tbo-field > .tbo-input,
	.tbo-field > .tbo-radios,
	.tbo-field > .tbo-help,
	.tbo-field > .tbo-err {
		grid-column: 2;
	}
}

/* =========================================================
   固定合計バーだけは画面幅で判定する
   （画面に固定表示されるため、囲み枠の幅とは無関係）
   ========================================================= */
@media (min-width: 900px) {
	.tbo-bar {
		left: auto;
		right: 24px;
		bottom: 24px;
		width: 340px;
		border: 2px solid var(--tbo-yellow);
		border-radius: var(--tbo-radius);
		padding: 14px 16px;
	}

	.tbo-bar__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.tbo-bar__btn {
		width: 100%;
	}

	.tbo[data-bar-visible="1"] {
		padding-bottom: 0;
	}
}

/* 印刷 */
@media print {
	.tbo-bar,
	.tbo-actions,
	.tbo-loading {
		display: none !important;
	}
}

/* =========================================================
   注意事項ボックス
   ========================================================= */
.tbo-cautions {
	background: #fff8ee;
	border: 2px solid var(--tbo-orange);
	border-radius: var(--tbo-radius);
	padding: 16px;
	margin: 0 0 28px;
}

.tbo-cautions__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
	font-weight: 700;
	color: var(--tbo-red);
	margin: 0 0 14px;
	padding: 0 0 10px;
	border-bottom: 1px dashed #e5c9a4;
	line-height: 1.4;
}

.tbo-cautions__title::before {
	content: "!";
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	line-height: 22px;
	text-align: center;
	font-size: 15px;
	border-radius: 50%;
	background: var(--tbo-red);
	color: #fff;
}

.tbo-caution {
	margin: 0 0 14px;
}

.tbo-caution:last-child {
	margin-bottom: 0;
}

.tbo-caution__title {
	font-size: 15px;
	font-weight: 700;
	margin: 0 0 2px;
	line-height: 1.5;
}

.tbo-caution__body {
	font-size: 14px;
	line-height: 1.7;
	margin: 0;
	color: var(--tbo-muted);
}

.tbo-preconfirm {
	margin-top: 28px;
}

/* =========================================================
   お弁当カードの注意書きバッジ
   ========================================================= */
.tbo-card__badge {
	display: inline-block;
	background: var(--tbo-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	padding: 4px 10px;
	border-radius: 4px;
	margin: 0 0 8px;
}

/* 1種類あたりの推奨数に満たないときの案内 */
.tbo-card__few {
	margin: 0;
	padding: 10px 14px 14px;
	font-size: 13px;
	line-height: 1.6;
	font-weight: 700;
	color: var(--tbo-orange);
	background: #fff8ee;
}

/* =========================================================
   おまかせ弁当のご予算入力
   ========================================================= */
.tbo-budget {
	padding: 12px 14px 0;
}

.tbo-budget__label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin: 0 0 6px;
}

.tbo-budget__select {
	display: block;
	width: 100%;
	height: 52px;
	padding: 0 40px 0 14px;
	font-size: 18px;
	font-weight: 700;
	font-family: inherit;
	color: var(--tbo-red);
	background-color: #fff;
	border: 2px solid var(--tbo-orange);
	border-radius: 8px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23ef8a1f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
}

.tbo-budget__select:focus {
	outline: none;
	border-color: var(--tbo-green);
	box-shadow: 0 0 0 3px rgba(122, 154, 63, .2);
}

.tbo-budget__help {
	font-size: 12px;
	color: var(--tbo-muted);
	margin: 6px 0 0;
	line-height: 1.5;
}

.tbo-budget .tbo-err {
	font-size: 13px;
}

/* =========================================================
   お届け希望日の曜日表示
   ========================================================= */
.tbo-dateview {
	margin: 8px 0 0;
	padding: 8px 12px;
	background: #f3f5ec;
	border-left: 4px solid var(--tbo-green);
	border-radius: 4px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}

.tbo-dateview.is-sun {
	background: #fdeceb;
	border-left-color: var(--tbo-red);
	color: var(--tbo-red);
}

.tbo-dateview.is-sat {
	background: #e9f0f7;
	border-left-color: #1f4e79;
	color: #1f4e79;
}

/* =========================================================
   お届け先の選択
   ========================================================= */
.tbo-radios--place {
	grid-template-columns: 1fr;
}

.tbo-otherplace {
	margin: 14px 0 0;
	padding: 14px;
	background: #fafaf7;
	border: 1px dashed var(--tbo-line);
	border-radius: 8px;
}

.tbo-otherplace .tbo-label {
	font-size: 14px;
}
