/* ==========================================================================
   Free shipping badge
   ========================================================================== */

.wcfst-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.4em 0.75em;
	border-radius: 999px;
	background: var(--wcfst-badge-bg, #2d2d2d);
	color: var(--wcfst-badge-text, #fff);
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.wcfst-badge__icon {
	display: inline-flex;
}

.wcfst-badge__icon svg {
	display: block;
	width: 1.35em;
	height: 1.35em;
}

/* Recolour uploaded icons to the badge text colour. */
.wcfst-badge--recolor .wcfst-badge__icon svg {
	fill: currentColor;
}
.wcfst-badge--recolor .wcfst-badge__icon svg [fill]:not([fill="none"]) {
	fill: currentColor;
}
.wcfst-badge--recolor .wcfst-badge__icon svg [stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

/* Small badge above the title in shop/category grids. */
.wcfst-badge--card {
	margin: 0.5em 0 0.35em;
}

/* Image badge on the single product main image. */
.woocommerce-product-gallery__image,
.woocommerce-product-gallery__image--placeholder {
	position: relative;
}

.wcfst-overlay {
	position: absolute;
	top: var(--wcfst-overlay-top, 0);
	right: var(--wcfst-overlay-right, 0);
	z-index: 5;
	width: var(--wcfst-overlay-w, 160px);
	max-width: 40%;
	line-height: 0;
	pointer-events: none;
}

.wcfst-overlay img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	margin: 0;
}

@media (max-width: 767px) {
	.wcfst-overlay {
		width: var(--wcfst-overlay-w-m, 100px);
	}
}

/* ==========================================================================
   Progress bar
   ========================================================================== */

.wcfst-bar {
	max-width: 600px;
	margin: 20px auto;
	padding: 16px;
	background: #fff;
	border-bottom: 1px solid #e5e7eb;
	box-sizing: border-box;
}

.wcfst-bar--mini {
	max-width: 100%;
	margin: 10px 0;
	padding: 12px;
	border-radius: 8px;
}

.wcfst-bar__message {
	margin-bottom: 12px;
	color: #333;
	font-size: 18px;
	font-weight: 600;
	text-align: center;
}

.wcfst-bar--mini .wcfst-bar__message {
	margin-bottom: 8px;
	font-size: 14px;
}

.wcfst-bar.is-complete .wcfst-bar__message {
	color: var(--wcfst-success, #4caf50);
}

.wcfst-bar__amount {
	color: var(--wcfst-bar, #2d2d2d);
}

.wcfst-bar__track {
	height: 12px;
	overflow: hidden;
	border-radius: 20px;
	background: var(--wcfst-bar-bg, #e0e0e0);
}

.wcfst-bar--mini .wcfst-bar__track {
	height: 8px;
}

.wcfst-bar__fill {
	height: 100%;
	border-radius: 20px;
	background: var(--wcfst-bar, #2d2d2d);
	transition: width 0.5s ease-in-out;
}

.wcfst-bar.is-complete .wcfst-bar__fill {
	background: var(--wcfst-success, #4caf50);
}

/* ==========================================================================
   Upsell slider
   ========================================================================== */

.wcfst-upsells {
	position: relative;
	margin-top: 20px;
}

.wcfst-upsells.has-nav {
	padding: 0 44px;
}

.wcfst-bar--mini .wcfst-upsells {
	margin-top: 12px;
}

.wcfst-bar--mini .wcfst-upsells.has-nav {
	padding: 0 34px;
}

.wcfst-upsells__track {
	display: flex;
	gap: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.wcfst-upsells__track::-webkit-scrollbar {
	display: none;
}

.wcfst-upsell {
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	gap: 12px;
	padding: 10px;
	border-radius: 10px;
	background: #fafafa;
	box-sizing: border-box;
	scroll-snap-align: start;
}

.wcfst-bar--mini .wcfst-upsell {
	gap: 8px;
	padding: 8px;
}

.wcfst-upsell__row {
	display: flex;
	align-items: center;
	gap: 14px;
}

.wcfst-upsell__image {
	flex-shrink: 0;
}

.wcfst-upsell__image img {
	display: block;
	width: 70px;
	height: 70px;
	margin: 0;
	border-radius: 8px;
	object-fit: cover;
}

.wcfst-bar--mini .wcfst-upsell__image img {
	width: 50px;
	height: 50px;
}

.wcfst-upsell__info {
	flex: 1;
	min-width: 0;
}

.wcfst-upsell__title {
	display: -webkit-box;
	margin-bottom: 4px;
	overflow: hidden;
	color: #333;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.wcfst-upsell__title:hover {
	color: var(--wcfst-bar, #2d2d2d);
}

.wcfst-bar--mini .wcfst-upsell__title {
	font-size: 13px;
}

.wcfst-upsell__price {
	color: #e74c3c;
	font-size: 16px;
	font-weight: 600;
}

.wcfst-bar--mini .wcfst-upsell__price {
	font-size: 14px;
}

.wcfst-upsell__unlocks {
	margin-top: 2px;
	color: var(--wcfst-success, #4caf50);
	font-size: 12px;
	font-weight: 600;
}

.wcfst-upsell__add {
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 8px;
	background: var(--wcfst-btn, #a4d037);
	color: var(--wcfst-btn-text, #2d2d2d);
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.wcfst-upsell__add:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.wcfst-upsell__add.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.wcfst-bar--mini .wcfst-upsell__add {
	padding: 8px 12px;
	font-size: 12px;
}

.wcfst-upsells__nav {
	display: none;
	position: absolute;
	top: 50%;
	z-index: 2;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #f5f5f5;
	color: #333;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 0.2s ease, opacity 0.2s ease;
}

.wcfst-upsells.has-nav .wcfst-upsells__nav {
	display: flex;
}

.wcfst-upsells__nav:hover {
	background: #e0e0e0;
}

.wcfst-upsells__nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.wcfst-upsells__nav--prev {
	left: 0;
}

.wcfst-upsells__nav--next {
	right: 0;
}

.wcfst-bar--mini .wcfst-upsells__nav {
	width: 28px;
	height: 28px;
}

.wcfst-upsells__dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
}

.wcfst-upsells__dots button {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #ddd;
	cursor: pointer;
	transition: background 0.2s;
}

.wcfst-upsells__dots button.is-active {
	background: var(--wcfst-bar, #2d2d2d);
}

/* ==========================================================================
   Admin preview
   ========================================================================== */

.wcfst-admin-preview {
	display: inline-block;
	padding: 16px 20px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
}

.wcfst-admin-preview--overlay img {
	display: block;
	max-width: 200px;
	height: auto;
}
