/* Maxshelf Flooring Calculator */
.msfc {
	--msfc-bg: #f6f3ef;
	--msfc-line: #e4ddd4;
	--msfc-ink: #1c1b1a;
	--msfc-muted: #6b6560;
	--msfc-accent: #1c1b1a;
	--msfc-sale: #c62828;
	--msfc-badge-bg: #dcefdc;
	--msfc-badge-ink: #2e6b33;
	--msfc-radius: 12px;
	color: var(--msfc-ink);
	margin: 0 0 16px;
	width: 100%;
	font-size: 15px;
	line-height: 1.4;
}

/* Hide the theme's own quantity control – the widget drives it. */
body.msfc-active form.cart .quantity { display: none !important; }
body.msfc-active form.cart { display: flex; flex-wrap: wrap; }
body.msfc-active form.cart .single_add_to_cart_button { width: 100%; }

.msfc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.msfc-label { font-size: 17px; font-weight: 500; }
.msfc-need {
	display: inline-flex; align-items: center; gap: 6px;
	background: none; border: 0; padding: 4px 0; cursor: pointer;
	color: var(--msfc-ink); font: inherit; font-size: 14px;
	text-decoration: underline; text-underline-offset: 3px;
}
.msfc-need:hover { color: var(--msfc-muted); }

.msfc-unitprice { margin: 0 0 10px; font-size: 14px; color: var(--msfc-muted); }
.msfc-unitprice strong { color: var(--msfc-ink); font-size: 16px; }
.msfc-unitprice strong.msfc-now { color: var(--msfc-sale); font-size: 18px; }
.msfc-unitprice del { margin-right: 4px; }
.msfc-unitprice-label { margin-left: 4px; font-size: 12px; }
.msfc-unitprice-box { display: block; margin-top: 2px; }

.msfc-inputs {
	background: var(--msfc-bg);
	border: 1px solid var(--msfc-line);
	border-radius: var(--msfc-radius);
	position: relative;
}
.msfc-row { display: flex; align-items: center; gap: 8px; padding: 16px; margin: 0; cursor: text; }
/* Clearly editable fields: white box, border, pencil hint, strong focus ring. */
.msfc .msfc-row input[type="text"] {
	flex: 0 1 auto; width: 7.5em; min-width: 0; box-sizing: border-box;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.5 2.5l2 2L5 13H3v-2z' fill='none' stroke='%239a928a' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 14px !important;
	border: 1px solid #cfc6bb !important; border-radius: 8px !important;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05) !important; outline: none;
	padding: 0 32px 0 12px !important; margin: 0; height: 44px !important; line-height: 44px;
	font: inherit; font-size: 18px; font-weight: 500; color: var(--msfc-ink); cursor: text;
	transition: border-color .15s, box-shadow .15s;
}
.msfc .msfc-row input[type="text"]:hover { border-color: #a89e92 !important; }
.msfc .msfc-row input[type="text"]:focus {
	border-color: var(--msfc-ink) !important;
	box-shadow: 0 0 0 3px rgba(28, 27, 26, .12) !important;
	background-image: none !important;
}
.msfc-unit { color: var(--msfc-muted); font-size: 15px; flex: 1 1 auto; }
.msfc-steppers { display: inline-flex; gap: 6px; margin-left: auto; }
.msfc .msfc-step {
	width: 40px; height: 40px; min-width: 0; min-height: 0; border-radius: 50% !important;
	border: 1px solid #d9d1c7 !important; background: #fff !important; color: var(--msfc-ink) !important;
	padding: 0 !important; margin: 0; line-height: 0 !important; font-size: 0 !important; cursor: pointer;
	display: inline-flex !important; align-items: center; justify-content: center; box-shadow: none !important;
}
.msfc .msfc-step svg { display: block; width: 16px; height: 16px; margin: 0; }
.msfc .msfc-step:hover:not(:disabled) { background: #ebe5dd !important; }
.msfc .msfc-step:disabled { opacity: .35; cursor: default; }

.msfc-or { position: relative; height: 1px; background: var(--msfc-line); margin: 0; }
.msfc-or span {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
	background: #fff; border-radius: 999px; padding: 0 12px;
	font-size: 13px; line-height: 20px; height: 20px; color: var(--msfc-muted);
	white-space: nowrap;
}
@media (max-width: 600px) {
	.msfc-row { padding: 18px 14px; }
	/* Keep the pill clear of the inputs: move it to the right edge. */
	.msfc-or span { left: auto; right: 14px; transform: translateY(-50%); }
}

.msfc-waste { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px 2px; cursor: pointer; font-size: 14px; }
.msfc-waste input { width: 20px; height: 20px; margin: 0; accent-color: var(--msfc-accent); }
.msfc-badge {
	background: var(--msfc-badge-bg); color: var(--msfc-badge-ink);
	border-radius: 999px; padding: 2px 9px; font-size: 12px;
}

.msfc-summary {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	background: var(--msfc-bg); border: 1px solid var(--msfc-line); border-radius: 10px;
	padding: 14px 16px;
}
.msfc-summary-text { font-size: 15px; }
.msfc-summary-text strong { font-weight: 600; }
.msfc-summary-price { text-align: right; white-space: nowrap; }
.msfc-summary-price del { color: var(--msfc-muted); font-size: 14px; margin-right: 6px; }
.msfc-summary-price ins { text-decoration: none; font-size: 20px; font-weight: 600; }
.msfc-summary-price del + ins { color: var(--msfc-sale); }
.msfc-summary-price small { display: block; font-size: 11px; color: var(--msfc-muted); }
.msfc-note { margin: 8px 2px 0; font-size: 13px; color: var(--msfc-muted); }

/* ---------- Modal ---------- */
html.msfc-lock { overflow: hidden; }
.msfc-modal {
	padding: 0; border: 0; border-radius: 16px;
	width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
	color: #1c1b1a; background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.msfc-modal[open] { display: flex; }
.msfc-modal::backdrop { background: rgba(20, 18, 16, .45); }
.msfc-modal:not([open]) { display: none; }
.msfc-modal-inner { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 24px); margin: 0; }
.msfc-modal-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 18px 20px; border-bottom: 1px solid #ece7e1;
}
.msfc-modal-head h2 { margin: 0; font-size: 21px; font-weight: 500; line-height: 1.2; }
.msfc-close { background: none; border: 0; padding: 4px; cursor: pointer; color: inherit; line-height: 0; }
.msfc-modal-body { padding: 16px 20px 8px; overflow-y: auto; flex: 1 1 auto; }
.msfc-intro, .msfc-hint { margin: 0 0 14px; font-size: 14px; color: #4a4540; }
.msfc-hint { margin-bottom: 10px; }

.msfc-units { display: inline-flex; background: #f3efea; border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.msfc-units label { margin: 0; cursor: pointer; }
.msfc-units input { position: absolute; opacity: 0; pointer-events: none; }
.msfc-units span { display: block; padding: 6px 18px; border-radius: 999px; font-size: 14px; }
.msfc-units input:checked + span { background: #fde7a8; font-weight: 600; }
.msfc-units input:focus-visible + span { outline: 2px solid #1c1b1a; }

.msfc-area-row { margin-bottom: 14px; }
.msfc-area-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.msfc-area-title { font-weight: 600; font-size: 15px; }
.msfc-remove, .msfc-add {
	background: none; border: 0; padding: 0; cursor: pointer; color: #1c1b1a;
	font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.msfc-add { font-weight: 600; margin: 0 0 18px; }
.msfc-area-fields { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: end; }
.msfc-area-fields label { margin: 0; display: block; min-width: 0; }
.msfc-fl { display: block; font-size: 13px; color: #4a4540; margin-bottom: 4px; }
.msfc-area-fields input {
	width: 100%; box-sizing: border-box; height: 48px; margin: 0;
	border: 1px solid #e4ddd4; border-radius: 8px; background: #f8f5f1;
	text-align: center; font: inherit; font-size: 16px; color: #1c1b1a; box-shadow: none;
}
.msfc-area-fields input:focus { outline: 2px solid #1c1b1a; outline-offset: -1px; background: #fff; }
.msfc-x { padding-bottom: 14px; color: #6b6560; }
.msfc-row-area { padding-bottom: 13px; min-width: 78px; text-align: right; font-weight: 600; font-size: 14px; white-space: nowrap; }
.msfc-sub { margin: 6px 0 4px; font-size: 16px; font-weight: 600; }

.msfc-modal-foot { border-top: 1px solid #ece7e1; padding: 14px 20px 18px; }
.msfc-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.msfc-total span { font-size: 16px; }
.msfc-total strong { font-size: 24px; font-weight: 600; }
.msfc-apply {
	width: 100%; height: 52px; border: 0; border-radius: 999px; cursor: pointer;
	background: #1c1b1a; color: #fff; font: inherit; font-size: 16px; font-weight: 600;
}
.msfc-apply:disabled { background: #fbeec9; color: #b9ab8c; cursor: default; }

@media (max-width: 480px) {
	.msfc-summary { flex-direction: column; align-items: flex-start; }
	.msfc-summary-price { text-align: left; }
	.msfc-area-fields { grid-template-columns: 1fr auto 1fr; }
	.msfc-row-area { grid-column: 1 / -1; text-align: left; padding: 0; }
	.msfc-modal { width: 100vw; max-height: 100vh; border-radius: 0; margin: 0; height: 100vh; max-width: 100vw; }
	.msfc-modal-inner { max-height: 100vh; }
}
