/* UDW Tip — frontend.
 * Uses neutral colors and inherits typography from the active theme so
 * it blends in. The pill row is flexbox so it wraps cleanly on mobile.
 * No !important — themes can override. */

.udw-tip {
	margin: 0;
	padding: 14px 0;
	font-size: 14px;
	color: inherit;
}

.udw-tip-row > td {
	padding: 0 !important; /* WC table cell padding would double up the spacing */
}

.udw-tip-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.udw-tip-desc {
	font-size: 12px;
	opacity: 0.7;
	margin-bottom: 10px;
}

.udw-tip-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.udw-tip-pill {
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	padding: 6px 12px;
	border-radius: 999px;
	font: inherit;
	font-size: 13px;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
	min-width: 52px;
	text-align: center;
}

.udw-tip-pill:hover:not(.is-active) {
	background: rgba(0, 0, 0, 0.06);
}

.udw-tip-pill.is-active {
	background: currentColor;
	color: #fff;
}

.udw-tip-pill.is-active::before {
	content: "✓ ";
	color: #fff;
	margin-right: 2px;
}

.udw-tip-pill:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.udw-tip-custom {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	max-width: 220px;
}

.udw-tip-prefix {
	font-size: 14px;
	color: inherit;
	opacity: 0.8;
}

.udw-tip-amount {
	flex: 1;
	padding: 6px 8px;
	font: inherit;
	font-size: 14px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 4px;
	background: #fff;
	color: #222;
	min-width: 0;
}

.udw-tip-amount:focus {
	outline: none;
	border-color: currentColor;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.udw-tip-status {
	font-size: 12px;
	min-height: 16px;
	margin-top: 6px;
	color: inherit;
}

.udw-tip-status[data-kind="error"] { color: #b00020; }
.udw-tip-status[data-kind="pending"] { opacity: 0.6; font-style: italic; }

@media (prefers-color-scheme: dark) {
	.udw-tip-amount { background: #fff; color: #222; }
	.udw-tip-pill:hover:not(.is-active) { background: rgba(255,255,255,0.08); }
}

/* Cart-page variant: WC's `cart_totals` block is a div, not a table row, so
 * we strip the row spacing when used outside a table context. */
.cart_totals + .udw-tip,
.woocommerce-cart .udw-tip {
	padding: 14px 0;
}

/* Block checkout variant: the React Order Summary panel uses its own
 * vertical rhythm (1em borders between rows), so we mirror that and
 * inherit its font-size. The mount lives inside .wc-block-components-...
 * containers, so currentColor pulls from the block's text color. */
.udw-tip-block {
	padding: 16px 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.wp-block-woocommerce-checkout .udw-tip-block,
.wp-block-woocommerce-cart .udw-tip-block {
	margin: 0;
	font-size: 0.875em;
}
