/* Donation & Tip Toolkit — donation / tip box (classic and block cart / checkout). */

.dtt-boxes:empty {
	display: none;
}

.dtt-box {
	--dtt-accent: #2271b1;
	position: relative;
	margin: 0 0 1.5em;
	padding: 1.25em 1.25em 1em;
	border: 1px solid color-mix(in srgb, var(--dtt-accent) 30%, transparent);
	border-left: 4px solid var(--dtt-accent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--dtt-accent) 5%, transparent);
	box-sizing: border-box;
	clear: both;
}

.dtt-box.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.dtt-box .dtt-box__title {
	margin: 0 0 0.4em;
	font-size: 1.15em;
	line-height: 1.3;
}

.dtt-box .dtt-box__text,
.dtt-box .dtt-box__link {
	margin: 0 0 0.6em;
	font-size: 0.95em;
	line-height: 1.5;
}

.dtt-box .dtt-box__link a {
	color: var(--dtt-accent);
	text-decoration: underline;
}

.dtt-box__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0.8em 0 0.6em;
}

.dtt-box .dtt-box__option {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 4.5em;
	min-height: 2.6em;
	margin: 0;
	padding: 0.45em 0.9em;
	border: 1px solid var(--dtt-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--dtt-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dtt-box .dtt-box__option:hover,
.dtt-box .dtt-box__option:focus-visible {
	background: color-mix(in srgb, var(--dtt-accent) 12%, #fff);
	color: var(--dtt-accent);
}

.dtt-box .dtt-box__option:focus-visible {
	outline: 2px solid var(--dtt-accent);
	outline-offset: 2px;
}

.dtt-box .dtt-box__option.is-selected {
	background: var(--dtt-accent);
	color: #fff;
}

.dtt-box__option-sub {
	font-size: 0.8em;
	font-weight: 400;
	opacity: 0.85;
}

.dtt-box__custom {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 0.6em;
}

.dtt-box__custom[hidden] {
	display: none;
}

.dtt-box__currency {
	font-weight: 600;
}

.dtt-box .dtt-box__amount {
	width: 8em;
	max-width: 50%;
	margin: 0;
}

.dtt-box .dtt-box__apply {
	margin: 0;
}

.dtt-box__error {
	margin: 0 0 0.6em;
	color: #b32d2e;
	font-size: 0.9em;
}

.dtt-box__error[hidden] {
	display: none;
}

.dtt-box__status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25em 1em;
	margin: 0 0 0.4em;
	font-size: 0.95em;
}

.dtt-box__thanks {
	font-weight: 600;
	color: var(--dtt-accent);
}

.dtt-box .dtt-box__remove {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.9em;
	text-decoration: underline;
	cursor: pointer;
}

.dtt-box__receipt {
	margin: 0.6em 0 0;
	padding-top: 0.6em;
	border-top: 1px solid color-mix(in srgb, var(--dtt-accent) 20%, transparent);
}

.dtt-box__receipt label {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	margin: 0;
	font-weight: 600;
	cursor: pointer;
}

.dtt-box__receipt input {
	margin: 0.25em 0 0;
}

.dtt-box .dtt-box__note {
	margin: 0.4em 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	opacity: 0.8;
}

.dtt-box .dtt-box__note--info {
	white-space: pre-line;
}

/* Block cart / checkout: the box sits in the order summary sidebar. */
.wc-block-components-totals-wrapper .dtt-box,
.wp-block-woocommerce-checkout-order-summary-block .dtt-box {
	margin: 0.5em 0;
	padding: 1em;
}

.wc-block-components-totals-wrapper .dtt-box .dtt-box__amount {
	width: 6em;
	padding: 0.4em 0.5em;
	border: 1px solid currentColor;
	border-radius: 4px;
}
