/**
 * Advance Payment for WooCommerce — Cart & Checkout styling.
 *
 * NOTE: This file is also duplicated as an inline <style> block printed
 * directly next to the widget markup (see Advpay_Checkout_Logic::print_styles()
 * in class-advpay-checkout-logic.php) — that inline copy is what actually
 * guarantees the look on every site. This external file is the source of
 * truth / kept in sync for reference, and still covers the My Account
 * order-view breakdown table, which isn't part of the checkout widgets.
 *
 * Everything is scoped under the #advpay-scope / #advpay-policy-scope IDs
 * (not just classes) on purpose: an ID selector outranks virtually any
 * class-based selector a host theme might use on its own wrapping
 * elements, so this survives being nested inside a theme's styled
 * container without losing CSS specificity fights. Plain hex colors are
 * used throughout (no CSS custom properties / var()) so nothing here can
 * be silently wiped out by a broad `all: initial/unset` reset elsewhere
 * in the cascade if declared in the wrong order.
 */

#advpay-scope {
	all: initial !important;
	display: block !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
	border: 1px solid #ececec !important;
	border-radius: 10px !important;
	padding: 16px !important;
	margin: 16px 0 !important;
	background: #fff !important;
	width: 100% !important;
}

#advpay-scope * {
	all: unset !important;
	display: revert !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
}

/* ---------- Header ---------- */

#advpay-scope .advpay-choice-header {
	display: block !important;
	margin: 0 0 14px !important;
}

#advpay-scope .advpay-choice-header strong {
	display: block !important;
	font-size: 15px !important;
	line-height: 1.3 !important;
	font-weight: 700 !important;
	color: #171717 !important;
	margin: 0 0 3px !important;
}

#advpay-scope .advpay-choice-subtitle {
	display: block !important;
	color: #8a8a8a !important;
	font-size: 12.5px !important;
	line-height: 1.4 !important;
}

/* ---------- Option cards ---------- */

#advpay-scope .advpay-choice-card {
	display: block !important;
	border: 1.5px solid #e6e6e6 !important;
	border-radius: 10px !important;
	padding: 14px 16px !important;
	margin: 0 0 10px 0 !important;
	cursor: pointer !important;
	background: #fff !important;
	transition: border-color 0.15s ease, background-color 0.15s ease !important;
}

#advpay-scope .advpay-choice-card:last-child {
	margin-bottom: 0 !important;
}

#advpay-scope .advpay-choice-card.is-selected {
	border-color: #f0a202 !important;
	background: #fdf6e8 !important;
}

#advpay-scope .advpay-choice-card-top {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ---------- Custom radio (ring + dot, theme-proof) ---------- */

#advpay-scope .advpay-choice-radio {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 18px !important;
	height: 18px !important;
	flex: 0 0 18px !important;
	margin: 0 !important;
	padding: 0 !important;
}

#advpay-scope .advpay-choice-radio input[type="radio"] {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 2px solid #cfcfcf !important;
	border-radius: 50% !important;
	background-color: #fff !important;
	cursor: pointer !important;
	position: relative !important;
	flex-shrink: 0 !important;
	box-shadow: none !important;
	outline: none !important;
}

#advpay-scope .advpay-choice-card.is-selected .advpay-choice-radio input[type="radio"] {
	border-color: #f0a202 !important;
}

#advpay-scope .advpay-choice-radio input[type="radio"]:checked::after {
	content: "" !important;
	display: block !important;
	position: absolute !important;
	top: 3px !important;
	left: 3px !important;
	width: 8px !important;
	height: 8px !important;
	border-radius: 50% !important;
	background: #f0a202 !important;
}

/* ---------- Labels / amounts ---------- */

#advpay-scope .advpay-choice-label {
	flex: 1 1 auto !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	line-height: 1.35 !important;
	color: #171717 !important;
	margin: 0 !important;
}

#advpay-scope .advpay-choice-amount {
	flex: 0 0 auto !important;
	font-weight: 700 !important;
	font-size: 14px !important;
	color: #171717 !important;
	margin: 0 !important;
	white-space: nowrap !important;
}

#advpay-scope .advpay-choice-card.is-selected .advpay-choice-amount {
	color: #f0a202 !important;
}

#advpay-scope .advpay-choice-sub {
	display: block !important;
	margin: 4px 0 10px 28px !important;
	color: #8a8a8a !important;
	font-size: 12px !important;
	line-height: 1.45 !important;
}

/* ---------- Per-option breakdown ---------- */

#advpay-scope .advpay-choice-breakdown {
	display: block !important;
	margin: 0 0 0 28px !important;
	padding: 8px 0 0 0 !important;
	border-top: 1px dashed #e6e6e6 !important;
}

#advpay-scope .advpay-choice-row {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
	font-size: 12.5px !important;
	color: #7d7d7d !important;
	padding: 3px 0 !important;
	margin: 0 !important;
}

#advpay-scope .advpay-choice-row span {
	font-size: inherit !important;
	color: inherit !important;
	font-weight: inherit !important;
}

#advpay-scope .advpay-choice-row-total {
	font-weight: 700 !important;
	color: #333 !important;
	border-top: 1px solid #eee !important;
	margin-top: 4px !important;
	padding-top: 6px !important;
}

#advpay-scope .advpay-choice-card.is-selected .advpay-choice-row-total span:last-child {
	color: #f0a202 !important;
}

#advpay-scope .advpay-choice-row strong {
	font-weight: 700 !important;
	color: inherit !important;
}

#advpay-scope .advpay-notice {
	display: block !important;
	background: #fff8e5 !important;
	border: 1px solid #f0c33c !important;
	border-radius: 6px !important;
	padding: 10px 14px !important;
	margin: 10px 0 0 0 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: #5c4a00 !important;
}

/* ---------- Refund policy notice (separate scope, own hook location) ---------- */

#advpay-policy-scope {
	all: initial !important;
	display: block !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
}

#advpay-policy-scope * {
	all: unset !important;
	display: revert !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
}

#advpay-policy-scope .advpay-no-refund-notice {
	display: block !important;
	background: #fdecea !important;
	border: 1px solid #f5b1ab !important;
	border-radius: 6px !important;
	padding: 10px 14px !important;
	margin: 10px 0 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: #7a1f16 !important;
}

#advpay-policy-scope .advpay-refund-policy {
	display: block !important;
	background: #f4f4f4 !important;
	border-radius: 6px !important;
	padding: 10px 14px !important;
	margin: 10px 0 16px 0 !important;
	font-size: 12.5px !important;
	line-height: 1.6 !important;
	color: #666 !important;
}

#advpay-policy-scope .advpay-refund-policy p {
	display: block !important;
	margin: 0 0 6px 0 !important;
	padding: 0 !important;
}

/* ---------- My Account order-view breakdown table (separate context) ---------- */

.advpay-account-breakdown th {
	text-align: left;
}

@media (max-width: 480px) {
	#advpay-scope .advpay-choice-row {
		font-size: 12px !important;
	}
	#advpay-scope .advpay-choice-label,
	#advpay-scope .advpay-choice-amount {
		font-size: 13px !important;
	}
}
