/* Half & half in the product form (layout C): a switch, then a searchable list of the other pizzas. Colours follow the
 * FireBox child theme's tokens, with fallbacks for any other theme. */
.fo-half {
	flex: 0 0 100%;
	box-sizing: border-box;
	margin: 0 0 1.2rem;
	font-family: var(--fb-sans, inherit);
	color: var(--fb-black, #131313);
}
.fo-half [hidden] { display: none !important; }
.fo-half-hidden { display: none !important; }

.fo-half__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding: .8rem .9rem;
	border: 1.5px solid #d9cab2;
	border-radius: 10px;
	background: var(--fb-white, #fff);
	cursor: pointer;
}
.fo-half__toggle-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.fo-half__toggle-text strong { font-size: .95rem; }
.fo-half__toggle-text span { font-size: .8rem; color: var(--fb-muted, #5d5147); }
.fo-half__switch { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fo-half__track {
	position: relative;
	flex: none;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #cfc2ad;
	transition: background .15s;
}
.fo-half__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}
.fo-half__switch:checked + .fo-half__track { background: var(--fb-orange, #c14824); }
.fo-half__switch:checked + .fo-half__track::after { transform: translateX(18px); }
.fo-half__toggle:has(.fo-half__switch:checked) { border-color: var(--fb-orange, #c14824); background: var(--fb-tint, #fdf0ea); }
.fo-half__switch:focus-visible + .fo-half__track { outline: 3px solid rgba(193, 72, 36, .35); outline-offset: 2px; }

.fo-half__body { margin-top: 1rem; }
.fo-half__label {
	display: block;
	margin: 0 0 .6rem;
	padding: 0;
	font-family: var(--fb-serif, inherit);
	font-size: 1.05rem;
	font-weight: 900;
}
.fo-half__search {
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	margin: 0 0 .5rem;
	padding: 0 .8rem;
	border: 1.5px solid #d9cab2;
	border-radius: 8px;
	background: var(--fb-white, #fff);
	font: inherit;
	font-size: 16px; /* no zoom on iPhone */
	color: inherit;
}
.fo-half__search:focus { outline: none; border-color: var(--fb-orange, #c14824); }
.fo-half__list {
	max-height: 13.5rem; /* about four and a half rows; the rest scrolls */
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1.5px solid #d9cab2;
	border-radius: 10px;
	background: var(--fb-white, #fff);
}
.fo-half__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .8rem;
	min-height: 3rem;
	padding: .55rem .8rem;
	border-bottom: 1px solid #f0e6d6;
	font-size: .92rem;
	cursor: pointer;
}
.fo-half__option:last-child { border-bottom: 0; }
.fo-half__option:hover { background: #fbf6ee; }
.fo-half__option:focus-visible { outline: 3px solid rgba(193, 72, 36, .35); outline-offset: -3px; }
.fo-half__option.is-picked { background: var(--fb-tint, #fdf0ea); font-weight: 700; }
.fo-half__option.is-picked .fo-half__name::before { content: "✓ "; color: var(--fb-orange, #c14824); }
.fo-half__name { min-width: 0; }
.fo-half__price { flex: none; font-size: .85rem; color: var(--fb-muted, #5d5147); white-space: nowrap; }
.fo-half__option.is-picked .fo-half__price { color: inherit; }
.fo-half__empty { margin: .6rem 0 0; font-size: .9rem; color: var(--fb-muted, #5d5147); }

.fo-half__toppings { margin: 1rem 0 0; padding: 0; border: 0; min-width: 0; }
.fo-half__toppings .fo-half__label { float: none; width: auto; }
.fo-half__body > .fo-half__toppings[data-half="1"] { margin: 0 0 1.2rem; }
.fo-half__choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); gap: .5rem; }
.fo-half__topping {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .2rem .5rem;
	margin: 0;
	padding: .6rem .7rem;
	border: 1.5px solid #d9cab2;
	border-radius: 10px;
	background: var(--fb-white, #fff);
	font-size: .9rem;
	line-height: 1.25;
	cursor: pointer;
}
.fo-half__topping input { margin: 0; accent-color: var(--fb-orange, #c14824); }
.fo-half__topping .fo-half__price { flex-basis: 100%; padding-left: 1.4rem; font-size: .8rem; }
.fo-half__topping:has(input:checked) { border-color: var(--fb-orange, #c14824); background: var(--fb-tint, #fdf0ea); }
.fo-half__topping:has(input:focus-visible) { outline: 3px solid rgba(193, 72, 36, .35); outline-offset: 2px; }

button.single_add_to_cart_button[data-fo-half-wait] { opacity: .55; cursor: not-allowed; }

/* The picked other half, once the list has closed. */
.fo-half__picked-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: .15rem .8rem;
	min-height: 3rem;
	padding: .55rem .6rem .55rem .8rem;
	border: 1.5px solid var(--fb-orange, #c14824);
	border-radius: 10px;
	background: var(--fb-tint, #fdf0ea);
	font-size: .92rem;
}
.fo-half__picked-name { grid-column: 1; min-width: 0; font-weight: 700; }
.fo-half__picked-name::before { content: "✓ "; color: var(--fb-orange, #c14824); }
.fo-half__picked-row .fo-half__price { grid-column: 1; }
.fo-half .fo-half__change { grid-column: 2; grid-row: 1 / span 2; }
.fo-half .fo-half__change {
	flex: none;
	margin: 0;
	padding: .45rem .8rem;
	border: 1.5px solid var(--fb-black, #131313);
	border-radius: 999px;
	background: var(--fb-white, #fff);
	font: inherit;
	font-size: .85rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--fb-black, #131313);
	cursor: pointer;
}
.fo-half .fo-half__change:hover { background: var(--fb-black, #131313); color: #fff; }
.fo-half .fo-half__change:focus-visible { outline: 3px solid rgba(193, 72, 36, .35); outline-offset: 2px; }
