/**
 * Recesso Facile per WooCommerce — stili frontend.
 * Le variabili --rfw-primary / --rfw-text sono iniettate dinamicamente dalle impostazioni.
 */

:root {
	--rfw-primary: #1e73be;
	--rfw-text: #ffffff;
	--rfw-radius: 8px;
	--rfw-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

/* ---------- Trigger generici ---------- */
.rfw-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font: inherit;
	cursor: pointer;
	border: none;
	background: none;
}

.rfw-trigger-icon {
	flex: 0 0 auto;
}

.rfw-trigger-button {
	background: var(--rfw-primary);
	color: var(--rfw-text);
	padding: 10px 18px;
	border-radius: var(--rfw-radius);
	font-weight: 600;
	transition: filter 0.15s ease;
}

.rfw-trigger-button:hover {
	filter: brightness(0.92);
}

.rfw-trigger-link {
	color: var(--rfw-primary);
	text-decoration: underline;
	padding: 4px 0;
}

/* ---------- Footer link (legacy / shortcode) ---------- */
.rfw-footer-link-wrap {
	text-align: center;
	padding: 16px;
	font-size: 14px;
}

/* ---------- Voce di menu ---------- */
.rfw-menu-item .rfw-menu-icon {
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
	margin-right: 6px;
}

/* ---------- Widget flottante ---------- */
.rfw-float {
	position: fixed;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--rfw-primary);
	color: var(--rfw-text);
	padding: 12px 18px;
	border-radius: 999px;
	box-shadow: var(--rfw-shadow);
	cursor: pointer;
	font-weight: 600;
	font-size: 15px;
	border: none;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.rfw-float:hover {
	transform: translateY(-2px);
	filter: brightness(0.95);
}

.rfw-float:focus-visible {
	outline: 3px solid rgba(0, 0, 0, 0.35);
	outline-offset: 2px;
}

.rfw-float-icon {
	color: var(--rfw-text);
}

/* ---------- Box conferma ordine / banner ---------- */
.rfw-thankyou-box,
.rfw-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 20px;
	margin: 20px 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-left: 4px solid var(--rfw-primary);
	border-radius: var(--rfw-radius);
	background: rgba(0, 0, 0, 0.02);
}

.rfw-thankyou-icon,
.rfw-banner-icon {
	flex: 0 0 auto;
	color: var(--rfw-primary);
}

.rfw-thankyou-content,
.rfw-banner-text {
	flex: 1 1 auto;
	margin: 0;
}

.rfw-thankyou-text {
	margin: 0 0 10px;
}

.rfw-banner {
	flex-wrap: wrap;
}

/* ---------- Modale ---------- */
body.rfw-modal-open {
	overflow: hidden;
}

.rfw-modal[hidden] {
	display: none;
}

.rfw-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 16px;
	overflow-y: auto;
}

.rfw-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.rfw-modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	background: #fff;
	color: #222;
	border-radius: 12px;
	box-shadow: var(--rfw-shadow);
	padding: 28px;
	animation: rfw-pop 0.18s ease;
}

@keyframes rfw-pop {
	from { transform: translateY(12px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.rfw-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	font-size: 28px;
	line-height: 1;
	background: none;
	border: none;
	cursor: pointer;
	color: #777;
}

.rfw-modal-close:hover {
	color: #222;
}

.rfw-modal-title {
	margin: 0 0 8px;
	font-size: 22px;
}

.rfw-modal-intro {
	margin: 0 0 18px;
	color: #555;
	font-size: 15px;
}

/* ---------- Form ---------- */
.rfw-form .rfw-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.rfw-form .rfw-row > .rfw-field {
	flex: 1 1 200px;
}

.rfw-field {
	margin: 0 0 14px;
}

.rfw-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	font-size: 14px;
}

.rfw-field input[type="text"],
.rfw-field input[type="email"],
.rfw-field input[type="date"],
.rfw-field select,
.rfw-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: var(--rfw-radius);
	font: inherit;
}

.rfw-field input:focus,
.rfw-field select:focus,
.rfw-field textarea:focus {
	border-color: var(--rfw-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.15);
}

.rfw-req {
	color: #d63638;
}

.rfw-checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
}

.rfw-checkbox input {
	margin-top: 3px;
}

.rfw-declaration {
	background: rgba(30, 115, 190, 0.06);
	border-radius: var(--rfw-radius);
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 14px;
}

.rfw-declaration p {
	margin: 0 0 6px;
}

.rfw-terms-note {
	font-size: 13px;
	color: #666;
}

.rfw-eligibility {
	font-size: 14px;
	margin: -4px 0 12px;
}

.rfw-eligibility.is-ok {
	color: #207b3d;
}

.rfw-eligibility.is-warn {
	color: #9a5b00;
}

.rfw-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0;
	overflow: hidden;
}

/* ---------- Ricerca ordine + prodotti ---------- */
.rfw-load-order-field {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
}

.rfw-load-order {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	color: var(--rfw-primary);
	border: 1px solid var(--rfw-primary);
	border-radius: var(--rfw-radius);
	padding: 9px 16px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.rfw-load-order:hover {
	background: var(--rfw-primary);
	color: var(--rfw-text);
}

.rfw-load-order[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.rfw-load-hint {
	font-size: 13px;
	color: #666;
	flex: 1 1 220px;
}

.rfw-spinner-dark {
	border-color: rgba(0, 0, 0, 0.2);
	border-top-color: var(--rfw-primary);
}

.rfw-load-order.is-loading .rfw-spinner-dark {
	display: inline-block;
}

.rfw-order-items {
	margin: 0 0 14px;
}

.rfw-products-title {
	font-weight: 600;
	margin: 0 0 8px;
	font-size: 14px;
}

.rfw-products-list {
	border: 1px solid #e3e3e3;
	border-radius: var(--rfw-radius);
	overflow: hidden;
}

.rfw-product-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid #eee;
}

.rfw-product-row:last-child {
	border-bottom: none;
}

.rfw-product-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	margin: 0;
	flex: 1 1 auto;
}

.rfw-product-qty {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	color: #666;
	font-size: 13px;
}

.rfw-product-qty input {
	width: 64px;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font: inherit;
}

.rfw-products-loading,
.rfw-products-error,
.rfw-products-empty {
	font-size: 14px;
	margin: 0;
	padding: 8px 0;
}

.rfw-products-error {
	color: #a4282a;
}

.rfw-products-loading {
	color: #555;
}

/* ---------- Azioni / submit ---------- */
.rfw-actions {
	margin: 8px 0 0;
}

.rfw-submit {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--rfw-primary);
	color: var(--rfw-text);
	border: none;
	border-radius: var(--rfw-radius);
	padding: 12px 22px;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.rfw-submit:hover {
	filter: brightness(0.92);
}

.rfw-submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.rfw-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: var(--rfw-text);
	border-radius: 50%;
	display: none;
	animation: rfw-spin 0.7s linear infinite;
}

.rfw-form.is-sending .rfw-spinner {
	display: inline-block;
}

@keyframes rfw-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Feedback / errori ---------- */
.rfw-form-feedback {
	display: none;
	padding: 10px 12px;
	border-radius: var(--rfw-radius);
	margin-bottom: 12px;
	font-size: 14px;
}

.rfw-form-feedback.is-error {
	display: block;
	background: #fcebea;
	color: #a4282a;
	border: 1px solid #f3bfbf;
}

/* ---------- Stato successo modale ---------- */
.rfw-modal-success {
	text-align: center;
	padding: 20px 0;
}

.rfw-success-icon {
	width: 64px;
	height: 64px;
	line-height: 64px;
	border-radius: 50%;
	background: #207b3d;
	color: #fff;
	font-size: 34px;
	margin: 0 auto 16px;
}

.rfw-success-text {
	font-size: 16px;
}

.rfw-success-meta {
	font-size: 13px;
	color: #666;
	margin-top: 8px;
}

/* ---------- Inline form (shortcode/account) ---------- */
.rfw-inline-form-wrap {
	max-width: 640px;
}

@media (max-width: 600px) {
	.rfw-float-label {
		display: none;
	}

	.rfw-float {
		padding: 14px;
	}

	.rfw-modal-dialog {
		padding: 20px;
	}
}
