.xb-block-checkout {
	background: #fff;
	border-radius: 12px;
	margin: 8px 4px; /* Slight margin for near full width on mobile */
	border: 1px solid var(--xb-brand-color, #007953);
	padding: 10px;
}
.xb-cta-section {
	width: 100%;
	padding: 16px 10px;
}
.xb-input-group {
	display: flex;
	border: 1px solid #eaeaea;
	border-radius: 8px;
	margin-bottom: 10px;
	overflow: hidden;
	background: #fff;
	transition: border-color 0.15s ease;
}
.xb-input-group:hover,
.xb-input-group:focus-within {
	border-color: var(--xb-brand-color, #007953);
}
.xb-icon-box {
	width: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f9f9f9;
	border-right: 1px solid #eaeaea;
}
[dir="rtl"] .xb-icon-box {
	border-right: none;
	border-left: 1px solid #eaeaea;
}
.xb-input-group input {
	flex: 1;
	padding: 12px 15px;
	border: none;
	outline: none;
	font-size: 16px; /* Prevents iOS Safari auto-zoom */
	background: #fff;
	color: #333;
	box-shadow: none; /* WP reset */
}
[dir="rtl"] .xb-input-group input {
	text-align: right;
}
[dir="rtl"] .xb-input-group input[type="tel"] {
	text-align: right;
	direction: ltr; /* Keeps the phone number digits LTR while aligning right */
}
.xb-input-group input:focus {
	box-shadow: none;
	border: none;
}
.xb-field-error {
	border-color: #e53e3e !important;
	background-color: #fff5f5 !important;
	animation: xb-shake 0.4s ease-in-out;
}
@keyframes xb-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}
.xb-summary {
	background: #f9fafa;
	border: 1px solid #eaeaea;
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 15px;
}
.xb-summary-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font-size: 13px;
	color: #555;
}
.xb-summary-total {
	display: flex;
	justify-content: space-between;
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eaeaea;
	font-size: 16px;
	font-weight: 700;
	color: #000;
}
.xb-summary-total span:last-child {
	color: #007953;
}
.xb-submit-btn {
	width: 100%;
	padding: 12px;
	background: #007953;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	transition: transform 0.15s ease;
}
.xb-submit-btn:hover {
	transform: translateY(-1px);
}
.xb-submit-btn:active {
	transform: translateY(0);
}
.xb-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	animation: none;
	transform: none;
}
@keyframes xb-btn-pulse {
	0%,
	82%,
	100% {
		transform: translateX(0);
	}
	85% {
		transform: translateX(-4px);
	}
	88% {
		transform: translateX(4px);
	}
	91% {
		transform: translateX(-3px);
	}
	94% {
		transform: translateX(3px);
	}
	97% {
		transform: translateX(-1px);
	}
}
.xb-btn-spinner {
	display: none;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: xb-btn-spin 0.7s linear infinite;
}
@keyframes xb-btn-spin {
	to {
		transform: rotate(360deg);
	}
}
.xb-submit-btn.loading .xb-btn-spinner {
	display: block;
}
.xb-submit-btn.loading .xb-btn-icon {
	display: none;
}
.xb-btn-text-wrap {
	text-align: left;
}
.xb-btn-title {
	font-size: 15px;
	font-weight: 700;
}
.xb-btn-subtitle {
	font-size: 11px;
	font-weight: 400;
	opacity: 0.9;
}
.xb-error-msg {
	color: #e63946;
	font-size: 13px;
	margin-top: -5px;
	margin-bottom: 10px;
	display: none;
}

/* Quantity Offers */
.xb-offers-card {
	margin-bottom: 12px;
}
.xb-offers-list.xb-offers-classic {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.xb-offer-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}
.xb-offer-row:hover {
	border-color: var(--xb-brand-color, #007953);
}
.xb-offer-row.selected {
	border-color: var(--xb-brand-color, #007953);
	background-color: var(--xb-brand-color-bg, rgba(0, 121, 83, 0.05));
}
.xb-offer-radio {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}
.xb-offer-badge {
	position: absolute;
	top: -10px;
	right: 10px;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 999px;
	white-space: nowrap;
}
.xb-offer-image {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	overflow: hidden;
	background: #f4f4f4;
}
.xb-offer-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.xb-offer-text {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}
.xb-offer-subtitle {
	font-size: 10px;
	color: #888;
}
.xb-offer-label {
	font-size: 12px;
	font-weight: 700;
	color: #222;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.xb-offer-price {
	flex: 0 0 auto;
	text-align: right;
}
.xb-offer-price-current {
	display: block;
	font-size: 14px;
	font-weight: 700;
}
.xb-offer-price-compare {
	display: block;
	font-size: 10px;
	color: #999;
	text-decoration: line-through;
}
.xb-offers-list.xb-offers-vertical {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.xb-offers-vertical .xb-offer-row {
	flex-direction: column;
	text-align: center;
	padding: 8px 6px;
	gap: 4px;
}
.xb-offers-vertical .xb-offer-image {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
}
.xb-offers-vertical .xb-offer-label {
	white-space: normal;
	line-height: 1.2;
}
.xb-offers-vertical .xb-offer-text {
	align-items: center;
}
.xb-offers-vertical .xb-offer-price {
	text-align: center;
}

/* Variation Attributes */
.xb-attr-group {
	margin-bottom: 12px;
}
.xb-attr-label {
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin-bottom: 8px;
}
.xb-attr-selected-value {
	font-weight: 700;
	color: var(--xb-brand-color, #007953);
}
.xb-attr-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.xb-attr-option {
	position: relative;
	border: 2px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.xb-attr-option.active {
	border-color: var(--xb-brand-color, #007953);
}
.xb-attr-option.has-color,
.xb-attr-option.has-image {
	width: 36px !important;
	height: 36px !important;
	flex: 0 0 36px;
	border-radius: 8px;
	overflow: hidden;
	padding: 0;
}
.xb-attr-swatch-color,
.xb-attr-swatch-image {
	display: block;
	width: 100%;
	height: 100%;
}
/* !important guards against WordPress core adding its own width/height/
   aspect-ratio to the <img> (wp_get_attachment_image() sets HTML width/
   height attributes, and some WP versions add an inline aspect-ratio style
   for layout-shift prevention) — without it the swatch stretches into the
   source photo's own aspect ratio instead of staying a fixed 48x48 square. */
.xb-attr-swatch-image img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	aspect-ratio: auto !important;
	object-fit: cover !important;
	display: block;
}
.xb-attr-option.has-text {
	min-width: 40px;
	padding: 8px 14px;
}
.xb-attr-swatch-text {
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

/* Floating CTA */
.xb-floating-cta-wrap {
	position: fixed;
	left: 50%;
	bottom: max(16px, env(safe-area-inset-bottom, 0px));
	transform: translate(-50%, 6px);
	width: auto;
	max-width: calc(100% - 32px);
	z-index: 9998;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.xb-floating-cta-wrap.visible {
	opacity: 1;
	transform: translate(-50%, 0);
	pointer-events: auto;
}
.xb-floating-cta {
	width: auto;
	max-width: 100%;
	padding: 8px 16px;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	color: #fff;
	font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	animation: xb-btn-pulse 3s ease-in-out infinite;
}
.xb-floating-cta .xb-btn-text-wrap {
	overflow: hidden;
}
.xb-floating-cta .xb-btn-title {
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.xb-floating-cta .xb-btn-subtitle {
	display: none;
}
.xb-floating-cta svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

/* Button Animations (5s active, 3s paused = 8s total) */
.xb-submit-btn.xb-anim-pulse {
	animation: xb-btn-pulse 8s infinite;
}
.xb-submit-btn.xb-anim-bounce {
	animation: xb-btn-bounce 8s infinite;
}
.xb-submit-btn.xb-anim-shake {
	animation: xb-btn-shake 8s infinite;
}
.xb-submit-btn.xb-anim-tada {
	animation: xb-btn-tada 8s infinite;
}
.xb-submit-btn.xb-anim-heartbeat {
	animation: xb-btn-heartbeat 8s infinite;
}
.xb-submit-btn.xb-anim-flash {
	animation: xb-btn-flash 8s infinite;
}

@keyframes xb-btn-pulse {
	0%, 62.5%, 100% { transform: scale(1); }
	31.25% { transform: scale(1.03); }
}
@keyframes xb-btn-bounce {
	0%, 12.5%, 31.25%, 50%, 62.5%, 100% { transform: translateY(0); }
	25% { transform: translateY(-10px); }
	37.5% { transform: translateY(-5px); }
}
@keyframes xb-btn-shake {
	0%, 62.5%, 100% { transform: translateX(0); }
	6.25%, 18.75%, 31.25%, 43.75%, 56.25% { transform: translateX(-4px); }
	12.5%, 25%, 37.5%, 50% { transform: translateX(4px); }
}
@keyframes xb-btn-tada {
	0%, 62.5%, 100% { transform: scale3d(1, 1, 1); }
	6.25%, 12.5% { transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); }
	18.75%, 31.25%, 43.75%, 56.25% { transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); }
	25%, 37.5%, 50% { transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); }
}
@keyframes xb-btn-heartbeat {
	0%, 62.5%, 100% { transform: scale(1); }
	8.75%, 26.25% { transform: scale(1.05); }
	17.5%, 43.75% { transform: scale(1); }
}
@keyframes xb-btn-flash {
	0%, 31.25%, 62.5%, 100% { opacity: 1; }
	15.625%, 46.875% { opacity: 0.7; }
}

/* Premium Product Template Styles */
:root {
	--xb-premium-bg: #faf6f1;
	--xb-premium-text: #333333;
	--xb-premium-accent: #007953;
	--xb-premium-accent-hover: #005c3f;
	--xb-premium-brown: #a57d59;
}

body.xb-product-template-body {
	background: var(--xb-premium-bg);
	color: var(--xb-premium-text);
	font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	margin: 0;
	padding: 0;
}
