/**
 * CartNexa Free Shipping Progress - Frontend Styles
 * Scoped Class Prefix: .cnexa-fsp-
 */

.cnexa-fsp-wrapper {
	margin: 20px 0;
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cnexa-fsp-card {
	display: flex;
	align-items: center;
	gap: 16px;
	background-color: var(--cnexa-fsp-bg-color, #F6FCF6);
	border: 1px solid var(--cnexa-fsp-border-color, #E5EEF0);
	border-radius: 12px;
	padding: 16px 22px;
	box-shadow: 0 4px 14px rgba(13, 32, 64, 0.04);
	transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.cnexa-fsp-wrapper.cnexa-fsp-success-state .cnexa-fsp-card {
	background-color: var(--cnexa-fsp-success-bg, #E8F7E8);
	border-color: rgba(28, 181, 166, 0.25);
}

/* Icon */
.cnexa-fsp-icon-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #FFFFFF;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	flex-shrink: 0;
}

.cnexa-fsp-icon {
	stroke: var(--cnexa-fsp-progress-color, #1CB5A6);
}

.cnexa-fsp-icon-success {
	stroke: #10B981;
}

/* Message / Subtext */
.cnexa-fsp-message-box {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex-shrink: 0;
	min-width: 0;
}

.cnexa-fsp-message {
	font-size: 15px;
	font-weight: 600;
	color: var(--cnexa-fsp-text-color, #0D2040);
	line-height: 1.3;
	white-space: nowrap;
}

.cnexa-fsp-subtext {
	font-size: 12.5px;
	font-weight: 400;
	color: #64748B;
	line-height: 1.3;
	white-space: nowrap;
}

/* Progress Track & Bar */
.cnexa-fsp-progress-container {
	flex: 1 1 auto;
	min-width: 60px;
}

.cnexa-fsp-progress-track {
	width: 100%;
	height: var(--cnexa-fsp-bar-height, 10px);
	background-color: #E2ECE9;
	border-radius: var(--cnexa-fsp-border-radius, 999px);
	overflow: hidden;
	position: relative;
}

.cnexa-fsp-progress-bar {
	height: 100%;
	background-color: var(--cnexa-fsp-progress-color, #1CB5A6);
	border-radius: var(--cnexa-fsp-border-radius, 999px);
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cnexa-fsp-wrapper.cnexa-fsp-success-state .cnexa-fsp-progress-bar {
	background-color: #10B981;
}

.cnexa-fsp-wrapper.cnexa-fsp-animated .cnexa-fsp-progress-bar {
	background-image: linear-gradient(
		45deg,
		rgba(255, 255, 255, 0.15) 25%,
		transparent 25%,
		transparent 50%,
		rgba(255, 255, 255, 0.15) 50%,
		rgba(255, 255, 255, 0.15) 75%,
		transparent 75%,
		transparent
	);
	background-size: 20px 20px;
	animation: cnexa-fsp-stripe 1.5s linear infinite;
}

@keyframes cnexa-fsp-stripe {
	0% {
		background-position: 0 0;
	}
	100% {
		background-position: 20px 0;
	}
}

/* Goal amount / badge on the right */
.cnexa-fsp-goal-box {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	flex-shrink: 0;
	text-align: right;
}

.cnexa-fsp-goal-amount {
	font-size: 15px;
	font-weight: 700;
	color: var(--cnexa-fsp-progress-color, #1CB5A6);
	line-height: 1.3;
	white-space: nowrap;
}

.cnexa-fsp-wrapper.cnexa-fsp-success-state .cnexa-fsp-goal-amount {
	color: #10B981;
}

.cnexa-fsp-goal-label {
	font-size: 12.5px;
	font-weight: 400;
	color: #64748B;
	line-height: 1.3;
	white-space: nowrap;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
	.cnexa-fsp-card {
		flex-wrap: wrap;
		padding: 14px 16px;
		row-gap: 10px;
	}

	.cnexa-fsp-message-box {
		white-space: normal;
		flex: 1 1 auto;
	}

	.cnexa-fsp-message,
	.cnexa-fsp-subtext {
		white-space: normal;
	}

	.cnexa-fsp-goal-box {
		order: 2;
	}

	.cnexa-fsp-progress-container {
		order: 3;
		flex: 1 1 100%;
	}

	.cnexa-fsp-message {
		font-size: 14px;
	}
}
