/**
 * The order sheet inherits the theme's fonts and colors. Everything tunable is
 * a custom property, so a child theme can restyle it without touching this file.
 */

.ccb-form {
	--ccb-line: rgba( 0, 0, 0, 0.14 );
	--ccb-line-active: currentColor;
	--ccb-tint: rgba( 0, 0, 0, 0.035 );
	--ccb-muted: rgba( 0, 0, 0, 0.6 );
	--ccb-warn: #a3282a;
	--ccb-radius: 4px;
	--ccb-gap: 1.5rem;

	display: block;
	margin: 0 0 2rem;
}

.ccb-form .ccb-row {
	margin: 0 0 var( --ccb-gap );
}

.ccb-form label,
.ccb-form .ccb-legend {
	display: block;
	margin: 0 0 0.4em;
	font-weight: 600;
}

.ccb-form input[type="number"],
.ccb-form input[type="date"],
.ccb-form textarea {
	width: 100%;
	max-width: 22rem;
	padding: 0.6em 0.7em;
	border: 1px solid var( --ccb-line );
	border-radius: var( --ccb-radius );
	background: transparent;
	color: inherit;
	font: inherit;
}

.ccb-form textarea {
	max-width: 100%;
}

.ccb-help {
	display: block;
	margin-top: 0.35em;
	font-size: 0.85em;
	font-weight: 400;
	color: var( --ccb-muted );
}

/* Option groups */

.ccb-form .ccb-group {
	margin: 0 0 var( --ccb-gap );
	padding: 0;
	border: 0;
}

.ccb-form .ccb-group legend {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	width: 100%;
	margin: 0 0 0.6em;
	padding: 0;
	font-weight: 700;
	font-size: 1.05em;
}

.ccb-limit-counter,
.ccb-allowance-counter {
	font-size: 0.8em;
	font-weight: 400;
	color: var( --ccb-muted );
}

.ccb-limit-counter.is-over,
.ccb-allowance-counter.is-over {
	color: var( --ccb-warn );
}

.ccb-options {
	display: grid;
	gap: 0.5rem;
}

@media ( min-width: 600px ) {
	.ccb-options-checkbox,
	.ccb-options-radio {
		grid-template-columns: repeat( auto-fit, minmax( 15rem, 1fr ) );
	}
}

.ccb-option {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	padding: 0.7rem 0.85rem;
	border: 1px solid var( --ccb-line );
	border-radius: var( --ccb-radius );
	font-weight: 400;
	cursor: pointer;
	transition: border-color 0.12s ease, background-color 0.12s ease;
}

.ccb-option:hover {
	background: var( --ccb-tint );
}

.ccb-option.is-selected {
	border-color: var( --ccb-line-active );
	background: var( --ccb-tint );
}

.ccb-option input[type="checkbox"],
.ccb-option input[type="radio"] {
	flex: 0 0 auto;
	margin: 0;
}

.ccb-option-label {
	flex: 1 1 auto;
	line-height: 1.3;
}

.ccb-option-label small {
	display: block;
	font-size: 0.82em;
	color: var( --ccb-muted );
}

/* Group notes: allowance overage, hard limits, and running costs. Sits
   directly under the choices so the cost appears where the click happened. */

.ccb-group-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	margin: 0.7rem 0 0;
	padding: 0.6em 0.8em;
	border: 1px solid var( --ccb-line );
	border-radius: var( --ccb-radius );
	background: var( --ccb-tint );
	font-size: 0.88em;
	line-height: 1.45;
}

.ccb-group-note::before {
	content: "";
	flex: 0 0 auto;
	width: 0.5em;
	height: 0.5em;
	margin-top: 0.45em;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.55;
}

.ccb-group-note[hidden] {
	display: none;
}

.ccb-group-note.is-charge {
	border-color: var( --ccb-warn );
	color: var( --ccb-warn );
	background: transparent;
	font-weight: 600;
}

.ccb-group-note.is-limit {
	border-color: var( --ccb-warn );
	background: var( --ccb-warn );
	color: #fff;
	font-weight: 600;
}

.ccb-delta {
	display: block;
	font-size: 0.82em;
	font-variant-numeric: tabular-nums;
	color: var( --ccb-muted );
}

.ccb-delta:empty {
	display: none;
}

.ccb-delta.is-charge {
	color: var( --ccb-warn );
}

.ccb-badge {
	display: inline-block;
	margin-left: 0.4em;
	padding: 0.1em 0.45em;
	border-radius: 2px;
	background: var( --ccb-tint );
	font-size: 0.72em;
	font-style: normal;
	letter-spacing: 0.02em;
}

.ccb-option-meta {
	flex: 0 0 auto;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	color: var( --ccb-muted );
}

/* Quantity steppers */

.ccb-stepper {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 0;
}

.ccb-stepper input {
	width: 3.2rem !important;
	padding: 0.35em !important;
	border-radius: 0 !important;
	border-left: 0 !important;
	border-right: 0 !important;
	text-align: center;
	-moz-appearance: textfield;
}

.ccb-stepper input::-webkit-outer-spin-button,
.ccb-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ccb-step {
	width: 2rem;
	height: 2.3rem;
	padding: 0;
	border: 1px solid var( --ccb-line );
	background: transparent;
	color: inherit;
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
}

.ccb-step:first-child {
	border-radius: var( --ccb-radius ) 0 0 var( --ccb-radius );
}

.ccb-step:last-child {
	border-radius: 0 var( --ccb-radius ) var( --ccb-radius ) 0;
}

.ccb-step:hover {
	background: var( --ccb-tint );
}

/* Pickup and delivery */

.ccb-segment {
	display: inline-flex;
	gap: 0;
}

.ccb-segment label {
	margin: 0;
	padding: 0.5em 1.1em;
	border: 1px solid var( --ccb-line );
	font-weight: 400;
	cursor: pointer;
}

.ccb-segment label:first-child {
	border-radius: var( --ccb-radius ) 0 0 var( --ccb-radius );
}

.ccb-segment label:last-child {
	border-left: 0;
	border-radius: 0 var( --ccb-radius ) var( --ccb-radius ) 0;
}

.ccb-segment label.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Summary */

.ccb-summary {
	margin: 0 0 1rem;
	padding: 1.1rem 1.25rem;
	border: 1px solid var( --ccb-line );
	border-radius: var( --ccb-radius );
	background: var( --ccb-tint );
}

.ccb-summary-figures {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem 2.5rem;
}

.ccb-summary-figures > div {
	flex: 0 1 auto;
	min-width: 8rem;
}

.ccb-form .ccb-summary-label {
	display: block !important;
	margin: 0 0 0.15em;
	font-size: 0.85em;
	font-weight: 400;
	line-height: 1.3;
	color: var( --ccb-muted );
}

.ccb-form .ccb-summary strong {
	display: block !important;
	margin: 0;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.15;
}

.ccb-form .ccb-summary small {
	display: block !important;
	margin: 0.2em 0 0;
	font-size: 0.85em;
	line-height: 1.35;
	color: var( --ccb-muted );
}

.ccb-form .ccb-summary small:empty {
	display: none !important;
}

.ccb-fees,
.ccb-surcharges {
	margin: 1rem 0 0;
	padding: 0.75rem 0 0;
	border-top: 1px solid var( --ccb-line );
	list-style: none;
}

.ccb-surcharges {
	margin-bottom: 0;
}

.ccb-fees li,
.ccb-surcharges li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.15em 0;
	font-size: 0.92em;
}

.ccb-fees li strong,
.ccb-surcharges li strong {
	flex: 0 0 auto;
	font-size: 1em !important;
	font-weight: 600;
	display: inline !important;
}

.ccb-fees:empty,
.ccb-surcharges:empty {
	display: none;
}

.ccb-errors {
	margin-top: 0.75rem;
	color: var( --ccb-warn );
	font-size: 0.9em;
}

.ccb-errors:empty {
	display: none;
}

.ccb-errors p {
	margin: 0 0 0.25em;
}

/* Prep sheet */

.ccb-prep {
	margin: 0 0 1.25rem;
	font-size: 0.92em;
}

.ccb-prep summary {
	cursor: pointer;
	color: var( --ccb-muted );
}

.ccb-prep-list {
	margin: 0.6rem 0 0;
	padding-left: 1.2rem;
}

/* Submit */

.ccb-form .ccb-submit.ccb-blocked {
	opacity: 0.5;
	cursor: not-allowed;
}

@media ( prefers-color-scheme: dark ) {
	.ccb-form {
		--ccb-line: rgba( 255, 255, 255, 0.22 );
		--ccb-tint: rgba( 255, 255, 255, 0.06 );
		--ccb-muted: rgba( 255, 255, 255, 0.66 );
		--ccb-warn: #ff8a87;
	}
}
