/* Variable product — Figma-style swatches + size/qty matrix (child theme) */

body.bw-spv-active form.bw-spv-form table.variations tr.bw-spv-hide-tr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

body.bw-spv-active form.bw-spv-form .woocommerce-variation-selector.bw-spv-hide-tr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

body.bw-spv-active form.bw-spv-form .woocommerce-variation-add-to-cart .quantity.bw-spv-hide-qty {
	display: none !important;
}

.bw-spv {
	margin-top: 18px;
	margin-bottom: 8px;
	max-width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.bw-spv-colour {
	width: 100%;
}

.bw-spv-matrix-block {
	width: 100%;
	max-width: 440px;
	align-self: flex-start;
	box-sizing: border-box;
}

/* Matrix-only subtotal — never replaces .entry-summary .price */
.bw-spv-selection-price {
	margin: 10px 0 0;
	padding: 0;
	font-family: "Montserrat", sans-serif;
	font-size: 1.125rem;
	font-weight: 700;
	color: #29a0f2;
	line-height: 1.35;
}

.bw-spv-selection-price:empty {
	display: none;
}

.bw-spv-matrix-price-wrap,
.bw-spv-matrix-price-wrap .bw-spv-matrix-price-amount {
	display: inline;
}

.bw-spv-field-label {
	display: block;
	font-family: "DM Sans", sans-serif;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #64748b;
	margin-bottom: 10px;
}

.bw-spv-matrix-hint {
	margin: 0 0 12px;
	font-family: "DM Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 400;
	color: #64748b;
	line-height: 1.45;
}

.bw-spv-colour-picked-name {
	font-weight: 700;
	color: #1c2b3a;
}

/* Colour swatches */
.bw-spv-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 28px;
}

.bw-spv-swatch {
	position: relative;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	box-sizing: border-box;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	transition: border-color 0.15s ease, transform 0.12s ease;
}

.bw-spv-swatch:hover {
	transform: translateY(-1px);
}

.bw-spv-swatch:focus {
	outline: 2px solid #00aeef;
	outline-offset: 2px;
}

.bw-spv-swatch.is-selected {
	border-color: #1c2b3a;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2px #fff, 0 0 0 3px #1c2b3a;
}

.bw-spv-swatch-check {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.bw-spv-swatch.is-selected .bw-spv-swatch-check {
	opacity: 1;
}

/* Light swatches: dark tick */
.bw-spv-swatch[data-value*="white" i],
.bw-spv-swatch[data-value*="natural" i],
.bw-spv-swatch[data-value*="cream" i] {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.bw-spv-swatch[data-value*="white" i] .bw-spv-swatch-check,
.bw-spv-swatch[data-value*="natural" i] .bw-spv-swatch-check,
.bw-spv-swatch[data-value*="cream" i] .bw-spv-swatch-check {
	color: #1c2b3a;
	text-shadow: none;
}

/* Matrix head */
.bw-spv-matrix-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 14px;
}

.bw-spv-size-guide {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: "DM Sans", sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #00aeef;
	text-decoration: none;
}

.bw-spv-size-guide:hover {
	text-decoration: underline;
}

.bw-spv-size-guide-icon {
	font-size: 1rem;
	line-height: 1;
}

/* Rows */
.bw-spv-matrix {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 100%;
}

.bw-spv-row {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 16px;
	max-width: 100%;
	box-sizing: border-box;
	min-width: 0;
}

.bw-spv-size-label {
	flex: 0 0 5.5rem;
	width: 5.5rem;
	min-width: 5.5rem;
	max-width: 5.5rem;
	font-family: "Montserrat", sans-serif;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #1c2b3a;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bw-spv-stepper {
	flex: 0 0 140px;
	width: 140px;
	min-width: 140px;
	max-width: 140px;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	background: #f8fafc;
}

.bw-spv-step-btn {
	flex: 0 0 38px;
	width: 38px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: none;
	background: #f1f5f9;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1c2b3a;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.bw-spv-step-btn:hover {
	background: #e2e8f0;
	color: #00aeef;
}

.bw-spv-qty {
	flex: 1 1 auto;
	min-width: 0;
	width: 48px;
	height: 40px;
	border: none;
	border-left: 1px solid #e2e8f0;
	border-right: 1px solid #e2e8f0;
	text-align: center;
	font-family: "DM Sans", sans-serif;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1c2b3a;
	background: #fff;
	box-sizing: border-box;
	-moz-appearance: textfield;
}

.bw-spv-qty::-webkit-outer-spin-button,
.bw-spv-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.bw-spv-stock {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 11rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 2px;
	text-align: left;
	margin-left: 0;
}

.bw-spv-stock-line--title {
	font-family: "Montserrat", sans-serif;
	font-size: 0.8125rem;
	font-weight: 800;
	color: #1c2b3a;
}

.bw-spv-stock-line--sub {
	font-family: "DM Sans", sans-serif;
	font-size: 0.75rem;
	color: #64748b;
	line-height: 1.35;
}

.bw-spv-stock-line--bad {
	font-family: "DM Sans", sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #b91c1c;
}

@media (max-width: 600px) {
	.bw-spv-row {
		flex-wrap: wrap;
		align-items: stretch;
		gap: 10px;
	}

	.bw-spv-size-label {
		flex: 1 1 100%;
		width: 100%;
		max-width: none;
		margin-bottom: -4px;
	}

	.bw-spv-stepper {
		flex: 0 0 auto;
		width: 100%;
		max-width: 220px;
		min-width: 0;
	}

	.bw-spv-stock {
		flex: 1 1 100%;
		align-items: flex-start;
		text-align: left;
		margin-left: 0;
	}
}
