/**
 * Shared storefront builder styles (simple + advance).
 * Canvas toolbar, zoom controls, and toolbar icon backgrounds.
 *
 * @package CustomProductBuilderProWC
 */

/* UI chrome uses Poppins on every builder surface */
.cpbpwc-main-designer-container,
.cpbpwc-advance-builder,
.wrapper-memes-main,
.cpbpwc-textbox-header,
.wrapper-text,
.wrapper-memes-preview-operations,
.cpb-canvas-toolbar,
[data-cpb-tooltip]::after {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toolbar icon backgrounds */
.cpbpwc-main-designer-container .moreOption,
.cpbpwc-advance-builder .moreOption {
	background-image: url(../images/gear.svg);
}

.cpbpwc-main-designer-container .delete-box-amm,
.cpbpwc-advance-builder .delete-box-amm {
	background-image: url(../images/x.svg);
}

/* Toolbar row inside preview operations */
.wrapper-memes-preview-operations > .cpb-canvas-toolbar-wrap {
	flex-basis: 100%;
	width: 100%;
}

.cpb-canvas-toolbar-wrap {
	display: flex;
	justify-content: center;
	width: 100%;
	padding: 8px 10px 4px;
	margin-top: 4px;
	box-sizing: border-box;
	position: relative;
	z-index: 25;
	overflow: visible;
}

.cpb-canvas-toolbar {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	padding: 6px 10px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
	overflow: visible;
}

.wrapper-memes-preview-operations .cpb-canvas-toolbar .cpb-tbar-btn {
	width: 38px;
	height: 38px;
	min-width: 38px;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	font-weight: 600;
	gap: 0;
}

.wrapper-memes-preview-operations .cpb-canvas-toolbar .cpb-tbar-btn::before {
	content: none;
	display: none;
	width: 0;
	height: 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: none;
	background-image: none;
}

.cpb-tbar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 10px;
	background: #ffffff;
	color: #475569;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
	position: relative;
	overflow: visible;
}

.cpb-tbar-btn:hover:not(:disabled) {
	background: #eff6ff;
	color: #1d4ed8;
}

.cpb-tbar-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.cpb-tbar-svg {
	width: 20px;
	height: 20px;
	display: block;
}

.cpb-tbar-zoom {
	font-size: 24px;
	font-weight: 300;
	line-height: 1;
	display: block;
	margin-top: -2px;
}

.cpb-tbar-sep {
	width: 1px;
	height: 24px;
	background: #cbd5e1;
	margin: 0 4px;
	flex-shrink: 0;
}

.cpb-tbar-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cpb-canvas-toolbar-wrap .cpb-side-select-wrap {
	position: static;
	left: auto;
	top: auto;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 0;
}

.cpb-side-select-wrap {
	display: none;
	align-items: center;
	gap: 6px;
}

.cpb-side-select-wrap.cpb-side-select-visible,
.cpb-canvas-toolbar-wrap .cpb-side-select-wrap.cpb-side-select-visible {
	display: flex;
}

.cpbpwc-main-designer-container .cpb-side-select-wrap {
	display: flex;
}

.cpb-canvas-zoom-root {
	transform-origin: center center;
	transition: transform 0.15s ease;
	display: inline-block;
}

.cpb-tbar-select,
.cpb-side-select-wrap .cpb-tbar-select,
.cpb-side-select,
.cpb-side-select.cpb-tbar-select {
	min-width: 120px;
	max-width: 220px;
	height: 38px;
	padding: 0 36px 0 12px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	background-color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	color: #334155;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	cursor: pointer;
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41 0 6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
}

.cpb-tbar-select option,
.cpb-side-select option {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-weight: 500;
}

.imageBoxDR,
.boxDR {
	transform-origin: center center;
	overflow: visible;
}

.cpbpwc-main-designer-container .rotate-box-amm,
.cpbpwc-advance-builder .rotate-box-amm {
	position: absolute;
	left: 50%;
	top: auto;
	bottom: -38px;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3.2-6.9'/%3E%3Cpolyline points='21 3 21 9 15 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
	cursor: grab;
	z-index: 6;
	transform: translateX(-50%);
}

.cpbpwc-main-designer-container .rotate-box-amm:hover,
.cpbpwc-advance-builder .rotate-box-amm:hover,
.cpbpwc-main-designer-container .rotate-box-amm:active,
.cpbpwc-advance-builder .rotate-box-amm:active,
.cpbpwc-main-designer-container .imageBoxDR.is-rotating .rotate-box-amm,
.cpbpwc-advance-builder .imageBoxDR.is-rotating .rotate-box-amm {
	cursor: grabbing;
	background-color: #f8fafc;
	border-color: #cbd5e1;
}

.cpbpwc-main-designer-container .imageBoxDR.is-rotating,
.cpbpwc-advance-builder .imageBoxDR.is-rotating {
	z-index: 30;
}

/* Shared hover tooltips (toolbar + textbox controls) */
[data-cpb-tooltip] {
	position: relative;
	overflow: visible;
}

[data-cpb-tooltip]:hover,
[data-cpb-tooltip]:focus-visible {
	z-index: 10050;
}

[data-cpb-tooltip]::after {
	content: attr(data-cpb-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	padding: 6px 10px;
	background: #1e293b;
	color: #ffffff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
	z-index: 10051;
}

[data-cpb-tooltip]:hover::after,
[data-cpb-tooltip]:focus-visible::after {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.wrapper-text .cpb-textbox-tip,
.wrapper-text .moreOption,
.wrapper-text .cpb-color-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	flex-shrink: 0;
}

/* Color swatch controls (textbox / brush) */
.cpb-color-swatch-group {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.cpb-color-swatch {
	width: 28px;
	height: 28px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	padding: 0;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
}

.cpb-color-swatch.is-active {
	border-color: #3b82f6;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.cpb-color-swatch-hidden {
	display: none;
	visibility: hidden;
	width: 0;
	height: 0;
	padding: 0;
	margin: 0;
	border: none;
	position: absolute;
	pointer-events: none;
}

/* Top icon row: tooltips below so overflow:auto chrome does not clip them */
.wrapper-memes-preview-operations [data-cpb-tooltip]::after {
	bottom: auto;
	top: calc(100% + 8px);
	transform: translateX(-50%) translateY(-4px);
}

.wrapper-memes-preview-operations [data-cpb-tooltip]:hover::after,
.wrapper-memes-preview-operations [data-cpb-tooltip]:focus-visible::after {
	transform: translateX(-50%) translateY(0);
}

/* Touch devices: never show sticky hover tooltips over the toolbar */
@media (hover: none), (pointer: coarse) {
	.wrapper-memes-preview-operations [data-cpb-tooltip]::after {
		content: none;
		display: none;
	}
}

/* Empty designer state (simple + advance) */
#product-designer.cpbwc-empty-designer {
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	box-sizing: border-box;
	padding: 24px;
}

.cpbwc-empty-designer-inner {
	max-width: 420px;
	text-align: center;
}

.cpbwc-empty-designer-text {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: #475569;
}

/* AI-generated clipart badge */
.ai-star-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: transparent;
	border: 0;
	width: auto;
	height: auto;
	color: #cfff13;
	font-size: 18px;
	line-height: 1;
	pointer-events: none;
	z-index: 11;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.65), 0 1px 3px rgba(0, 0, 0, 0.4);
}
