/**
 * Tips & Donations for EDD – Frontend Styles
 */

.dpe-donation-selector {
	margin: 1.25em 0;
	padding: 1.25em;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #f8fafc;
	max-width: 420px;
}

.dpe-donation-selector .dpe-label {
	margin: 0 0 0.6em;
	font-size: 0.95em;
	color: #334155;
}

.dpe-donation-selector .dpe-label-custom {
	margin-top: 1.1em;
}

/* Amount buttons */
.dpe-amount-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75em;
}

.dpe-amount-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 4.5rem;
	padding: 0.55em 0.9em;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.2;
	color: #1e293b;
	background: #fff;
	border: 2px solid #cbd5e1;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.15s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dpe-amount-btn:hover,
.dpe-amount-btn:focus {
	border-color: #3b82f6;
	color: #1d4ed8;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dpe-amount-btn.dpe-selected,
.dpe-amount-btn[aria-pressed="true"] {
	background: #3b82f6;
	border-color: #3b82f6;
	color: #fff;
	box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.dpe-amount-btn.dpe-selected:hover {
	background: #2563eb;
	border-color: #2563eb;
}

/* Custom amount input */
.dpe-custom-amount-wrap {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 1em;
	max-width: 180px;
}

.dpe-currency-symbol {
	font-weight: 600;
	color: #475569;
	font-size: 1.05em;
}

.dpe-custom-amount {
	flex: 1;
	width: 100%;
	padding: 0.55em 0.75em;
	font-size: 1em;
	border: 2px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dpe-custom-amount:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Selected amount display */
.dpe-selected-display {
	margin-top: 0.75em;
	padding-top: 0.75em;
	border-top: 1px solid #e2e8f0;
	font-size: 1.05em;
}

.dpe-selected-label {
	color: #64748b;
	margin-right: 0.35em;
}

.dpe-selected-amount {
	color: #0f172a;
	font-size: 1.15em;
}

/* Error message */
.dpe-error-message {
	margin-top: 0.75em;
	padding: 0.6em 0.85em;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 6px;
	color: #b91c1c;
	font-size: 0.9em;
}

/* Responsive */
@media (max-width: 480px) {
	.dpe-donation-selector {
		padding: 1em;
	}

	.dpe-amount-btn {
		min-width: 3.8rem;
		padding: 0.5em 0.7em;
		font-size: 0.9em;
	}
}

/* Make sure it plays nicely inside EDD purchase forms */
.edd_download_purchase_form .dpe-donation-selector {
	margin-bottom: 1em;
}

/* Donate product forms: clean up button labels / hide duplicate checkout CTAs */
.dpe-donate-form .edd-add-to-cart,
.dpe-donate-form .edd_purchase_submit_wrapper .button,
.edd_download_purchase_form.dpe-donate-form input[type="submit"],
.edd_download_purchase_form.dpe-donate-form button.edd-add-to-cart {
	/* Keep the primary Donate CTA visible; themes may inject extra checkout links */
}

/* Hide common secondary "Checkout" / "View Cart" style buttons that some themes add next to purchase */
.edd_download_purchase_form.dpe-donate-form + .edd_go_to_checkout,
.dpe-donate-form .edd_go_to_checkout,
.single-download .dpe-donation-selector ~ .edd_go_to_checkout,
body.single-download .entry-content > a.edd_go_to_checkout {
	display: none !important;
}
