.e3d-widget, .e3d-visual-block, .e3d-options-block {
	/* Matched to elwood3d.pl: white background, near-black text, teal-mint
	   accent (same family as "MOJE KONTO" / "PRZEJDŹ DO PŁATNOŚCI" buttons).
	   Tweak these three if the exact brand hex differs slightly. */
	--e3d-bg: #ffffff;
	--e3d-bg-elevated: #f4f5f6;
	--e3d-accent: #2ea88d;
	--e3d-accent-contrast: #ffffff;
	--e3d-text: #161616;
	--e3d-muted: #6b7280;
	--e3d-field-bg: #f4f5f6;
	--e3d-border: #e3e4e6;
	--e3d-radius: 16px;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--e3d-text);
	box-sizing: border-box;
}
.e3d-widget *, .e3d-visual-block *, .e3d-options-block * { box-sizing: border-box; }

/* Card look. Each half carries its own card styling so it looks complete on
   its own — whether used together via the single [e3d_configurator]
   shortcode, or dropped separately into the theme's own two-column block
   layout (recommended: gives you full control over the width/breakpoints
   instead of fighting the theme's content-width constraints with CSS). */
.e3d-visual-block, .e3d-options-block {
	background: var(--e3d-bg);
	padding: 22px;
	border-radius: 22px;
	border: 1px solid var(--e3d-border);
	box-shadow: 0 20px 50px -30px rgba(20,20,20,0.25);
	width: 100%;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
}

.e3d-widget {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	display: flex;
	gap: 32px;
	flex-wrap: wrap;

	/* Prevents "grid/flex blowout": without this, if the widget sits inside a
	   narrow theme column (page builder grid/flex cell), the browser refuses
	   to shrink it below its content's natural width and it overflows the
	   column instead of wrapping — which then gets silently clipped by
	   whatever overflow:hidden the theme's column wrapper has. */
	min-width: 0;
}
/* Combined mode: the two cards sit inside .e3d-left/.e3d-right, so they
   don't need their own outer margin/max-width fight — just fill the slot. */
.e3d-widget .e3d-visual-block, .e3d-widget .e3d-options-block { height: 100%; }

/* The native browser file-picker button/filename must stay fully hidden —
   some themes apply broad `input { display: ... }` resets that override the
   plain HTML `hidden` attribute (author stylesheet beats the UA stylesheet's
   [hidden] rule), so we force it here with a selector specific to our widget. */
.e3d-widget input[type="file"], .e3d-visual-block input[type="file"] {
	display: none !important;
}

.e3d-left { flex: 1.15 1 380px; min-width: 0; }
.e3d-right { flex: 1 1 400px; min-width: 0; }

.e3d-dropzone {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	aspect-ratio: 4 / 3;
	height: auto;
	min-height: 280px;
	max-height: 620px;
	border: 2px dashed var(--e3d-border);
	border-radius: var(--e3d-radius);
	background: #e3e5e8;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	overflow: hidden;
	transition: border-color .15s ease, background .15s ease;
}
.e3d-dropzone.e3d-dragover { border-color: var(--e3d-accent); background: rgba(46,168,141,0.06); }
.e3d-dropzone-empty { text-align: center; color: var(--e3d-muted); }
.e3d-dropzone-empty svg { margin-bottom: 14px; opacity: 0.7; }
.e3d-dropzone-empty p { max-width: 220px; margin: 0 auto; font-size: 14px; }
.e3d-dropzone-preview { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.e3d-model-canvas {
	width: 100%;
	height: 100%;
	touch-action: none;
}
.e3d-drag-hint {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	color: var(--e3d-muted);
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
}

.e3d-change-file-icon {
	position: absolute; top: 14px; right: 14px; z-index: 2;
	width: 30px; height: 30px; border-radius: 50%;
	background: #ffffff; border: 1px solid var(--e3d-border); color: var(--e3d-text);
	font-size: 14px; line-height: 1; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 2px 8px rgba(20,20,20,0.1);
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.e3d-change-file-icon:hover { border-color: var(--e3d-accent); color: var(--e3d-accent); }

.e3d-options-block {
	container-type: inline-size;
}

@container (max-width: 360px) {
	.e3d-filename { font-size: 20px; }
}

.e3d-tech-switcher { margin-bottom: 26px; }
.e3d-tech-tabs { display: flex; gap: 10px; }
.e3d-tech-tab {
	flex: 1; padding: 12px 16px; border-radius: 10px; border: 1.5px solid var(--e3d-border);
	background: var(--e3d-bg-elevated, #f4f5f6); color: var(--e3d-muted); font-weight: 700; font-size: 14px;
	cursor: pointer; transition: all .15s ease; text-align: center;
}
.e3d-tech-tab .e3d-tech-sub { display: block; font-weight: 400; font-size: 11px; margin-top: 2px; opacity: 0.8; }
.e3d-tech-tab.active { background: var(--e3d-accent); border-color: var(--e3d-accent); color: var(--e3d-accent-contrast); }
.e3d-tech-tab:not(.active):hover { border-color: var(--e3d-accent); color: var(--e3d-text); }

.e3d-bed-warning {
	background: #fff4e5; border: 1px solid #f5c26b; color: #8a5a00; border-radius: 8px;
	padding: 10px 14px; font-size: 13px; font-weight: 600; margin: -6px 0 20px;
}

.e3d-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }



.e3d-filename { font-size: 26px; font-weight: 800; margin: 0 0 2px; word-break: break-word; letter-spacing: -0.01em; }
.e3d-dimensions { color: var(--e3d-muted); font-size: 13px; margin-bottom: 22px; }

.e3d-pro-toggle-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 4px; }
.e3d-pro-label { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; color: var(--e3d-muted); }

.e3d-toggle {
	position: relative; width: 40px; height: 22px; border-radius: 999px;
	background: #d8d9db; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
	transition: background .15s ease;
}
.e3d-toggle.active { background: var(--e3d-accent); }
.e3d-toggle-knob {
	position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
	background: #fff; transition: left .15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.e3d-toggle.active .e3d-toggle-knob { left: 20px; }

.e3d-bulk-hint { color: var(--e3d-accent); font-size: 12px; margin: 8px 0 0; min-height: 14px; font-weight: 600; }

.e3d-range-value { font-weight: 400; color: var(--e3d-accent); font-size: 13px; margin-left: 6px; }
.e3d-range {
	-webkit-appearance: none; appearance: none; width: 100%; height: 3px; border-radius: 2px;
	background: var(--e3d-border); margin: 24px 0 10px; cursor: pointer; outline: none;
}
/* Explicit track pseudo-elements — belt-and-suspenders alongside the
   appearance:none reset above. Some browsers only fully hand over the
   track's visual style (not just the thumb) when these are set directly,
   otherwise a thicker native-looking track can peek through. */
.e3d-range::-webkit-slider-runnable-track {
	-webkit-appearance: none; height: 3px; border-radius: 2px; background: transparent;
}
.e3d-range::-moz-range-track {
	height: 3px; border-radius: 2px; background: transparent; border: none;
}
.e3d-range::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
	background: var(--e3d-text); cursor: grab; box-shadow: 0 0 0 4px rgba(20,20,20,0.08);
	margin-top: -6.5px;
}
.e3d-range::-moz-range-thumb {
	width: 16px; height: 16px; border-radius: 50%; background: var(--e3d-text); border: none;
	cursor: grab; box-shadow: 0 0 0 4px rgba(20,20,20,0.08);
}
.e3d-range-reverse { direction: rtl; }

.e3d-delivery-field { margin-top: 4px; }
.e3d-delivery-row { display: flex; align-items: center; gap: 12px; }
.e3d-delivery-text { font-size: 14px; color: var(--e3d-muted); min-width: 110px; }
.e3d-delivery-icon { font-size: 16px; }

.e3d-price-strike { color: var(--e3d-muted); font-weight: 400; font-size: 0.7em; margin-right: 6px; }
.e3d-delivery-addon { font-size: 0.55em; font-weight: 600; color: var(--e3d-muted); margin-left: 8px; vertical-align: middle; }
.e3d-compare-price { font-size: 0.5em; font-weight: 500; color: var(--e3d-muted); margin-left: 6px; vertical-align: middle; }

.e3d-field { margin-bottom: 22px; }
.e3d-label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 15px; }

.e3d-qty { display: flex; align-items: center; gap: 18px; }
.e3d-qty button {
	width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--e3d-border);
	background: transparent; color: var(--e3d-text); font-size: 18px; cursor: pointer;
	transition: border-color .15s ease, color .15s ease;
}
.e3d-qty button:hover { border-color: var(--e3d-accent); color: var(--e3d-accent); }
.e3d-qty span { min-width: 20px; text-align: center; font-size: 16px; }

.e3d-tabs { display: flex; gap: 22px; }
.e3d-tab {
	background: none; border: none; color: var(--e3d-muted); font-size: 15px; cursor: pointer;
	padding-bottom: 4px; border-bottom: 2px solid transparent; transition: color .15s ease;
	text-transform: uppercase; letter-spacing: 0.02em;
}
.e3d-tab.active { color: var(--e3d-text); font-weight: 700; border-color: var(--e3d-accent); }

.e3d-colors { display: flex; gap: 14px; flex-wrap: wrap; }
.e3d-swatch {
	width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
	/* Always-visible border regardless of how dark/light the swatch color is
	   (a white swatch was previously invisible against a white panel, and a
	   near-black one against a dark panel — this fixes both directions). */
	border: 1.5px solid var(--e3d-border);
	box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
	transition: border-color .15s ease, transform .1s ease;
}
.e3d-swatch:hover { transform: scale(1.08); }
.e3d-swatch.active { border-color: var(--e3d-accent); border-width: 2px; }

.e3d-slider { position: relative; height: 4px; background: var(--e3d-border); border-radius: 2px; margin: 22px 4px 8px; cursor: pointer; }
.e3d-slider-track { position: absolute; inset: 0; border-radius: 2px; }
.e3d-slider-thumb {
	position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--e3d-text);
	transform: translate(-50%, -50%); left: 50%; cursor: grab; box-shadow: 0 0 0 4px rgba(20,20,20,0.08);
}
.e3d-slider-labels { display: flex; justify-content: space-between; color: var(--e3d-muted); font-size: 11px; }

.e3d-price-block { margin: 30px 0 20px; padding-top: 22px; border-top: 1px solid var(--e3d-border); }
.e3d-price-label { font-weight: 700; margin: 0 0 6px; color: var(--e3d-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.e3d-price { font-size: 32px; font-weight: 800; color: var(--e3d-accent); margin: 0 0 4px; }
.e3d-weight-hint { color: var(--e3d-muted); font-size: 12px; margin: 0 0 8px; }
.e3d-eta { color: var(--e3d-muted); font-size: 14px; margin: 0; }

.e3d-submit {
	width: 100%; background: var(--e3d-accent); color: var(--e3d-accent-contrast); border: none; border-radius: 12px;
	padding: 17px; font-size: 16px; font-weight: 800; cursor: pointer; letter-spacing: 0.02em;
	transition: filter .15s ease, transform .05s ease;
}
.e3d-submit:disabled { opacity: 0.35; cursor: not-allowed; }
.e3d-submit:not(:disabled):hover { filter: brightness(0.92); }
.e3d-submit:not(:disabled):active { transform: scale(0.99); }

.e3d-error { color: #d92d20; margin-top: 12px; font-size: 14px; }

@media (max-width: 720px) {
	.e3d-widget { gap: 20px; }
	.e3d-visual-block, .e3d-options-block { padding: 16px; }
	.e3d-dropzone { aspect-ratio: 1 / 1; min-height: 240px; max-height: 420px; }
}
