/* ═══════════════════════════════════════════════════════════
   MAVERO — konfigurator łóżka (overlay pełnoekranowy)
═══════════════════════════════════════════════════════════ */

.mconf {
	position: fixed;
	inset: 0;
	/* dvh — na telefonach 100vh wlicza schowany pasek przeglądarki
	   i dolny pasek z ceną wpadał pod chrome przeglądarki. */
	height: 100vh;
	height: 100dvh;
	z-index: 1200;
	display: none;
	background: var(--color-bg, #FAF8F5);
	grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
	grid-template-rows: minmax(0, 1fr) auto;
	grid-template-areas:
		"preview panel"
		"bar     bar";
}
.mconf.is-open { display: grid; }
html.mconf-lock, html.mconf-lock body { overflow: hidden; }

/* ── Podgląd ───────────────────────────────────────── */
.mconf__preview {
	grid-area: preview;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f2efe9;
	overflow: hidden;
}
.mconf__stage {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.mconf__stage img {
	max-width: min(92%, 860px);
	max-height: 88%;
	object-fit: contain;
	transition: opacity .25s ease;
}
.mconf__preview-note {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 6px 14px;
	background: rgba(255,255,255,.85);
	border-radius: 100px;
	font-size: var(--fs-xs, 12px);
	color: var(--color-text-muted, #6b6b6b);
	white-space: nowrap;
}
.mconf__exit {
	position: absolute;
	top: 20px;
	left: 20px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: rgba(255,255,255,.9);
	border: 1px solid rgba(0,0,0,.08);
	border-radius: 100px;
	font-size: var(--fs-sm, 14px);
	cursor: pointer;
	transition: background .2s;
}
.mconf__exit:hover { background: #fff; }

/* ── Panel kroków ──────────────────────────────────── */
.mconf__panel {
	grid-area: panel;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--color-bg, #FAF8F5);
	border-left: 1px solid rgba(0,0,0,.07);
	padding: 28px clamp(18px, 3vw, 40px) 40px;
}
.mconf__panel-head { margin-bottom: 8px; }
.mconf__title {
	font-family: var(--font-heading, serif);
	font-weight: var(--fw-light, 300);
	font-size: var(--fs-2xl, 28px);
	margin: 0;
}

.mconf-step { padding: 22px 0; border-bottom: 1px solid rgba(0,0,0,.07); }
.mconf-step:last-child { border-bottom: 0; }
.mconf-step__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}
.mconf-step__head h3 {
	margin: 0;
	font-family: var(--font-heading, serif);
	font-size: var(--fs-lg, 18px);
	font-weight: var(--fw-light, 300);
}
.mconf-step__no {
	flex: none;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--color-bg-dark, #1e1c19);
	color: #fff;
	font-size: 13px;
}
.mconf-step__note {
	margin: 12px 0 0;
	font-size: var(--fs-xs, 12px);
	color: var(--color-text-muted, #6b6b6b);
	line-height: 1.6;
}

/* Opcje osi (rozmiar, materac, wersja…) */
.mconf-opts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
	gap: 10px;
}
.mconf-opt {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	transition: border-color .15s, box-shadow .15s;
}
.mconf-opt:hover { border-color: rgba(0,0,0,.35); }
.mconf-opt.is-active {
	border-color: var(--color-gold, #B99A5B);
	box-shadow: 0 0 0 1px var(--color-gold, #B99A5B);
}
.mconf-opt:disabled { opacity: .4; cursor: not-allowed; }
.mconf-opt__name { font-size: var(--fs-sm, 14px); }
.mconf-opt__price { font-size: var(--fs-xs, 12px); color: var(--color-gold-text, #8A6D33); }

/* Tkaniny */
.mconf-ftabs { display: flex; gap: 8px; margin-bottom: 14px; }
.mconf-ftab {
	padding: 9px 16px;
	background: #fff;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 100px;
	font-size: var(--fs-sm, 14px);
	cursor: pointer;
}
.mconf-ftab em { font-style: normal; color: var(--color-gold-text, #8A6D33); }
.mconf-ftab.is-active {
	border-color: var(--color-gold, #B99A5B);
	box-shadow: 0 0 0 1px var(--color-gold, #B99A5B);
}
.mconf-fabrics {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
	gap: 10px;
}
.mconf-fabric {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	background: #fff;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
}
.mconf-fabric img {
	width: 100%;
	aspect-ratio: 1/1;
	object-fit: cover;
	border-radius: 5px;
}
.mconf-fabric.is-active {
	border-color: var(--color-gold, #B99A5B);
	box-shadow: 0 0 0 1px var(--color-gold, #B99A5B);
}
.mconf-fabric__name { font-size: var(--fs-sm, 14px); }
.mconf-fabric__props {
	font-size: 10.5px;
	line-height: 1.45;
	color: var(--color-text-muted, #6b6b6b);
}

/* Kolory */
.mconf-colors__label {
	margin: 18px 0 10px;
	font-size: var(--fs-sm, 14px);
}
.mconf-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.mconf-color {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0,0,0,.18);
	cursor: pointer;
	transition: transform .12s;
}
.mconf-color:hover { transform: scale(1.12); }
.mconf-color.is-active {
	box-shadow: 0 0 0 2px var(--color-gold, #B99A5B);
	transform: scale(1.12);
}

/* Dodatki */
.mconf-addons { display: flex; flex-direction: column; gap: 8px; }
.mconf-addon {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	background: #fff;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 8px;
	cursor: pointer;
	font-size: var(--fs-sm, 14px);
}
.mconf-addon:has(input:checked) {
	border-color: var(--color-gold, #B99A5B);
	box-shadow: 0 0 0 1px var(--color-gold, #B99A5B);
}
.mconf-addon input { accent-color: var(--color-gold, #B99A5B); width: 16px; height: 16px; flex: none; }
.mconf-addon__label { display: flex; justify-content: space-between; gap: 12px; flex: 1; }
.mconf-addon__label em { font-style: normal; color: var(--color-gold-text, #8A6D33); white-space: nowrap; }
.mconf-contact a { color: var(--color-gold-text, #8A6D33); text-decoration: underline; text-underline-offset: 2px; }

/* ── Pasek dolny ───────────────────────────────────── */
.mconf__bar {
	grid-area: bar;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px clamp(16px, 3vw, 32px);
	/* iPhone: nie wjeżdżaj pod home indicator */
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-top: 1px solid rgba(0,0,0,.08);
}
.mconf__bar-config { position: relative; margin-right: auto; }
.mconf__summary-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	font-size: var(--fs-sm, 14px);
	color: var(--color-text-muted, #6b6b6b);
	cursor: pointer;
}
.mconf__summary {
	position: absolute;
	bottom: calc(100% + 14px);
	left: 0;
	width: min(340px, 90vw);
	background: #fff;
	border: 1px solid rgba(0,0,0,.1);
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0,0,0,.14);
	padding: 16px 18px;
}
.mconf__summary div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 5px 0;
	font-size: var(--fs-xs, 12.5px);
}
.mconf__summary span { color: var(--color-text-muted, #6b6b6b); }
.mconf__price {
	font-family: var(--font-heading, serif);
	font-size: var(--fs-xl, 24px);
}
.mconf__price-note {
	font-size: var(--fs-xs, 12px);
	color: var(--color-text-muted, #6b6b6b);
}
.mconf__add { white-space: nowrap; }

/* ── Przycisk otwierający na karcie produktu ───────── */
.mconf-open-btn {
	display: flex;
	width: 100%;
	justify-content: center;
	margin-bottom: var(--space-sm, 12px);
}

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 900px) {
	.mconf {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: 36vh minmax(0, 1fr) auto;
		grid-template-rows: 36dvh minmax(0, 1fr) auto;
		grid-template-areas:
			"preview"
			"panel"
			"bar";
	}
	.mconf__panel { border-left: 0; border-top: 1px solid rgba(0,0,0,.07); padding-top: 16px; padding-bottom: 24px; }
	.mconf__panel-head { display: none; } /* tytuł jest na pasku strony — oszczędzamy pion */
	.mconf__stage img { max-height: 94%; }
	.mconf__exit { top: 12px; left: 12px; padding: 8px 14px; font-size: 13px; }
	.mconf__bar { flex-wrap: wrap; gap: 8px 16px; padding-top: 10px; }
	.mconf__bar-price { display: flex; align-items: baseline; gap: 6px; }
	.mconf__price { font-size: var(--fs-lg, 19px); }
	.mconf__add { flex: 1 1 100%; }
	.mconf-opts { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
	.mconf-fabrics { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
	.mconf-step { padding: 16px 0; }
}

/* Dodatki jako kafelki (2.15.1) — szersze pola, znacznik przy aktywnym */
.mconf-opts--addons { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.mconf-opt--addon { position: relative; padding-right: 36px; min-height: 64px; justify-content: center; }
.mconf-opt--addon::after {
	content: '';
	position: absolute; top: 12px; right: 12px;
	width: 18px; height: 18px;
	border: 1.5px solid rgba(0,0,0,.25);
	border-radius: 4px;
	background: #fff;
	transition: background .15s, border-color .15s;
}
.mconf-opt--addon.is-active::after {
	border-color: var(--color-gold, #B99A5B);
	background: var(--color-gold, #B99A5B) url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6l2.5 2.5 4.5-5' stroke='%231A1A18' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
@media (max-width: 640px) { .mconf-opts--addons { grid-template-columns: 1fr; } }
