/* Przypinkowo Kreator – frontend */

/* Drop the theme's page-title banner on creator pages so the creator sits at the
   top of the page (this stylesheet only loads where the creator shortcode runs). */
.page-title { display: none; }

.pk-app {
	/* Przypinkowo brand orange (logo #F37F1C) */
	--pk-accent: #f37f1c;
	--pk-accent-d: #d96a10;
	--pk-teal: #f37f1c;     /* head bar + active states */
	--pk-teal-d: #d96a10;
	--pk-bg: #fef4e9;       /* warm cream panels */
	--pk-border: #f0ddc8;   /* warm border */
	--pk-text: #2d2a26;
	--pk-muted: #9a8775;
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 14px;
	align-items: start;
	color: var(--pk-text);
	font-size: 15px;
	max-width: 1180px;
	margin: 0 auto;
	box-sizing: border-box;
}
.pk-app *, .pk-app *::before, .pk-app *::after { box-sizing: border-box; }

/* Desktop: break out of the theme's content container and use the full page width. */
@media (min-width: 881px) {
	.pk-app {
		max-width: none;
		width: 100vw;
		position: relative;
		left: 50%;
		right: 50%;
		margin-left: -50vw;
		margin-right: -50vw;
		padding-left: clamp(16px, 3vw, 56px);
		padding-right: clamp(16px, 3vw, 56px);
		grid-template-columns: 240px 1fr;
	}
}

/* LEFT product list */
.pk-products {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 12px;
	padding: 10px;
	position: sticky;
	top: 12px;
}
.pk-product {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	border: 2px solid transparent;
	border-radius: 10px;
	padding: 8px 10px;
	cursor: pointer;
	text-align: left;
	transition: border-color .15s, box-shadow .15s;
	font: inherit;
	color: inherit;
}
.pk-product:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.pk-product.is-active { border-color: var(--pk-teal); background: #fff; }
.pk-product__icon {
	width: 46px; height: 46px; flex: 0 0 46px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 8px; overflow: hidden; background: #f4f8f7;
}
.pk-product__icon img { width: 100%; height: 100%; object-fit: contain; }
.pk-product__placeholder { display: inline-flex; color: var(--pk-muted); }
.pk-product__placeholder .pk-ico { width: 26px; height: 26px; }
.pk-product__label { font-weight: 600; font-size: 14px; }

/* RIGHT */
.pk-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Size / quantity controls (now live in the bottom action bar) */
.pk-actions__label {
	display: block;
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	color: var(--pk-muted); margin-bottom: 7px;
}
.pk-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-size {
	min-width: 42px; padding: 8px 10px;
	border: 2px solid var(--pk-border); background: #fff; border-radius: 8px;
	cursor: pointer; font-weight: 600; font: inherit; color: inherit; line-height: 1;
}
.pk-size.is-active { border-color: var(--pk-teal); color: var(--pk-teal); }
.pk-qty { display: inline-flex; align-items: center; border: 2px solid var(--pk-border); border-radius: 8px; background:#fff; overflow:hidden; }
.pk-qty__btn {
	width: 36px; height: 38px; border: 0; background: #f1f6f5; cursor: pointer;
	font-size: 20px; color: var(--pk-teal); line-height: 1;
}
.pk-qty__btn:hover { background: #e3efed; }
.pk-qty__input { width: 56px; height: 38px; border: 0; text-align: center; font-size: 15px; font-weight: 600; -moz-appearance: textfield; }
.pk-qty__input::-webkit-outer-spin-button, .pk-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Editor */
.pk-editor {
	border: 1px solid var(--pk-border);
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
}
.pk-editor__head {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
	background: var(--pk-teal); color: #fff; padding: 12px 16px;
}
.pk-editor__title { font-size: 16px; }
.pk-editor__title strong {
	background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 6px; margin: 0 3px; display: inline-block;
}

/* toggle switch (NOT an eye icon) */
.pk-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; }
.pk-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pk-switch__track {
	width: 38px; height: 20px; border-radius: 999px; background: rgba(255,255,255,.35);
	position: relative; transition: background .15s; flex: 0 0 38px;
}
.pk-switch__track::after {
	content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
	background: #fff; border-radius: 50%; transition: transform .15s;
}
.pk-switch input:checked + .pk-switch__track { background: #b9540a; }
.pk-switch input:checked + .pk-switch__track::after { transform: translateX(18px); }

/* stage on the left, tools sidebar on the right; tools scales up on wide screens
   (clamped) so the sidebar isn't cramped and the stage isn't an empty ocean */
.pk-editor__body { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 32%, 560px); gap: 0; }
/* allow grid/flex children to shrink below their content's intrinsic width
   (the Fabric canvas is 520px intrinsic and would otherwise force overflow) */
.pk-editor__body > * { min-width: 0; }
.pk-stage, .pk-tools { min-width: 0; }

@media (max-width: 880px) {
	.pk-app { grid-template-columns: 1fr; }
	.pk-editor__body { grid-template-columns: 1fr; }
	/* product list becomes a horizontal grid on top */
	.pk-products { flex-direction: row; flex-wrap: wrap; position: static; }
	.pk-products .pk-product { flex: 1 1 calc(50% - 4px); }
	/* action bar: price block aligns left when it wraps under the controls */
	.pk-actions__field--price { margin-left: 0; text-align: left; }
	.pk-actions__total-row { justify-content: flex-start; }
	/* tools panel sits below the stage, full width */
	.pk-tools { border-left: 0; border-top: 1px solid var(--pk-border); }
	/* scale the design area down so it isn't edge-to-edge */
	.pk-canvas-wrap { max-width: 440px; }
}

@media (max-width: 520px) {
	.pk-products .pk-product { flex: 1 1 100%; }
	.pk-editor__head { gap: 8px; }
	.pk-editor__title { font-size: 15px; }
	.pk-stage { padding: 12px; }
	.pk-canvas-wrap { max-width: min(360px, 84vw); }
	.pk-preview { left: 10px; bottom: 10px; width: 76px; }
	.pk-preview-canvas { width: 64px; height: 64px; }
	.pk-actions { flex-direction: column; align-items: stretch; }
	.pk-actions__buttons { flex-direction: column; }
	.pk-actions__buttons .pk-btn { width: 100%; }
}

/* very small phones (≤380px) */
@media (max-width: 380px) {
	.pk-app { font-size: 14px; }
	.pk-actions__label { font-size: 11px; }
	.pk-stage { padding: 8px; }
	.pk-canvas-wrap { max-width: 88vw; }
	.pk-stage__toolbar { gap: 4px; }
	.pk-tbtn { padding: 5px 8px; font-size: 12px; }
	/* tool tabs wrap to a 2×2 grid instead of squeezing into one row */
	.pk-tools__tabs { flex-wrap: wrap; }
	.pk-tab { flex: 1 1 50%; padding: 10px 4px; font-size: 11px; }
	.pk-tools__panels { padding: 12px; }
	.pk-size { min-width: 38px; padding: 7px 9px; }
	.pk-qty__btn { width: 34px; height: 36px; }
	.pk-actions__total { font-size: 22px; }
	.pk-editor__head { padding: 10px 12px; }
	.pk-editor__guides { gap: 10px; }
	.pk-switch__text { font-size: 12px; }
	.pk-preview { width: 64px; left: 8px; bottom: 8px; padding: 4px; }
	.pk-preview-canvas { width: 54px; height: 54px; }
	.pk-palette { gap: 5px; }
}

/* Stage */
.pk-stage { position: relative; padding: 16px; display: flex; flex-direction: column; align-items: center; background: #fbfdfd; }
.pk-stage__toolbar { align-self: stretch; display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pk-tbtn {
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid var(--pk-border); background: #fff; border-radius: 7px;
	padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--pk-text);
	transition: border-color .15s, color .15s;
}
.pk-tbtn:hover { color: var(--pk-teal); }
.pk-tbtn:hover { border-color: var(--pk-teal); }
/* fluid width that resolves against the stage (definite), capped at 520 —
   no shrink-wrap collapse, no intrinsic-520 overflow */
/* --pk-canvas-aspect is set from JS: the canvas box follows the product's shape,
   so a mug wrap is short and wide instead of padded into a square. */
.pk-canvas-wrap { position: relative; width: 100%; max-width: 640px; margin: 0 auto; }
.pk-canvas { touch-action: none; }
/* make the Fabric canvas scale down responsively (buffer stays 520px) */
.pk-canvas-wrap .canvas-container {
	width: 100% !important; height: auto !important; max-width: 100% !important;
	aspect-ratio: var(--pk-canvas-aspect, 1 / 1);
}
.pk-canvas-wrap .canvas-container canvas { width: 100% !important; height: 100% !important; max-width: 100% !important; }
.pk-preview {
	position: absolute; left: 16px; bottom: 16px; width: 96px; text-align: center;
	background: #fff; border: 1px solid var(--pk-border); border-radius: 10px; padding: 6px;
	box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.pk-preview-canvas { width: 84px; height: 84px; }
.pk-preview__label { display: block; font-size: 11px; color: var(--pk-muted); margin-top: 2px; }

/* Tools */
.pk-tools { border-left: 1px solid var(--pk-border); display: flex; flex-direction: column; }
.pk-tools__tabs { display: flex; border-bottom: 1px solid var(--pk-border); }
.pk-tab {
	flex: 1; border: 0; background: #f4f8f7; padding: 10px 6px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
	color: var(--pk-muted); border-bottom: 3px solid transparent;
	display: flex; flex-direction: column; align-items: center; gap: 5px; line-height: 1.2;
	transition: color .15s, background .15s;
}
.pk-tab .pk-ico { width: 20px; height: 20px; }
.pk-tab:hover { color: var(--pk-teal); }
.pk-tab.is-active { background: #fff; color: var(--pk-teal); border-bottom-color: var(--pk-teal); }
.pk-tools__panels { padding: 16px; }
.pk-panel { display: none; }
.pk-panel.is-active { display: block; }
.pk-panel__title { font-size: 13px; font-weight: 700; color: var(--pk-muted); margin: 0 0 8px; }
.pk-panel__note { font-size: 12px; color: var(--pk-muted); margin-top: 10px; }

/* Cream-tinted, padded container: the gaps are no longer bright white, which
   kills the scintillating-grid illusion (grey dots) between the swatches. */
.pk-palette {
	display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
	background: var(--pk-bg); padding: 9px; border-radius: 12px;
}
.pk-swatch {
	width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(0,0,0,.08);
	cursor: pointer; padding: 0; position: relative;
}
.pk-swatch.is-active { outline: 2px solid var(--pk-teal); outline-offset: 2px; }
/* first tile: custom colour picker */
.pk-swatch--custom {
	display: flex; align-items: center; justify-content: center;
	background: conic-gradient(from 0deg, #f37f1c, #e84393, #6c5ce7, #0984e3, #00b894, #fdcb6e, #f37f1c);
}
.pk-swatch__ico { font-size: 15px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
/* visually hidden but still rendered, so .click() can open the native picker */
.pk-bg-custom { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

.pk-dropzone { border: 2px dashed var(--pk-border); border-radius: 10px; padding: 26px 14px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.pk-dropzone.is-over { border-color: var(--pk-teal); background: #f0faf8; }
/* .pk-ico is display:block, so it ignores the dropzone's text-align:center —
   centre it explicitly instead of relying on inline layout. */
.pk-dropzone__icon { display: flex; justify-content: center; margin-bottom: 8px; color: var(--pk-teal); }
.pk-dropzone__icon .pk-ico { width: 30px; height: 30px; }
.pk-dropzone__hint { font-size: 13px; color: var(--pk-muted); }

/* media library */
.pk-media__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-media__item {
	position: relative; aspect-ratio: 1; border: 1px solid var(--pk-border); border-radius: 8px;
	overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s;
	background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.pk-media__item:hover { border-color: var(--pk-teal); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.pk-media__img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.pk-media__del {
	position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; line-height: 18px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(45,42,38,.72); color: #fff; font-size: 14px;
	cursor: pointer; opacity: 0; transition: opacity .12s;
}
.pk-media__item:hover .pk-media__del, .pk-media__del:focus { opacity: 1; }
.pk-media__empty { font-size: 13px; color: var(--pk-muted); margin: 4px 0 0; }
.pk-panel__title--spaced { margin-top: 16px; }

/* my projects (past orders) */
.pk-projects__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pk-proj {
	display: flex; flex-direction: column; border: 1px solid var(--pk-border); border-radius: 10px;
	overflow: hidden; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.pk-proj:hover { border-color: var(--pk-teal); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pk-proj__img, .pk-proj__ph {
	width: 100%; aspect-ratio: 1; display: block;
	background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.pk-proj__img { object-fit: contain; }
.pk-proj__ph { display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--pk-muted); background: #f4f8f7; }
.pk-proj__meta { padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pk-proj__title { font-size: 12px; font-weight: 700; color: var(--pk-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-proj__sub { font-size: 11px; color: var(--pk-muted); }
.pk-projects__login, .pk-projects__empty { font-size: 13px; color: var(--pk-muted); margin: 4px 0 0; }

/* project action modal */
.pk-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.pk-modal[hidden] { display: none; }
.pk-modal__backdrop { position: absolute; inset: 0; background: rgba(20,18,16,.55); }
.pk-modal__box {
	position: relative; z-index: 1; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto;
	background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center;
}
.pk-modal__close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--pk-muted); cursor: pointer; }
.pk-modal__preview {
	width: 130px; height: 130px; margin: 4px auto 12px; border: 1px solid var(--pk-border); border-radius: 10px; overflow: hidden;
	background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.pk-modal__preview img { width: 100%; height: 100%; object-fit: contain; }
.pk-modal__title { font-size: 16px; font-weight: 800; color: var(--pk-text); }
.pk-modal__sub { font-size: 13px; color: var(--pk-muted); margin-bottom: 14px; }
.pk-modal__explain { text-align: left; margin: 0 0 16px; display: flex; flex-direction: column; gap: 9px; }
.pk-modal__explain p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--pk-text); }
.pk-modal__explain strong { color: var(--pk-teal); }
.pk-modal__actions { display: flex; gap: 10px; }
.pk-modal__actions .pk-btn { flex: 1; }
.pk-modal__qty-label { display: block; font-size: 13px; font-weight: 600; color: var(--pk-text); }
.pk-modal__qty-input { display: block; width: 120px; margin: 8px auto 14px; padding: 10px; font: inherit; text-align: center; border: 1px solid var(--pk-border); border-radius: 8px; }

/* Desktop: a bit roomier modal with larger title / size / description (buttons unchanged). */
@media (min-width: 881px) {
	.pk-modal__box { width: min(500px, calc(100vw - 32px)); padding: 28px 30px; }
	.pk-modal__preview { width: 150px; height: 150px; }
	.pk-modal__title { font-size: 22px; }
	.pk-modal__sub { font-size: 16px; margin-bottom: 18px; }
	.pk-modal__explain p { font-size: 15px; line-height: 1.55; }
	.pk-modal__qty-label { font-size: 15px; }
}

.pk-text-input { width: 100%; border: 1px solid var(--pk-border); border-radius: 8px; padding: 8px; font: inherit; resize: vertical; }
.pk-text-controls { display: flex; gap: 10px; margin: 10px 0; align-items: center; font-size: 13px; }
.pk-text-controls select { padding: 6px; border-radius: 6px; border: 1px solid var(--pk-border); }
.pk-text-color, .pk-text-shadow-color { width: 38px; height: 32px; border: 1px solid var(--pk-border); border-radius: 6px; }

/* buttons */
.pk-btn { border: 0; border-radius: 9px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.pk-btn--primary { background: var(--pk-accent); color: #fff; }
.pk-btn--primary:hover { background: var(--pk-accent-d); }
.pk-btn--ghost { background: #fff; color: var(--pk-text); border: 1px solid var(--pk-border); }
.pk-btn--ghost:hover { border-color: var(--pk-accent); color: var(--pk-accent); }
.pk-btn[disabled] { opacity: .6; cursor: default; }
.pk-add-text { margin-top: 6px; background: var(--pk-teal); color: #fff; width: 100%; }

/* bucket: multiple designs in one order */
.pk-bucket { border-top: 1px solid var(--pk-border); padding: 12px 16px; background: #fafdfc; }
.pk-bucket__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pk-bucket__title { font-weight: 700; }
.pk-bucket__count { color: var(--pk-muted); font-size: 13px; }
.pk-bucket__items { display: flex; gap: 10px; flex-wrap: wrap; }
.pk-bitem { width: 92px; border: 2px solid var(--pk-border); border-radius: 8px; padding: 6px; text-align: center; position: relative; background:#fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pk-bitem:hover { border-color: var(--pk-teal); }
.pk-bitem.is-active { border-color: var(--pk-teal); box-shadow: 0 0 0 3px rgba(43,182,163,.22); }
.pk-bitem.is-empty { border-style: dashed; }
.pk-bitem img { width: 78px; height: 78px; object-fit: contain; pointer-events: none; }
.pk-bitem__ph { display: flex; align-items: center; justify-content: center; width: 78px; height: 78px; font-size: 30px; color: var(--pk-muted); pointer-events: none; }
.pk-bitem__meta { font-size: 11px; color: var(--pk-muted); pointer-events: none; }
.pk-bitem__del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--pk-accent); color: #fff; cursor: pointer; line-height: 1; z-index: 2; }
.pk-bucket__hint { font-size: 11px; color: var(--pk-muted); margin: 0 0 6px; }

/* footer action bar: size · qty · price · CTAs, all in one consolidated row */
.pk-actions {
	display: flex; align-items: center; flex-wrap: wrap; gap: 20px 26px;
	padding: 16px 20px; border-top: 1px solid var(--pk-border);
	background: #fff;
}
.pk-actions__field { display: flex; flex-direction: column; justify-content: center; }
.pk-actions__field--price { text-align: right; margin-left: auto; }

/* rabat (tiered pricing) block — fills the empty middle space after size/qty */
.pk-rabat { display: flex; align-items: center; gap: 10px; }
.pk-rabat__badge {
	display: inline-flex; align-items: center; font-weight: 800; font-size: 14px;
	padding: 4px 10px; border-radius: 999px; background: #eef1f0; color: var(--pk-muted); white-space: nowrap;
}
.pk-rabat__badge.is-on { background: #e7f7ee; color: #1f8d5a; }
.pk-rabat__btn {
	display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pk-border); background: #fff;
	border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
	color: var(--pk-text); transition: border-color .15s, color .15s;
}
.pk-rabat__btn:hover { border-color: var(--pk-teal); color: var(--pk-teal); }
.pk-rabat__btn-ico { font-size: 13px; line-height: 1; }
.pk-rabat__hint { font-size: 12px; color: var(--pk-muted); margin-top: 5px; min-height: 14px; }

/* current design (secondary) vs whole-order total (primary) */
.pk-actions__cur { font-size: 12px; color: var(--pk-muted); margin-bottom: 3px; }
.pk-actions__cur .pk-cur-total { color: var(--pk-text); font-weight: 700; }
.pk-actions__total-row { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.pk-actions__total { font-size: 26px; font-weight: 800; color: var(--pk-text); line-height: 1.1; }
.pk-actions__tax { color: var(--pk-muted); font-size: 13px; }
.pk-order-meta { font-size: 12px; color: var(--pk-muted); margin-top: 2px; min-height: 14px; }
.pk-actions__buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (min-width: 881px) {
	/* thin dividers between grouped fields */
	.pk-actions__field--qty, .pk-actions__field--rabat, .pk-actions__buttons { position: relative; }
	.pk-actions__field--qty::before, .pk-actions__field--rabat::before, .pk-actions__buttons::before {
		content: ""; position: absolute; left: -13px; top: 50%; transform: translateY(-50%);
		width: 1px; height: 44px; background: var(--pk-border);
	}
}

/* tiered-pricing table modal */
.pk-tiermodal { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; }
.pk-tiermodal[hidden] { display: none; }
.pk-tiermodal__box { position: relative; z-index: 1; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; text-align: left; }
.pk-tiermodal__close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--pk-muted); cursor: pointer; }
.pk-tiermodal__title { margin: 0 0 2px; font-size: 18px; color: var(--pk-text); }
.pk-tiermodal__sub { margin: 0 0 14px; font-size: 13px; color: var(--pk-muted); }
.pk-tiermodal__note { font-size: 12px; color: var(--pk-muted); margin: 12px 0 0; }
.pk-tiermodal__empty { font-size: 14px; color: var(--pk-muted); }
.pk-tiertable { width: 100%; border-collapse: collapse; font-size: 14px; }
.pk-tiertable th, .pk-tiertable td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--pk-border); }
.pk-tiertable th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--pk-muted); font-weight: 700; }
.pk-tiertable td:nth-child(2), .pk-tiertable td:nth-child(3), .pk-tiertable th:nth-child(2), .pk-tiertable th:nth-child(3) { text-align: right; }
.pk-tiertable td:nth-child(2) { font-weight: 700; color: var(--pk-text); }
.pk-tiertable td:nth-child(3) { color: #1f8d5a; font-weight: 700; }
.pk-tiertable tr.is-active td { background: #fff6ec; }
.pk-tiertable tr.is-active td:first-child { box-shadow: inset 3px 0 0 var(--pk-teal); }

/* order confirmation modal */
.pk-ordermodal { position: fixed; inset: 0; z-index: 100002; display: flex; align-items: center; justify-content: center; }
.pk-ordermodal[hidden] { display: none; }
.pk-ordermodal__box { position: relative; z-index: 1; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; text-align: left; }
.pk-ordermodal__close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--pk-muted); cursor: pointer; }
.pk-ordermodal__title { margin: 0 0 8px; font-size: 19px; color: var(--pk-text); }
.pk-ordermodal__lead { margin: 0 0 14px; font-size: 14px; color: var(--pk-muted); line-height: 1.5; }
.pk-ordersum__list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--pk-border); border-radius: 10px; overflow: hidden; }
.pk-ordersum__list li { display: flex; justify-content: space-between; padding: 9px 12px; font-size: 14px; }
.pk-ordersum__list li + li { border-top: 1px solid var(--pk-border); }
.pk-ordersum__list li span:first-child { font-weight: 600; color: var(--pk-text); }
.pk-ordersum__list li span:last-child { color: var(--pk-muted); }
.pk-ordersum__totals { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 2px 16px; }
.pk-ordersum__totals span { color: var(--pk-muted); font-size: 13px; }
.pk-ordersum__totals strong { font-size: 22px; color: var(--pk-text); }
.pk-ordermodal__actions { display: flex; gap: 10px; }
.pk-ordermodal__actions .pk-btn { flex: 1; }

/* toast */
.pk-toast {
	position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
	background: #2d3436; color: #fff; padding: 12px 20px; border-radius: 10px; z-index: 99999;
	box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 600;
}
.pk-toast.is-error { background: #c0392b; }
.pk-toast.is-ok { background: #b9540a; }

/* custom size chip + dims */
.pk-size--custom { font-style: normal; }
.pk-custom-dims { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; font-size: 13px; }
.pk-custom-dims input { width: 70px; padding: 6px; border: 2px solid var(--pk-border); border-radius: 7px; }
.pk-custom-dims .pk-cd-x { color: var(--pk-muted); }
.pk-custom-dims .pk-cd-range { color: var(--pk-muted); font-size: 12px; }

/* loading overlay – covers the WHOLE creator (menu + controls + editor) */
.pk-app { position: relative; }
.pk-loading {
	position: absolute; inset: 0; z-index: 1000;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .8); backdrop-filter: blur(2px);
}
.pk-loading__box {
	display: flex; flex-direction: column; align-items: center; gap: 14px;
	background: #fff; padding: 28px 34px; border-radius: 16px;
	border: 1px solid var(--pk-border); box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
.pk-spinner {
	width: 52px; height: 52px; border-radius: 50%;
	border: 5px solid var(--pk-border); border-top-color: var(--pk-accent);
	animation: pk-spin .8s linear infinite;
}
@keyframes pk-spin { to { transform: rotate(360deg); } }
.pk-loading__text { font-weight: 700; color: var(--pk-accent-d); font-size: 15px; }
.pk-loading__cancel {
	border: 1.5px solid var(--pk-border); background: #fff; color: var(--pk-text);
	padding: 8px 22px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer;
	transition: border-color .15s, color .15s;
}
.pk-loading__cancel:hover { border-color: var(--pk-accent); color: var(--pk-accent); }

/* curved text controls */
.pk-arc-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 13px; cursor: pointer; }
.pk-arc-opts { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--pk-bg); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }

/* segmented arc direction picker */
.pk-arc-dirs { display: flex; gap: 8px; }
.pk-arc-dir {
	flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 8px 10px; border: 1px solid var(--pk-border); background: #fff; border-radius: 8px;
	font: inherit; font-size: 12px; font-weight: 600; color: var(--pk-muted); cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.pk-arc-dir:hover { border-color: var(--pk-teal); color: var(--pk-teal); }
.pk-arc-dir.is-active { border-color: var(--pk-teal); color: var(--pk-teal); background: var(--pk-bg); }

/* text shadow: same boxed options as the arc, colour swatch on the right */
.pk-shadow-opts { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--pk-bg); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.pk-shadow-opts[hidden] { display: none; }
.pk-shadow-color { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* labelled slider used by both font size and arc sweep */
.pk-range { display: block; font-size: 13px; }
.pk-range + .pk-range { margin-top: 10px; }
.pk-range__label { display: block; margin-bottom: 4px; color: var(--pk-muted); }
.pk-range input[type=range] { width: 100%; accent-color: var(--pk-accent); }

/* text panel */
.pk-text-input { width: 100%; padding: 9px 10px; border: 1px solid var(--pk-border); border-radius: 8px; font: inherit; font-size: 14px; resize: vertical; }
.pk-text-input:focus { outline: 2px solid var(--pk-teal); outline-offset: -1px; border-color: var(--pk-teal); }
.pk-text-hint { margin-top: 0; margin-bottom: 10px; }
.pk-text-actions { display: flex; gap: 8px; margin-top: 12px; }
.pk-text-actions .pk-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
/* "Usuń napis" sits content-sized like "+ Dodaj kolejny wzór" in the footer; the primary takes the rest */
.pk-text-actions .pk-text-delete { flex: 0 0 auto; }
.pk-text-actions .pk-text-delete .pk-ico { width: 16px; height: 16px; }
.pk-panel[data-panel="text"].is-editing .pk-text-hint { color: var(--pk-teal); font-weight: 600; }

.pk-empty { padding: 18px; border: 1px dashed var(--pk-border); border-radius: 10px; color: var(--pk-muted); }
.pk-cart-badge { font-size: 11px; color: #e84393; }


/* ---- icon system: one 24×24 stroke language, inherits currentColor ---- */
.pk-ico { width: 18px; height: 18px; flex: none; display: block; }
.pk-rabat__btn-ico { width: 15px; height: 15px; }
.pk-modal__close .pk-ico, .pk-ordermodal__close .pk-ico, .pk-tiermodal__close .pk-ico { width: 20px; height: 20px; }

/* head bar keeps only the rounded-corners switch */
.pk-editor__guides { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.pk-switch__text { color: #fff; }

/* ---- searchable font picker ---- */
.pk-fontpick-wrap { flex: 1; min-width: 0; }
.pk-fontpick { position: relative; display: block; margin-top: 4px; }
.pk-fontpick__btn {
	width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 8px 10px; border: 1px solid var(--pk-border); border-radius: 8px; background: #fff;
	font: inherit; font-size: 14px; color: var(--pk-text); cursor: pointer; text-align: left;
}
.pk-fontpick__btn:hover { border-color: var(--pk-teal); }
.pk-fontpick__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-fontpick__caret { width: 16px; height: 16px; color: var(--pk-muted); }
/* Fixed, not absolute: the tools panel scrolls (overflow-y:auto) and would
   otherwise clip the list and grow its own scrollbar. Position comes from JS. */
.pk-fontpick__pop {
	position: fixed; z-index: 100010;
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--pk-border); border-radius: 10px;
	box-shadow: 0 14px 34px rgba(0,0,0,.18); overflow: hidden;
}
.pk-fontpick__search {
	border: 0; border-bottom: 1px solid var(--pk-border); padding: 10px 12px;
	font: inherit; font-size: 13px; outline: none; width: 100%;
}
.pk-fontpick__list { display: block; max-height: 260px; overflow-y: auto; padding: 4px; }
.pk-fontpick__opt {
	display: block; width: 100%; text-align: left; border: 0; background: transparent;
	padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1.3;
	color: var(--pk-text);
}
.pk-fontpick__opt:hover { background: var(--pk-bg); }
.pk-fontpick__opt.is-active { background: var(--pk-bg); box-shadow: inset 0 0 0 1px var(--pk-teal); }
.pk-fontpick__empty { display: block; padding: 12px; font-size: 13px; color: var(--pk-muted); }
.pk-fontpick__group {
	display: block; padding: 12px 10px 4px; font-size: 11px; font-weight: 700; line-height: 1.2;
	letter-spacing: .06em; text-transform: uppercase; color: var(--pk-muted);
}
.pk-fontpick__group:first-child { padding-top: 6px; }
.pk-fontpick__group[hidden], .pk-fontpick__opt[hidden] { display: none; }
.pk-text-controls { flex-wrap: wrap; align-items: flex-end; }

/* ---- single-product embed: no picker, editor uses the whole width ----
   Appended last so it also overrides the two-column rule inside the
   min-width:881px breakout block above. */
.pk-app--single { grid-template-columns: 1fr; }
.pk-app--single .pk-products { display: none; }

/* ---- product mock-up behind the print area (e.g. a white mug) ----
   A DOM image, so it is never part of the exported artwork. */
.pk-mockup {
	position: absolute;
	z-index: 0;
	max-width: none;
	pointer-events: none;
	user-select: none;
}
.pk-canvas-wrap .canvas-container { position: relative; z-index: 1; }

/* ---- full-screen creator overlay on the product page ---- */
.pk-open-creator {
	display: inline-block; border: 0; border-radius: 9px; padding: 12px 22px;
	background: var(--pk-accent, #f37f1c); color: #fff; font: inherit; font-weight: 700;
	cursor: pointer; line-height: 1.2;
}
.pk-open-creator:hover { background: var(--pk-accent-d, #d96a10); }
.pk-fullscreen {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; flex-direction: column; background: #fff;
}
.pk-fullscreen[hidden] { display: none; }
body.pk-fullscreen-open { overflow: hidden; }
.pk-fullscreen__bar {
	flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 10px 16px; background: #f37f1c; color: #fff;
}
.pk-fullscreen__title { font-weight: 700; font-size: 15px; }
.pk-fullscreen__close {
	display: inline-flex; align-items: center; gap: 7px;
	border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff;
	border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.pk-fullscreen__close:hover { background: rgba(255,255,255,.15); }
.pk-fullscreen__body { flex: 1; overflow: auto; padding: 14px 0 40px; }
/* inside the overlay the app is already the whole page — drop the viewport breakout */
.pk-fullscreen .pk-app { width: auto; max-width: 1400px; left: auto; right: auto; margin: 0 auto; }

/* ---- tools moved onto the head bar, panel opens as a floating sheet ---- */
.pk-editor__topbar { position: relative; z-index: 30; }
.pk-editor__head { flex-wrap: wrap; row-gap: 8px; }

.pk-editor__head .pk-tools__tabs {
	display: flex; gap: 4px; border-bottom: 0; background: transparent;
	margin-left: auto; flex-wrap: wrap;
}
.pk-editor__head .pk-tab {
	flex: 0 0 auto;
	flex-direction: row; gap: 7px;
	background: transparent; color: #fff;
	border-bottom: 0; border-radius: 8px;
	padding: 8px 12px; font-size: 13px;
}
.pk-editor__head .pk-tab:hover { background: rgba(255,255,255,.18); color: #fff; }
.pk-editor__head .pk-tab.is-active { background: #fff; color: var(--pk-teal); }
.pk-editor__head .pk-tab .pk-ico { width: 18px; height: 18px; }

/* the panel itself: anchored under the bar, above the stage */
.pk-editor__topbar .pk-tools {
	position: absolute;
	top: calc(100% + 8px);
	right: 12px;
	width: min(440px, calc(100% - 24px));
	max-height: min(70vh, 560px);
	overflow-y: auto;
	display: block;
	background: #fff;
	border: 1px solid var(--pk-border);
	border-left: 1px solid var(--pk-border);
	border-radius: 12px;
	box-shadow: 0 18px 42px rgba(0,0,0,.18);
	z-index: 40;
}
.pk-editor__topbar .pk-tools[hidden] { display: none; }

/* the stage now owns the full width of the editor */
.pk-editor__body { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 880px) {
	.pk-editor__head .pk-tools__tabs { margin-left: 0; width: 100%; }
	.pk-editor__head .pk-tab { flex: 1 1 auto; justify-content: center; }
	.pk-editor__topbar .pk-tools { left: 8px; right: 8px; width: auto; }
}
@media (max-width: 520px) {
	.pk-editor__head .pk-tab { padding: 7px 9px; font-size: 12px; }
	.pk-editor__head .pk-tab span { display: none; }   /* icons only when space is tight */
	.pk-editor__head .pk-tab .pk-ico { width: 20px; height: 20px; }
}

/* The floating panel hangs below the head bar, so the editor must not clip it.
   Rounded corners move onto the two elements that actually touch them. */
.pk-editor { overflow: visible; }
.pk-editor__head { border-radius: 11px 11px 0 0; }
.pk-actions { border-radius: 0 0 11px 11px; }
