/**
 * WooCommerce Withdrawal Button — front-end styles.
 * Scoped under .wcwb- prefixes so they don't leak into the theme.
 */

/* Trigger button (inherits theme button styling but with sane defaults). */
.wcwb-widget { margin: 0; }
.wcwb-align-center { text-align: center; }
.wcwb-align-right { text-align: right; }
.wcwb-align-left { text-align: left; }

.wcwb-trigger {
	cursor: pointer;
}

/* Generic buttons used inside panels. */
.wcwb-btn {
	display: inline-block;
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 4px;
	padding: 10px 18px;
	font-size: 1em;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .15s ease, opacity .15s ease;
}
.wcwb-btn--small { padding: 6px 12px; font-size: .9em; }
.wcwb-btn--primary { background: #2b6cb0; color: #fff; }
.wcwb-btn--primary:hover { background: #245a93; color: #fff; }
.wcwb-btn--secondary { background: #edf2f7; color: #1a202c; }
.wcwb-btn--secondary:hover { background: #e2e8f0; }
.wcwb-btn--danger { background: #c53030; color: #fff; }
.wcwb-btn--danger:hover { background: #9b2c2c; color: #fff; }
.wcwb-btn:disabled { opacity: .6; cursor: default; }

/* Modal. */
.wcwb-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px;
	overflow-y: auto;
}
.wcwb-modal[hidden] { display: none; }
.wcwb-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}
.wcwb-modal__box {
	position: relative;
	z-index: 1;
	background: #fff;
	color: #1a202c;
	width: 100%;
	max-width: 560px;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	padding: 28px;
	margin: auto 0;
}
.wcwb-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #718096;
}
.wcwb-modal__close:hover { color: #1a202c; }
body.wcwb-modal-open { overflow: hidden; }

/* Panels. */
.wcwb-panel__title { margin: 0 0 .5em; font-size: 1.35em; }
.wcwb-panel__text { margin: 0 0 1.25em; }
.wcwb-panel__intro { margin: 0 0 1.25em; }

.wcwb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 1.25em;
}

/* Form fields. */
.wcwb-field { margin: 0 0 1em; }
.wcwb-field label,
.wcwb-field__label {
	display: block;
	font-weight: 600;
	margin-bottom: .35em;
}
.wcwb-field input[type="text"],
.wcwb-field input[type="email"],
.wcwb-field select,
.wcwb-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #cbd5e0;
	border-radius: 4px;
	font-size: 1em;
}
.wcwb-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	margin: .25em 0;
}
.wcwb-checkbox input { width: auto; }

.wcwb-form__feedback { margin: .5em 0; min-height: 1em; }
.wcwb-form__feedback.is-error { color: #c53030; font-weight: 600; }

/* Orders table. */
.wcwb-orders-table,
.wcwb-order-items {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1em;
}
.wcwb-orders-table th,
.wcwb-orders-table td,
.wcwb-order-items th,
.wcwb-order-items td {
	text-align: left;
	padding: 10px 8px;
	border-bottom: 1px solid #e2e8f0;
}
.wcwb-orders-table th { font-weight: 600; }
.wcwb-col-actions { text-align: right; }
.wcwb-muted { color: #a0aec0; }

/* Messages. */
.wcwb-panel--message .wcwb-message__text { margin: 0; font-size: 1.05em; }
.wcwb-message--success { color: #22683b; }
.wcwb-message--error { color: #c53030; }

/* Loading. */
.wcwb-loading { text-align: center; padding: 1em 0; }
.wcwb-spinner {
	display: inline-block;
	width: 28px;
	height: 28px;
	border: 3px solid #cbd5e0;
	border-top-color: #2b6cb0;
	border-radius: 50%;
	animation: wcwb-spin .8s linear infinite;
}
@keyframes wcwb-spin { to { transform: rotate(360deg); } }

/* Inline confirmation. */
.wcwb-inline-confirm {
	color: #c53030;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}
.wcwb-inline-confirm.is-loading { opacity: .6; pointer-events: none; }
.wcwb-inline-success { color: #22683b; font-weight: 600; }
.wcwb-inline-error { color: #c53030; }

/* Responsive: stack order table on small screens. */
@media (max-width: 600px) {
	.wcwb-modal__box { padding: 20px; }
	.wcwb-orders-table thead { display: none; }
	.wcwb-orders-table tr {
		display: block;
		border: 1px solid #e2e8f0;
		border-radius: 6px;
		margin-bottom: 10px;
		padding: 6px 10px;
	}
	.wcwb-orders-table td {
		display: flex;
		justify-content: space-between;
		border: 0;
		padding: 6px 0;
	}
	.wcwb-orders-table td::before {
		content: attr(data-label);
		font-weight: 600;
		margin-right: 12px;
	}
	.wcwb-col-actions { text-align: left; }
	.wcwb-col-actions::before { content: ""; }
}

/* Progressive enhancement: the no-JS fallback form is hidden when JS is
   available (the widget's <noscript> block reveals it otherwise). */
.wcwb-fallback { display: none; }

/* No-JS / inline contexts (fallback form, [woocommerce_withdrawal_form] shortcode,
   and the two-step review/success screens) get a proper, constrained card so the
   inputs aren't full page width and don't inherit the button's centering. These
   rules are scoped to the inline contexts only — the modal version is untouched. */
.wcwb-fallback,
.wcwb-standalone-form,
.wcwb-widget--active {
	text-align: left;
}
.wcwb-fallback .wcwb-panel,
.wcwb-standalone-form .wcwb-panel,
.wcwb-widget--active .wcwb-panel {
	max-width: 600px;
	margin: 1.5em auto;
	padding: 28px 30px;
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
	text-align: left;
	box-sizing: border-box;
}
.wcwb-fallback .wcwb-panel__title,
.wcwb-standalone-form .wcwb-panel__title,
.wcwb-widget--active .wcwb-panel__title {
	margin-top: 0;
}
/* Keep the two checkbox rows tidy in the inline form. */
.wcwb-fallback .wcwb-field--checkbox label,
.wcwb-standalone-form .wcwb-field--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
}

/* Honeypot — visually and programmatically removed from the flow. */
.wcwb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wcwb-field--checkbox { margin-top: 1em; }

/* Review (confirmation) table. */
.wcwb-review-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1em;
}
.wcwb-review-table th,
.wcwb-review-table td {
	text-align: left;
	vertical-align: top;
	padding: 8px;
	border-bottom: 1px solid #e2e8f0;
}
.wcwb-review-table th { width: 38%; font-weight: 600; }

/* Article 16 product-page exclusion notice. */
.wcwb-excluded-notice {
	border: 1px solid #f0c36d;
	background: #fff8e6;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 1em 0;
}
.wcwb-excluded-notice__title { margin: 0 0 .25em; }
.wcwb-excluded-notice__body { margin: 0; }

/* Checkout consent rows. */
.wcwb-checkout-consents { margin: 1em 0; }
.wcwb-checkout-consent { margin: 0 0 .75em; }
.wcwb-checkout-consent__text { display: inline; }
