/*!
 * Barra de progreso para envío gratuito — Frontend styles
 * Uses CSS custom properties so themes can override on .fspb-container.
 */

.fspb-container {
	--fspb-bar-fill: #2271b1;
	--fspb-bar-bg: #f0f0f1;
	--fspb-text: #1d2327;
	--fspb-success: #00a32a;
	--fspb-border: #c3c4c7;
	--fspb-animation-speed: 600ms;

	box-sizing: border-box;
	width: 100%;
	margin: 0 0 1.25em;
	padding: 0.85em 1em;
	color: var(--fspb-text);
	background: transparent;
	border: 1px solid var(--fspb-border);
	border-radius: 6px;
	font-size: 0.95em;
	line-height: 1.4;
}

.fspb-container *,
.fspb-container *::before,
.fspb-container *::after {
	box-sizing: border-box;
}

.fspb-message {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.6em;
}

.fspb-emoji {
	font-size: 1.2em;
	line-height: 1;
	flex-shrink: 0;
}

.fspb-text {
	flex: 1 1 auto;
}

.fspb-text strong {
	font-weight: 700;
}

.fspb-bar-wrapper {
	position: relative;
	width: 100%;
	height: 10px;
	background-color: var(--fspb-bar-bg);
	border-radius: 999px;
	overflow: hidden;
}

.fspb-bar-fill {
	display: block;
	height: 100%;
	width: 0;
	background-color: var(--fspb-bar-fill);
	border-radius: 999px;
	transition: width var(--fspb-animation-speed) ease-out, background-color var(--fspb-animation-speed) ease-out;
}

.fspb-container:not(.fspb-animate) .fspb-bar-fill {
	transition: none;
}

.fspb-percent {
	margin-top: 0.4em;
	font-size: 0.85em;
	color: var(--fspb-text);
	opacity: 0.7;
	text-align: right;
}

/* Status: reached */
.fspb-status-reached .fspb-bar-fill {
	background-color: var(--fspb-success);
}

.fspb-status-reached .fspb-text {
	font-weight: 600;
}

/* Style: modern (thin bar, no percent) */
.fspb-style-modern .fspb-bar-wrapper {
	height: 4px;
}

.fspb-style-modern {
	border: none;
	padding: 0.5em 0;
}

/* Style: minimal (no bar) */
.fspb-style-minimal {
	border: none;
	padding: 0.4em 0;
}

.fspb-style-minimal .fspb-message {
	margin-bottom: 0;
}

/* Mini-cart context — generous breathing room top AND bottom so it visually separates from products/buttons regardless of position */
.fspb-context-mini_cart {
	margin: 1.5em 0;
	padding: 0.6em 0.75em;
	font-size: 0.875em;
}

/* Cart sidebar / Checkout — sit inside narrow totals columns: tighter padding, slightly smaller text */
.fspb-context-cart_sidebar,
.fspb-context-checkout {
	margin: 1em 0;
	padding: 0.7em 0.85em;
	font-size: 0.875em;
}

/* Header context — full-width banner feel */
.fspb-context-header {
	border-radius: 0;
	border-left: none;
	border-right: none;
	margin: 0;
	padding: 0.6em 1em;
}

/* Hidden empty placeholder — keep selector live for fragment replacement */
.fspb-empty {
	display: none !important;
}

/* ----- Product suggestions ----- */

.fspb-suggestions {
	margin-top: 0.85em;
	padding-top: 0.75em;
	border-top: 1px dashed var(--fspb-border);
}

.fspb-suggestions-title {
	margin: 0 0 0.6em;
	font-size: 0.875em;
	font-weight: 600;
	color: var(--fspb-text);
	opacity: 0.85;
}

.fspb-suggestions-list {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fspb-suggestion {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75em;
	padding: 0.5em 0.6em;
	background: rgba(0, 0, 0, 0.02);
	border: 1px solid var(--fspb-border);
	border-radius: 4px;
	font-size: 0.875em;
}

.fspb-suggestion-link {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.6em;
	flex: 1 1 auto;
	min-width: 0;
	color: var(--fspb-text);
	text-decoration: none;
}

.fspb-suggestion-link:hover .fspb-suggestion-name {
	text-decoration: underline;
}

.fspb-suggestion-thumb {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 3px;
}

.fspb-suggestion-info {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	flex: 1 1 auto;
	min-width: 0;
}

.fspb-suggestion-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-weight: 500;
	line-height: 1.3;
}

.fspb-suggestion-price {
	font-weight: 600;
	color: var(--fspb-text);
	font-size: 0.95em;
}

.fspb-suggestion-price del {
	opacity: 0.55;
	margin-right: 0.3em;
	font-weight: 400;
}

.fspb-add-to-cart {
	flex-shrink: 0;
	display: inline-block;
	padding: 0.45em 0.85em;
	font-size: 0.85em;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: var(--fspb-button-text, #ffffff);
	background: var(--fspb-button-bg, var(--fspb-bar-fill));
	border: 1px solid var(--fspb-button-bg, var(--fspb-bar-fill));
	border-radius: 3px;
	cursor: pointer;
	transition: filter 150ms ease-out;
	white-space: nowrap;
}

.fspb-add-to-cart:hover,
.fspb-add-to-cart:focus {
	filter: brightness(0.9);
	color: var(--fspb-button-text, #ffffff);
	text-decoration: none;
}

.fspb-add-to-cart.added {
	background: var(--fspb-success);
	border-color: var(--fspb-success);
}

.fspb-add-to-cart.loading {
	opacity: 0.7;
	pointer-events: none;
}

/* Mobile: tighter padding, smaller image */
@media (max-width: 480px) {
	.fspb-suggestion {
		padding: 0.4em 0.5em;
		gap: 0.5em;
	}
	.fspb-suggestion-thumb {
		width: 38px;
		height: 38px;
	}
	.fspb-suggestion-name {
		-webkit-line-clamp: 1;
	}
	.fspb-add-to-cart {
		padding: 0.35em 0.6em;
		font-size: 0.8em;
	}
}

/* Responsive tweaks */
@media (max-width: 480px) {
	.fspb-container {
		font-size: 0.875em;
		padding: 0.65em 0.8em;
	}
	.fspb-message {
		gap: 0.4em;
	}
}

@media (min-width: 1280px) {
	.fspb-container {
		font-size: 1em;
	}
}
