/* Beelol Product Extras — sticker configurator */

@font-face {
	font-family: 'Quicksand';
	font-weight: 300 700;
	src: url('../fonts/Quicksand-Bold.ttf') format('truetype');
	font-display: swap;
}

@font-face {
	font-family: 'Dancing Script';
	font-weight: 300 700;
	src: url('../fonts/DancingScript-Bold.ttf') format('truetype');
	font-display: swap;
}

.bpe-configurator {
	margin: 0 0 1.5em;
	width: 100%;
	max-width: 640px;
	/* form.cart may lay children out as flex row — claim the full row and allow
	   shrinking below intrinsic size so the widget never overflows the page. */
	flex-basis: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.bpe-configurator *,
.bpe-configurator *::before,
.bpe-configurator *::after {
	box-sizing: border-box;
}

/* ─── Previews ─────────────────────────────────────────────────────────── */

.bpe-previews {
	display: flex;
	gap: 16px;
	margin-bottom: 1.2em;
}

.bpe-preview-pane {
	flex: 1 1 0;
	min-width: 0;
	text-align: center;
}

.bpe-preview-label {
	display: block;
	margin-top: 6px;
	font-size: 0.85em;
	color: #666;
}

.bpe-preview-sticker {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: repeating-conic-gradient(#f2f2f2 0% 25%, #fdfdfd 0% 50%) 50% / 24px 24px;
	border-radius: 8px;
	padding: 10%;
}

.bpe-preview-sticker svg {
	width: 100%;
	height: auto;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}

.bpe-mockup {
	aspect-ratio: 1;
	position: relative;
	background-size: cover;
	background-position: center;
	border-radius: 8px;
	overflow: hidden;
}

.bpe-mockup-overlay {
	position: absolute;
	aspect-ratio: 1;
	/* Tilts hinge on the left/top edges, so the top-left corner stays exactly
	   where the admin position fields (Pozícia X/Y) anchor it. */
	transform-origin: left top;
}

.bpe-mockup-overlay svg {
	width: 100%;
	height: auto;
	display: block;
}

/* ─── Pickers ──────────────────────────────────────────────────────────── */

.bpe-field {
	border: 0;
	padding: 0;
	margin: 0 0 1em;
}

.bpe-field legend,
.bpe-field > label strong {
	font-weight: 600;
	margin-bottom: 0.4em;
	display: inline-block;
}

.bpe-field input[type='radio'] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

/* Shape chips */
.bpe-shape-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 12px 6px 0;
	padding: 6px 12px;
	border: 2px solid #ddd;
	border-radius: 999px;
	cursor: pointer;
	user-select: none;
}

.bpe-shape-option:has(input:checked) {
	border-color: orange;
	background: #fff7ea;
}

.bpe-shape-chip {
	width: 24px;
	height: 24px;
	color: #444;
}

.bpe-shape-chip svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Color swatches */
.bpe-swatch {
	display: inline-block;
	margin: 0 6px 6px 0;
	cursor: pointer;
}

.bpe-swatch-dot {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid #ccc;
	box-shadow: inset 0 0 0 2px #fff;
}

.bpe-swatch:has(input:checked) .bpe-swatch-dot {
	border-color: orange;
	box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px orange;
}

.bpe-swatch-rainbow {
	background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
}

.bpe-custom-color {
	display: none;
	vertical-align: top;
	width: 48px;
	height: 34px;
	padding: 0 2px;
	border: 1px solid #ccc;
	border-radius: 6px;
	cursor: pointer;
}

.bpe-custom-color.bpe-visible {
	display: inline-block;
}

/* Gradient controls */
.bpe-gradient-toggle {
	display: block;
	margin-top: 6px;
	cursor: pointer;
}

.bpe-gradient-only {
	display: none;
}

.bpe-gradient-only.bpe-visible {
	display: block;
}

.bpe-dirs {
	margin-top: 6px;
}

.bpe-dirs-label {
	margin-right: 6px;
	font-size: 0.9em;
	color: #555;
}

.bpe-dir-option {
	display: inline-block;
	margin-right: 6px;
	cursor: pointer;
}

.bpe-dir-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 2px solid #ddd;
	border-radius: 8px;
	font-size: 18px;
	line-height: 1;
	user-select: none;
}

.bpe-dir-option:has(input:checked) .bpe-dir-chip {
	border-color: orange;
	background: #fff7ea;
}

/* Font picker — labels render in their own typeface */
.bpe-font-option {
	display: inline-flex;
	align-items: center;
	margin: 0 12px 6px 0;
	padding: 4px 16px;
	border: 2px solid #ddd;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.15em;
	user-select: none;
}

.bpe-font-option:has(input:checked) {
	border-color: orange;
	background: #fff7ea;
}

.bpe-font-zaoblene {
	font-family: 'Quicksand', sans-serif;
	font-weight: 700;
}

.bpe-font-ozdobne {
	font-family: 'Dancing Script', cursive;
	font-weight: 700;
}

/* Text */
.bpe-configurator textarea {
	width: 100%;
	max-width: 420px;
	min-width: 0;
	display: block;
	margin-top: 4px;
	font-family: 'Quicksand', sans-serif;
	font-weight: 700;
	resize: vertical;
}

/* The theme's price box (.cena-kosik) uses width:max-content, sized for a bare
   qty+button row — with the configurator inside it grows past the viewport.
   Scoped to configurator products so other product pages keep their layout. */
body.bpe-product .cena-kosik {
	width: auto;
	max-width: 100%;
}

/* ─── Restore the add-to-cart button hidden by the beelol theme ─────────── */
/* The theme hides .single_add_to_cart_button globally because beelol-cart-controls
   replaces it; configurator products use the classic form so the fields submit. */

body.single-product.bpe-product form.cart .single_add_to_cart_button {
	display: inline-block !important;
}

@media (max-width: 768px) {
	.bpe-previews {
		flex-direction: column;
	}
}
