/**
 * WooCommerce Withdrawal FAB — frontend styles.
 * Self-contained: no external fonts or icon libraries.
 * Scoped under #wcfab-root and lightly hardened against theme overrides.
 */

/* Scoped reset: neutralise the theme text styling that most often bleeds in
 * (custom fonts, forced uppercase, letter-spacing, italics, centering). Kept
 * to typographic normalisation only so per-element sizes/colours below still win. */
#wcfab-root,
#wcfab-root *,
#wcfab-root *::before,
#wcfab-root *::after {
	box-sizing: border-box !important;
	font-family: inherit !important;
	font-style: normal !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-align: left !important;
	float: none !important;
}

/* ---------- Floating button: fixed bottom-left on every screen ----------
 * Visual properties are marked !important and the selector is intentionally
 * specific (id + tag + class) so aggressive theme button styles (which often
 * use !important on .button / button) cannot strip the padding, size, or box.
 */
#wcfab-root button.wcfab-open {
	position: fixed !important;
	left: calc(20px + env(safe-area-inset-left, 0px)) !important;
	bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
	right: auto !important;
	top: auto !important;
	z-index: 9998 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 44px !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 12px 18px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #0f172a !important;
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	cursor: pointer !important;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28) !important;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

/* Neutralise pseudo-content some themes inject into buttons (icon fonts). */
#wcfab-root button.wcfab-open::before,
#wcfab-root button.wcfab-open::after {
	content: none !important;
}

#wcfab-root button.wcfab-open:hover,
#wcfab-root button.wcfab-open:focus-visible {
	background: #1e293b !important;
	transform: translateY(-1px);
	outline: none;
}

#wcfab-root button.wcfab-open:focus-visible {
	box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.35) !important;
}

/* Shortcode inline mode: keep the trigger exactly where shortcode is rendered. */
#wcfab-root.wcfab-root-inline {
	position: static !important;
	display: block !important;
	max-width: 100%;
}

#wcfab-root.wcfab-root-inline button.wcfab-open {
	position: static !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	bottom: auto !important;
	z-index: auto !important;
	width: auto !important;
	height: auto !important;
	min-height: 44px !important;
	padding: 12px 18px !important;
	gap: 8px !important;
	margin: 0 !important;
	display: inline-flex !important;
}

#wcfab-root.wcfab-root-inline .wcfab-open-label {
	position: static !important;
	width: auto !important;
	height: auto !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Inline-SVG "undo / return" icon (crisp at any size, inherits button colour) */
#wcfab-root .wcfab-open-icon {
	flex: 0 0 auto;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
}

#wcfab-root .wcfab-open-icon svg,
#wcfab-root .wcfab-open-icon svg path {
	fill: currentColor !important;
	stroke: none !important;
}

#wcfab-root .wcfab-open-icon svg {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
}

/* ---------- Modal ---------- */
#wcfab-root .wcfab-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
}

#wcfab-root .wcfab-modal[hidden] {
	display: none;
}

#wcfab-root .wcfab-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, 0.65);
}

#wcfab-root .wcfab-dialog {
	position: relative;
	margin: clamp(24px, 8vh, 72px) auto 0;
	width: min(94vw, 640px);
	max-height: 84vh;
	overflow: auto;
	background: #ffffff !important;
	color: #0f172a !important;
	border-radius: 14px;
	padding: 24px;
	padding-top: 56px;
	font-size: 15px !important;
	line-height: 1.5 !important;
	box-shadow: 0 24px 56px rgba(15, 23, 42, 0.34);
}

#wcfab-root button.wcfab-close {
	position: absolute;
	right: 14px;
	top: 12px;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 36px !important;
	height: 36px !important;
	min-height: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: #f8fafc !important;
	color: #0f172a !important;
	font-size: 24px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer !important;
}

#wcfab-root button.wcfab-close::before,
#wcfab-root button.wcfab-close::after {
	content: none !important;
}

#wcfab-root .wcfab-dialog #wcfab-title {
	margin: 0 0 12px !important;
	padding: 0 !important;
	color: #0f172a !important;
	font-size: 24px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
}

/* ---------- Form ---------- */
#wcfab-root .wcfab-form {
	margin-top: 8px;
	display: grid;
	gap: 14px;
}

#wcfab-root .wcfab-row {
	display: grid;
	gap: 6px;
}

#wcfab-root .wcfab-row label,
#wcfab-root .wcfab-gdpr,
#wcfab-root .wcfab-gdpr span,
#wcfab-root .wcfab-withdrawal-type label,
#wcfab-root .wcfab-product-row {
	color: #0f172a !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
}

#wcfab-root .wcfab-gdpr,
#wcfab-root .wcfab-gdpr span,
#wcfab-root .wcfab-withdrawal-type label {
	font-weight: 400 !important;
}

#wcfab-root .wcfab-gdpr a {
	color: #0f172a !important;
	text-decoration: underline !important;
}

/* Honeypot — off-screen */
#wcfab-root .wcfab-hp {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

#wcfab-root .wcfab-form input[type="text"],
#wcfab-root .wcfab-form input[type="email"],
#wcfab-root .wcfab-form textarea {
	width: 100% !important;
	max-width: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	padding: 11px 12px !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: #0f172a !important;
	background: #ffffff !important;
	box-shadow: none !important;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#wcfab-root .wcfab-form textarea {
	min-height: 92px !important;
	resize: vertical;
}

#wcfab-root .wcfab-form input:focus,
#wcfab-root .wcfab-form textarea:focus {
	outline: none;
	border-color: #0f172a;
	box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

#wcfab-root button.wcfab-btn {
	display: inline-block !important;
	width: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 10px !important;
	padding: 11px 16px !important;
	background: #334155 !important;
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-align: center !important;
	text-decoration: none !important;
	box-shadow: none !important;
	cursor: pointer !important;
}

#wcfab-root button.wcfab-btn::before,
#wcfab-root button.wcfab-btn::after {
	content: none !important;
}

#wcfab-root button.wcfab-btn:disabled {
	opacity: 0.7 !important;
	cursor: not-allowed !important;
}

#wcfab-root button.wcfab-btn-primary {
	background: #0f172a !important;
}

#wcfab-root .wcfab-withdrawal-type {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
}

#wcfab-root .wcfab-withdrawal-type label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 6px 8px;
}

#wcfab-root .wcfab-products {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px;
	max-height: 220px;
	overflow: auto;
	display: grid;
	gap: 10px;
}

#wcfab-root .wcfab-product-row {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	align-items: start;
}

#wcfab-root .wcfab-open-label {
	color: #ffffff !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: 600 !important;
	line-height: 1 !important;
}

#wcfab-root .wcfab-product-row strong {
	color: #0f172a !important;
	font-weight: 700 !important;
}

#wcfab-root .wcfab-product-meta {
	color: #475569 !important;
	font-size: 13px !important;
	font-weight: 400 !important;
}

#wcfab-root .wcfab-gdpr {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px;
	align-items: start;
}

#wcfab-root .wcfab-order-results {
	display: grid;
	gap: 14px;
}

#wcfab-root .wcfab-order-results[hidden] {
	display: none;
}

#wcfab-root .wcfab-captcha-row {
	margin-top: 4px;
}

#wcfab-root .wcfab-turnstile {
	min-height: 65px;
}

#wcfab-root .wcfab-message {
	display: none;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	color: #0f172a !important;
}

#wcfab-root .wcfab-message:not(:empty) {
	display: block;
}

#wcfab-root .wcfab-message.is-error {
	color: #b91c1c !important;
	border-color: #fecaca;
	background: #fef2f2;
}

#wcfab-root .wcfab-message.is-success {
	color: #166534 !important;
	border-color: #bbf7d0;
	background: #f0fdf4;
}

/* ---------- Step wrappers, review summary, confirmation ---------- */
#wcfab-root .wcfab-step {
	display: grid;
	gap: 14px;
}

#wcfab-root .wcfab-step[hidden] {
	display: none;
}

#wcfab-root .wcfab-review-title {
	margin: 0 !important;
	padding: 0 !important;
	color: #0f172a !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	outline: none;
}

#wcfab-root .wcfab-summary {
	margin: 0;
	padding: 12px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 14px;
}

#wcfab-root .wcfab-summary dt {
	margin: 0;
	color: #475569 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
}

#wcfab-root .wcfab-summary dd {
	margin: 0;
	color: #0f172a !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	overflow-wrap: anywhere;
}

#wcfab-root .wcfab-summary dt[hidden],
#wcfab-root .wcfab-summary dd[hidden] {
	display: none;
}

#wcfab-root .wcfab-sum-list {
	margin: 0 !important;
	padding: 0 0 0 18px !important;
	list-style: disc !important;
}

#wcfab-root .wcfab-sum-list li {
	margin: 0 0 2px !important;
	color: #0f172a !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
}

#wcfab-root .wcfab-actions {
	display: flex;
	gap: 10px;
	justify-content: space-between;
	flex-wrap: wrap;
}

#wcfab-root button.wcfab-btn-secondary {
	background: #e2e8f0 !important;
	color: #0f172a !important;
}

#wcfab-root .wcfab-confirmation {
	display: grid;
	gap: 8px;
	padding: 14px;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	background: #f0fdf4;
}

#wcfab-root .wcfab-confirmation[hidden] {
	display: none;
}

#wcfab-root .wcfab-confirmation-title {
	margin: 0 !important;
	padding: 0 !important;
	color: #166534 !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
}

#wcfab-root .wcfab-confirmation p {
	margin: 0 !important;
	color: #0f172a !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
}

/* Tablets / small screens: smaller pill */
@media (max-width: 768px) {
	#wcfab-root button.wcfab-open {
		left: calc(14px + env(safe-area-inset-left, 0px)) !important;
		bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
		gap: 6px !important;
		padding: 10px 14px !important;
		font-size: 13px !important;
	}

	#wcfab-root .wcfab-dialog {
		margin-top: 4vh;
		width: 96vw;
		max-height: 90vh;
		padding: 16px;
		padding-top: 50px;
	}

	#wcfab-root .wcfab-withdrawal-type label {
		width: 100%;
	}

	#wcfab-root .wcfab-form button.wcfab-btn {
		width: 100% !important;
	}

	#wcfab-root .wcfab-actions {
		flex-direction: column;
	}
}

/* Phones: collapse to a compact round icon button to save space */
@media (max-width: 480px) {
	#wcfab-root button.wcfab-open {
		left: calc(12px + env(safe-area-inset-left, 0px)) !important;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
		width: 48px !important;
		height: 48px !important;
		min-height: 48px !important;
		padding: 0 !important;
		gap: 0 !important;
		border-radius: 999px !important;
	}

	#wcfab-root .wcfab-open-label {
		/* Hidden visually; the button keeps its aria-label for screen readers. */
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	#wcfab-root .wcfab-open-icon {
		width: 22px;
		height: 22px;
	}

	#wcfab-root .wcfab-open-icon svg {
		width: 22px !important;
		height: 22px !important;
	}
}
