/* Wallpaper calculator card — ported from
   05-design-prototype/concept-shop-and-product-page.html */

.bsc-calc {
	margin: 24px 0 0;
	border: 1.5px solid var(--bsc-amber-soft, #f6f1e6);
	background: linear-gradient(180deg, #fff, var(--bsc-amber-tint, #f6f1e6));
	border-radius: var(--bsc-radius-lg, 10px);
	overflow: hidden;
	color: var(--bsc-graphite, #1a1714);
	font-family: var(--bsc-font-ui, system-ui, sans-serif);
	transition: border-color 0.3s;
}

.bsc-calc--mural,
.bsc-calc--variable-dimensions {
	border-color: var(--bsc-teal-tint, #eaf1ef);
	background: linear-gradient(180deg, #fff, var(--bsc-teal-tint, #eaf1ef));
}

/* Top */

.bsc-calc__top {
	display: flex;
	align-items: center;
	gap: 13px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--bsc-amber-soft, #f6f1e6);
}

.bsc-calc--mural .bsc-calc__top,
.bsc-calc--variable-dimensions .bsc-calc__top {
	border-bottom-color: var(--bsc-teal-tint, #eaf1ef);
}

.bsc-calc__ic {
	width: 40px;
	height: 40px;
	border-radius: 9px;
	background-color: var(--bsc-graphite, #1a1714);
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.7'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 6h8M8 10h8M8 14h3M15 14h1M8 18h3M15 18h1'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 21px;
	flex: none;
}

.bsc-calc__title {
	display: block;
	font-size: 15.5px;
	font-family: var(--bsc-font-display, Georgia, serif);
	font-weight: 600;
	color: var(--bsc-graphite, #1a1714);
	margin: 0;
}

.bsc-calc__lead {
	font-size: 13px;
	color: var(--bsc-muted, #7a736a);
	line-height: 1.4;
}

.bsc-calc__type {
	margin-left: auto;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-radius: 100px;
	background: var(--bsc-amber-soft, #f6f1e6);
	color: var(--bsc-brass-deep, #806233);
	white-space: nowrap;
	flex: none;
}

.bsc-calc--mural .bsc-calc__type,
.bsc-calc--variable-dimensions .bsc-calc__type {
	background: var(--bsc-teal-tint, #eaf1ef);
	color: var(--bsc-teal, #2e5d57);
}

/* Body */

.bsc-calc__body {
	display: grid;
	grid-template-columns: 1fr 188px;
	gap: 20px;
	padding: 18px;
}

@media (max-width: 560px) {
	.bsc-calc__body {
		grid-template-columns: 1fr;
	}
}

.bsc-calc__inputs {
	display: flex;
	flex-direction: column;
	gap: 13px;
	min-width: 0;
}

.bsc-calc__two {
	display: flex;
	gap: 12px;
}

@media (max-width: 400px) {
	.bsc-calc__two {
		flex-direction: column;
	}
}

.bsc-calc__field {
	flex: 1;
	min-width: 0;
}

.bsc-calc__field label {
	font-size: 12.5px;
	font-weight: 700;
	display: block;
	margin-bottom: 5px;
	color: var(--bsc-graphite, #1a1714);
	white-space: nowrap;
}

.bsc-calc__input-unit {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--bsc-line-2, #ddd7cc);
	border-radius: var(--bsc-radius, 4px);
	background: #fff;
	overflow: hidden;
}

.bsc-calc__input-unit:focus-within {
	border-color: var(--bsc-amber, #9a7b3f);
}

.bsc-calc__input-unit input {
	border: 0;
	outline: 0;
	padding: 11px 12px;
	font-size: 16px;
	font-weight: 600;
	width: 100%;
	min-width: 0;
	font-family: var(--bsc-font-ui, system-ui, sans-serif);
	font-variant-numeric: tabular-nums;
	color: var(--bsc-graphite, #1a1714);
	background: none;
}

.bsc-calc__unit {
	padding: 0 12px;
	color: var(--bsc-muted, #7a736a);
	font-weight: 700;
	font-size: 13px;
	border-left: 1px solid var(--bsc-line, #ece8e1);
	align-self: stretch;
	display: flex;
	align-items: center;
}

.bsc-calc__specs {
	font-size: 12px;
	color: var(--bsc-muted, #7a736a);
	margin: 0;
	font-variant-numeric: tabular-nums;
}

.bsc-calc__specs b {
	color: var(--bsc-graphite-2, #3d3833);
}

.bsc-calc__error {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--bsc-danger, #b23a2e);
}

.bsc-calc__resline {
	font-size: 13.5px;
	color: var(--bsc-graphite-2, #3d3833);
	line-height: 1.55;
}

.bsc-calc__resline b {
	color: var(--bsc-graphite, #1a1714);
}

/* Wall visualisation */

.bsc-calc__wall {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--bsc-line-2, #ddd7cc);
	background-position: center;
	aspect-ratio: 3 / 4;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
	background-color: var(--bsc-bone-2, #fbfaf8);
}

@media (max-width: 560px) {
	.bsc-calc__wall {
		aspect-ratio: 16 / 10;
		max-height: 210px;
		order: -1;
	}
}

.bsc-calc__seam {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0;
	border-right: 1.5px dashed rgba(255, 255, 255, 0.85);
	box-shadow: 1px 0 0 rgba(0, 0, 0, 0.25);
}

.bsc-calc__count {
	position: absolute;
	inset: auto 0 0 0;
	/* No scrim: clients read the shading as part of the wallpaper design
	   (Lucy, 29/07/2026). Legibility comes from text-shadow instead. */
	color: #fff;
	padding: 12px;
	text-align: center;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 14px rgba(0, 0, 0, 0.45);
}

.bsc-calc__n {
	font-family: var(--bsc-font-display, Georgia, serif);
	font-size: 38px;
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.bsc-calc__n small {
	font-size: 14px;
	font-weight: 500;
	opacity: 0.85;
}

.bsc-calc__n.bsc-pulse {
	animation: bsc-pop 0.42s ease;
}

@keyframes bsc-pop {
	0% { transform: scale(1); }
	35% { transform: scale(1.16); }
	100% { transform: scale(1); }
}

.bsc-calc__d {
	font-size: 11px;
	opacity: 0.85;
	margin-top: 2px;
}

/* Foot */

.bsc-calc__foot {
	padding: 0 18px 18px;
}

.bsc-calc__fallback {
	margin: 0 0 12px;
	background: #fbf1ef;
	border: 1px solid #ebc9c3;
	border-radius: var(--bsc-radius, 4px);
	padding: 13px 14px;
	font-size: 13.5px;
	color: #7a2c22;
	line-height: 1.5;
}

.bsc-calc__fallback b {
	display: block;
	margin-bottom: 2px;
}

.bsc-calc__fallback a {
	color: var(--bsc-danger, #b23a2e);
	font-weight: 700;
}

.bsc-calc__actions {
	display: flex;
	gap: 11px;
}

.bsc-calc__apply {
	flex: 1;
	background: var(--bsc-graphite, #1a1714);
	color: #fff;
	border: 0;
	border-radius: var(--bsc-radius, 4px);
	font-size: 15.5px;
	font-weight: 700;
	min-height: 52px;
	font-family: var(--bsc-font-ui, system-ui, sans-serif);
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.bsc-calc__apply:hover {
	background: #000;
}

.bsc-calc__apply:active {
	transform: translateY(1px);
}

.bsc-calc__apply:focus-visible {
	outline: 2px solid var(--bsc-amber, #9a7b3f);
	outline-offset: 2px;
}

.bsc-calc__apply[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.bsc-calc__apply.bsc-flash {
	animation: bsc-flash 0.55s ease;
}

@keyframes bsc-flash {
	0% { background: var(--bsc-graphite, #1a1714); }
	30% { background: var(--bsc-amber, #9a7b3f); }
	100% { background: var(--bsc-graphite, #1a1714); }
}

.bsc-calc__sample-btn {
	background: #fff;
	border: 1.5px solid var(--bsc-line-2, #ddd7cc);
	border-radius: var(--bsc-radius, 4px);
	font-weight: 700;
	font-size: 14px;
	padding: 0 16px;
	color: var(--bsc-graphite, #1a1714);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	transition: border-color 0.2s;
	white-space: nowrap;
}

.bsc-calc__sample-btn:hover {
	border-color: var(--bsc-graphite, #1a1714);
}

.bsc-calc__assumptions {
	font-size: 11.5px;
	color: var(--bsc-muted, #7a736a);
	margin: 11px 0 0;
	line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
	.bsc-calc__n.bsc-pulse,
	.bsc-calc__apply.bsc-flash {
		animation: none;
	}
}

/* Fixes 08/07/2026: room for decimals in the inputs, lead line under the title */
.bsc-calc__body {
	grid-template-columns: 1fr 150px;
}
.bsc-calc__input-unit input {
	padding: 11px 9px;
}
.bsc-calc__unit {
	padding: 0 9px;
}
.bsc-calc__top {
	flex-wrap: wrap;
}
.bsc-calc__title {
	flex: 1;
	min-width: 0;
}
.bsc-calc__lead {
	flex-basis: 100%;
	display: block;
	margin: -4px 0 0 53px;
	line-height: 1.35;
}

/* Simplified top bar: pill + lead, no icon or title */
.bsc-calc__top {
	flex-wrap: nowrap;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
}
.bsc-calc__type {
	margin-left: 0;
}
.bsc-calc__lead {
	flex: 1;
	flex-basis: auto;
	display: block;
	margin: 0;
	line-height: 1.35;
}
@media (max-width: 560px) {
	.bsc-calc__top {
		flex-wrap: wrap;
	}
	.bsc-calc__lead {
		flex-basis: 100%;
	}
}

/* Disabled state on brand tokens; no hover reaction while disabled */
.bsc-calc__apply[disabled],
.bsc-calc__apply:disabled {
	background: var(--bsc-line-2, #ddd7cc);
	color: var(--bsc-graphite-2, #3d3833);
	opacity: 1;
	cursor: not-allowed;
}
.bsc-calc__apply:hover:disabled,
.bsc-calc__apply[disabled]:hover {
	background: var(--bsc-line-2, #ddd7cc);
	transform: none;
}

/* Mobile: teal variants must stack like the roll layout */
@media (max-width: 560px) {
	.bsc-calc--mural .bsc-calc__body,
	.bsc-calc--variable-dimensions .bsc-calc__body {
		grid-template-columns: 1fr;
	}
	.bsc-calc__wall {
		max-width: 240px;
		margin: 0 auto;
	}
}

/* ============================================================
   Mobile pass 10/07/2026 — 375x667 audit. The unconstrained
   "1fr 150px" fix above was overriding the 560px stack for the
   default (roll) variant; restore it for every variant, wall
   centred below the inputs, inputs side by side at 375.
   ============================================================ */
@media (max-width: 560px) {
	.bsc-calc__body {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 16px;
	}
	.bsc-calc__wall {
		order: 0; /* below the inputs, per mobile spec */
	}
	.bsc-calc__top {
		padding: 13px 16px;
	}
	.bsc-calc__foot {
		padding: 0 16px 16px;
	}
}
@media (max-width: 400px) {
	/* keep the width x height pair on one row; each field still gets
	   ~145px which fits "2.4" plus the m suffix comfortably */
	.bsc-calc__two {
		flex-direction: row;
	}
}

/* The wall viz only has absolutely-positioned children, so with
   margin:0 auto its auto width collapses to 0 in the stacked grid;
   pin it to the 240px design width instead */
@media (max-width: 560px) {
	.bsc-calc__wall {
		width: 240px;
		max-width: 100%;
	}
}
