/* SN Frame Mats - PDP mat selector. Scoped to .san-mat, loads on product pages only.
 * Colour label + swatches deliberately mirror the site's Wood selector
 * (.san-finish-label / .san-finish-swatch). */
.san-mat {
	margin: 16px 0 4px;
	padding: 14px 0 0;
	border-top: 1px solid rgba( 15, 15, 15, 0.12 );
	font-family: var( --san-font-body ), "IBM Plex Sans", system-ui, -apple-system, sans-serif;
	font-weight: 300;
	font-size: 16px;
	color: #303030;
}

.san-mat__standard {
	margin: 0 0 8px;
	font-size: 16px;
}

/* Scaled mat preview - board drawn to the frame size, window to the opening */
.san-mat__diagram {
	margin: 12px 0 6px;
	max-width: 300px;
}

.san-mat__diagram svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.san-mat__diagram text {
	font-family: var( --san-font-body ), sans-serif;
	font-size: 11px;
	font-weight: 300;
	letter-spacing: 0.01em;
}

.san-mat__diagram-cap {
	margin: 6px 0 0;
	font-size: 13px;
	font-weight: 300;
	color: #6b6459;
}

.san-mat__diagram-cap[data-warn="1"] {
	color: #b3261e;
}

.san-mat__toggle,
.san-mat__back {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 16px;
	color: #303030;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.san-mat__back {
	margin-top: 14px;
	color: #6b6b6b;
}

.san-mat__custom {
	margin-top: 12px;
}

.san-mat__row {
	display: flex;
	gap: 14px;
}

.san-mat__field {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.san-mat__field span {
	margin-bottom: 8px;
	font-size: 16px;
	font-weight: 300;
	letter-spacing: 0.01em;
	color: #6b6459;
}

.san-mat__field input {
	margin-top: 10px;
	font: inherit;
	font-size: 16px;
	font-weight: 300;
	padding: 8px 10px;
	border: 1px solid rgba( 15, 15, 15, 0.25 );
	border-radius: 2px;
	background: #fff;
	color: #0f0f0f;
}

.san-mat__field input:hover,
.san-mat__field input:focus,
.san-mat__field input:focus-visible {
	outline: none;
	border-color: rgba( 15, 15, 15, 0.25 );
}

/* Colour label - matches .san-finish-label ("WOOD:") */
.san-mat__colorwrap {
	margin-top: 16px;
}

.san-mat__lbl-c {
	display: block;
	font-family: var( --san-font-body ), "IBM Plex Sans", sans-serif;
	font-weight: 400;
	font-size: 16px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #6b6459;
	line-height: 1;
}

.san-mat__colors {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 10px;
}

/* Swatches - match .san-finish-swatch */
.san-mat__swatch {
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	flex-shrink: 0;
	cursor: pointer;
	box-shadow: 0 0 0 1px rgba( 15, 15, 15, 0.14 );
	transition: box-shadow 0.15s ease;
}

.san-mat__swatch:hover {
	box-shadow: 0 0 0 1px rgba( 15, 15, 15, 0.45 );
}

.san-mat__swatch.is-selected {
	outline: 1.5px solid #0f0f0f;
	outline-offset: 2px;
}

.san-mat__upcharge {
	margin: 16px 0 0;
	font-size: 16px;
	font-weight: 400;
	color: #0f0f0f;
}

.san-mat__err {
	margin: 8px 0 0;
	font-size: 16px;
	color: #b3261e;
}

/* Force the site's Wood label onto the body font family (matches the rest of the
 * page). Extra specificity so it wins regardless of stylesheet load order. */
.san-pdp .san-finish-label,
body .san-finish-label {
	font-family: var( --san-font-body ), "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

@media ( max-width: 479px ) {
	.san-mat__row {
		flex-direction: column;
	}
}

/* ---------------------------------------------------------------------------
 * Cart / checkout: the locked "Custom mat" sub-line under its frame.
 * ------------------------------------------------------------------------- */
.woocommerce-cart-form .cart_item.sn-mat-line td.product-name {
	padding-left: 2.5em;
	position: relative;
}
.woocommerce-cart-form .cart_item.sn-mat-line td.product-name::before {
	content: "\21B3"; /* downwards arrow with tip rightwards */
	position: absolute;
	left: 1em;
	color: #8a8072;
}
/* No product image on the mat line - collapse the thumbnail cell. */
.cart_item.sn-mat-line td.product-thumbnail {
	width: 0;
	min-width: 0;
	padding-left: 0;
	padding-right: 0;
}
.cart_item.sn-mat-line td.product-thumbnail img { display: none; }
.sn-mat-line__qty {
	display: inline-block;
	min-width: 2em;
	text-align: center;
	color: #6b6255;
}
.cart_item.sn-mat-line .product-name a { pointer-events: none; text-decoration: none; color: inherit; }

/* "No opening" checkbox - directly under the opening width/height row. */
.san-mat__noopen-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	font-size: 16px;
	font-weight: 300;
	color: #303030;
	cursor: pointer;
}

.san-mat__noopen-toggle input {
	width: 16px;
	height: 16px;
	margin: 0;
	flex-shrink: 0;
	cursor: pointer;
}

/* opening fields greyed while "No opening" is ticked */
.san-mat__row.is-disabled {
	opacity: 0.45;
}

.san-mat__row.is-disabled input {
	cursor: not-allowed;
}

/* --- text normalisation (requested): one font, weight, colour; no uppercase --- */
.san-mat,
.san-mat * {
	font-family: "IBM Plex Sans", sans-serif !important;
	font-weight: 300 !important;
	color: #303030 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* keep the validation states readable as an alert */
.san-mat__err,
.san-mat__diagram-cap[data-warn="1"] {
	color: #b3261e !important;
}

/* breathing room above the "Custom mat: +…" / "Mat (no opening): +…" line */
.san-mat__upcharge {
	margin-top: 28px;
}