/* Spar Winkel */
.spar-qa {
	--spar-qa-accent: #6b4a33;
	--spar-qa-line: rgba(107, 74, 51, 0.35);
	margin-top: 8px;
	font-size: 15px;
}

.spar-qa form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Product fields (e.g. Gewicht) take the full card width. */
.spar-qa .wapf,
.spar-qa .wapf-wrapper {
	flex: 1 1 100%;
	width: 100%;
	margin: 0;
}
.spar-qa .wapf-field-container {
	margin: 0 0 2px;
	padding: 0;
}
.spar-qa .wapf-field-label {
	font-size: 13px;
	margin-bottom: 2px;
}
.spar-qa .wapf-field-label abbr {
	text-decoration: none;
}
.spar-qa select,
.spar-qa input[type=text],
.spar-qa input[type=number]:not(.qty) {
	width: 100%;
	min-height: 38px;
	padding: 6px 8px;
	border: 1px solid var(--spar-qa-line);
	border-radius: 3px;
	background: #fff;
	font: inherit;
	color: inherit;
}

/* The price total box and description from the product page don't fit a card. */
.spar-qa .wapf-product-totals,
.spar-qa .wapf-field-description {
	display: none !important;
}

/* Quantity stepper: everywhere (product page, shop grid, cart) */
.quantity:has(.spar-qty) {
	display: inline-flex;
}
.spar-qa .quantity {
	display: flex;
	margin: 0 !important;
	flex: 0 0 auto;
}
.spar-qty {
	--spar-qty-accent: #6b4a33;
	--spar-qty-line: rgba(107, 74, 51, 0.35);
	display: inline-flex;
	align-items: stretch;
	height: 40px;
	border: 1px solid var(--spar-qty-line);
	border-radius: 3px;
	overflow: hidden;
	background: #fff;
	vertical-align: middle;
}
.spar-qa .spar-qty {
	height: 38px;
}
.spar-qty .spar-qty__btn {
	width: 34px;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--spar-qty-accent) !important;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}
.spar-qty .spar-qty__btn:hover,
.spar-qty .spar-qty__btn:focus-visible {
	background: rgba(107, 74, 51, 0.08) !important;
}
.spar-qty input.qty {
	width: 46px !important;
	min-width: 0;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-left: 1px solid var(--spar-qty-line) !important;
	border-right: 1px solid var(--spar-qty-line) !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-align: center;
	font: inherit;
	-moz-appearance: textfield;
}
.spar-qty input.qty::-webkit-outer-spin-button,
.spar-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.spar-qa .spar-qty input.qty {
	width: 40px !important;
}

/* Add button */
.spar-qa button[type=submit] {
	flex: 1 1 80px;
	min-height: 38px;
	margin: 0 !important;
	padding: 6px 10px !important;
	border: 0;
	border-radius: 3px;
	background-color: var(--spar-qa-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: opacity 0.15s, background-color 0.2s;
}
.spar-qa button[type=submit].loading {
	opacity: 0.7;
	cursor: progress;
}
.spar-qa button[type=submit].loading::after {
	display: none; /* WooCommerce's own spinner icon */
}
.spar-qa button[type=submit].is-added {
	background-color: #3f7a3a;
}

/* Error message */
.spar-qa__msg {
	display: none;
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.35;
	color: #a1271b;
}
.spar-qa__msg.is-visible {
	display: block;
}
.spar-qa__msg a {
	color: inherit;
	text-decoration: underline;
}

/* Stock line from the product template */
.spar-qa .stock {
	display: none;
}

/* "Aantal personen" / "Aantal × 400g" above the stepper */
.spar-qa__qtylabel {
	flex: 1 1 100%;
	margin: 2px 0 -2px;
	font-size: 13px;
	color: #6f5a49;
	cursor: default;
}

/* ---------- "Added" toast ---------- */
.spar-toast {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 100000;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: calc(100vw - 24px);
	box-sizing: border-box;
	padding: 12px 10px 12px 16px;
	border-radius: 12px;
	background: #3b2a1e;
	color: #fff;
	font-family: Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.3;
	box-shadow: 0 10px 30px rgba(59, 42, 30, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 16px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.spar-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.spar-toast__icon {
	flex: none;
	color: #a9d18e;
}
.spar-toast__text {
	flex: 1 1 auto;
	min-width: 0;
}
.spar-toast__link {
	flex: none;
	color: #fff !important;
	font-weight: 700;
	text-decoration: underline !important;
	text-underline-offset: 3px;
	white-space: nowrap;
}
.spar-toast__close {
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px;
	background: transparent !important;
	color: #fff !important;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.spar-toast__close:hover {
	background: rgba(255, 255, 255, 0.12) !important;
}
@media (max-width: 640px) {
	.spar-toast {
		left: 12px;
		right: 12px;
		bottom: 12px;
		transform: translateY(16px);
		flex-wrap: wrap;
		gap: 6px 10px;
	}
	.spar-toast.is-visible {
		transform: none;
	}
	.spar-toast__text {
		flex-basis: calc(100% - 80px);
	}
	.spar-toast__link {
		order: 3;
		margin-left: 30px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.spar-toast,
	.spar-toast.is-visible {
		transition: none;
	}
}

/* Header cart: a short bounce when something is added */
@keyframes spar-cart-bump {
	0%, 100% { transform: scale(1); }
	30% { transform: scale(1.15); }
	60% { transform: scale(0.95); }
}
.spar-cart-bump {
	animation: spar-cart-bump 0.5s ease;
}
@media (prefers-reduced-motion: reduce) {
	.spar-cart-bump {
		animation: none;
	}
}

/* Text-only product fields (Advanced Product Fields "Paragraph", e.g. OPMERKING / Details):
   on a product card they become a compact note instead of their full product-page styling. */
.spar-qa .wapf-field-p {
	flex: 1 1 100%;
}
.spar-qa .wapf-field-p .wapf-field-label {
	display: none;
}
.spar-qa .wapf-field-p .wapf-field-input {
	display: block;
	padding: 6px 10px;
	border-radius: 8px;
	background: #fff4d6;
	color: #7a5300;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
}
.spar-qa .wapf-field-p .wapf-field-input * {
	font-size: 13px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	background: transparent !important;
	color: inherit !important;
}
.spar-qa .wapf-field-p .wapf-field-input p {
	margin: 0 !important;
}

/* WooCommerce adds its own "Winkelwagen bekijken" link under a button after adding;
   Spar Shop already shows that (toast / "Je bestelling"), so hide the duplicate. */
.spar-qa a.added_to_cart {
	display: none !important;
}
