/* KV Product Customizer – storefront styles. Everything is prefixed .kvpc / .kvpc-* */

.kvpc, .kvpc-modal {
	--kvpc-accent: #FF6A00;
	--kvpc-dark: #2b2f3e;
	--kvpc-line: #e4e6eb;
	--kvpc-text: #1f2430;
	--kvpc-muted: #667085;
	font-family: inherit;
	color: var(--kvpc-text);
	box-sizing: border-box;
}
.kvpc *, .kvpc *::before, .kvpc *::after,
.kvpc-modal *, .kvpc-modal *::before, .kvpc-modal *::after { box-sizing: border-box; }
.kvpc [hidden], .kvpc-modal[hidden], .kvpc-modal [hidden] { display: none !important; }
html.kvpc-lock { overflow: hidden; }

.kvpc-wrap { max-width: 100%; min-width: 0; }
.kvpc-card { min-width: 0; }
.kvpc-wrap--sc { width: 100%; }
.kvpc { width: 100%; max-width: 680px; margin: 0 auto 20px; }

/* ---------- card ---------- */
.kvpc-card {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 1px 8px rgba(16, 24, 40, .14);
	overflow: hidden;
}

/* ---------- print sides bar ---------- */
.kvpc .kvpc-sides {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
	gap: 6px 18px; padding: 11px 14px;
	background: var(--kvpc-dark); color: #fff; font-size: 14px; line-height: 1.2;
}
.kvpc .kvpc-sides-label { font-weight: 400; }
.kvpc .kvpc-side { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #fff; cursor: pointer; }
.kvpc .kvpc-side-name { font-weight: 600; }
.kvpc .kvpc-side-cb { width: 17px; height: 17px; margin: 0; accent-color: var(--kvpc-accent); cursor: pointer; }
.kvpc .kvpc-side-cb:disabled { accent-color: #b9bcc6; cursor: default; opacity: 1; }
.kvpc .kvpc-side-price { color: #ffd2b0; font-size: 12px; }

/* ---------- stage / board ---------- */
.kvpc-stage { background: #fff; padding: 0; }
.kvpc-board {
	position: relative; width: 100%; aspect-ratio: 8 / 9; overflow: hidden;
	user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.kvpc-mockup {
	position: absolute !important; inset: 0 !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; padding: 0 !important;
	object-fit: contain !important; object-position: center !important; pointer-events: none; border: 0; border-radius: 0; box-shadow: none;
}
/* the T-shirt limit outline only shows while a design is being dragged / resized */
.kvpc-area {
	position: absolute; box-sizing: border-box; pointer-events: none; z-index: 2;
	border: 2px dashed var(--kvpc-accent); border-radius: 6px; opacity: 0; transition: opacity .15s;
}
.kvpc-board.is-guide .kvpc-area { opacity: .8; }
.kvpc-canvases { position: absolute; inset: 0; }
.kvpc-canvas-host { position: absolute; inset: 0; display: none; }
.kvpc-canvas-host.is-active { display: block; }
.kvpc-canvas-host .canvas-container,
.kvpc-canvas-host canvas {
	position: absolute !important; left: 0 !important; top: 0 !important;
	width: 100% !important; height: 100% !important; max-width: none !important;
	border: 0; box-shadow: none; border-radius: 0;
}
.kvpc-drop {
	position: absolute; inset: 8px; display: none; align-items: center; justify-content: center;
	border: 2px dashed var(--kvpc-accent); background: rgba(255, 255, 255, .88); color: var(--kvpc-accent);
	font-weight: 600; border-radius: 8px; pointer-events: none;
}
.kvpc-board.is-drop .kvpc-drop { display: flex; }
.kvpc .kvpc-next {
	appearance: none; position: absolute; right: 10px; top: 50%; z-index: 5; display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; margin: -19px 0 0; padding: 0; min-height: 0;
	background: rgba(255, 255, 255, .92); color: #333; border: 1px solid #8a8f9c; border-radius: 6px; box-shadow: none; cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
.kvpc .kvpc-next:hover, .kvpc .kvpc-next:focus-visible { background: #fff; border-color: var(--kvpc-accent); color: var(--kvpc-accent); outline: none; }
.kvpc .kvpc-next .kvpc-ico { width: 20px; height: 20px; }

/* ---------- toolbar ---------- */
.kvpc-tools { display: flex; flex-wrap: nowrap; gap: 8px; padding: 12px 12px 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.kvpc-tools::-webkit-scrollbar { height: 5px; }
.kvpc-tools::-webkit-scrollbar-thumb { background: #b9bcc6; border-radius: 4px; }
.kvpc .kvpc-ico, .kvpc-modal .kvpc-ico { flex: 0 0 auto; }
.kvpc button.kvpc-btn, .kvpc-modal .kvpc-btn, .kvpc-modal a.kvpc-btn {
	appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	padding: 9px 16px; margin: 0; min-height: 0;
	flex: 0 0 auto; white-space: nowrap;
	background: #fff; color: #555; border: 1px solid #c3c7d0; border-radius: 999px; box-shadow: none;
	font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; text-transform: none; letter-spacing: 0;
	text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.kvpc button.kvpc-btn:hover, .kvpc-modal .kvpc-btn:hover { border-color: var(--kvpc-accent); color: var(--kvpc-accent); background: #fff; }
.kvpc button.kvpc-btn--dark, .kvpc-modal .kvpc-btn--dark { background: var(--kvpc-dark); border-color: var(--kvpc-dark); color: #fff; }
.kvpc button.kvpc-btn--thumb { padding-left: 5px; }
.kvpc-pthumb { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; overflow: hidden; border: 1px dashed #b9bcc6; border-radius: 50%; background: #f4f5f7; }
.kvpc-pthumb img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; object-position: 50% 30%; border: 0; border-radius: 0; }
.kvpc button.kvpc-btn--dark:hover, .kvpc-modal .kvpc-btn--dark:hover { background: var(--kvpc-accent); border-color: var(--kvpc-accent); color: #fff; }
.kvpc button.kvpc-btn:focus-visible, .kvpc button.kvpc-mini:focus-visible, .kvpc-modal .kvpc-btn:focus-visible { outline: 2px solid var(--kvpc-accent); outline-offset: 2px; }

/* ---------- view tabs (Front | Back | Sleeves) ---------- */
.kvpc-views { display: flex; width: fit-content; max-width: calc(100% - 24px); margin: 4px auto 14px; overflow: hidden; border: 1px solid #8a93a6; border-radius: 999px; }
.kvpc .kvpc-views button.kvpc-view {
	appearance: none; position: relative; margin: 0; min-height: 0; padding: 7px 16px;
	background: #fff; color: #444; border: 0; border-radius: 0; box-shadow: none;
	font: inherit; font-size: 13px; line-height: 1.2; text-transform: none; letter-spacing: 0; white-space: nowrap; cursor: pointer;
	transition: background-color .15s, color .15s;
}
.kvpc .kvpc-views button.kvpc-view:not([hidden]) ~ button.kvpc-view:not([hidden]) { border-left: 1px solid #8a93a6; }
.kvpc .kvpc-views button.kvpc-view:hover { background: #f4f5f7; color: #111; }
.kvpc .kvpc-views button.kvpc-view.is-active { background: #e6e8ec; color: #111; font-weight: 600; }
.kvpc .kvpc-views button.kvpc-view:focus-visible { outline: 2px solid var(--kvpc-accent); outline-offset: -2px; }
.kvpc .kvpc-views button.kvpc-view.has-design::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--kvpc-accent); vertical-align: middle; }

/* ---------- selection panel ---------- */
.kvpc-panel { padding: 10px 12px 12px; border-top: 1px solid var(--kvpc-line); background: #fafafb; }
.kvpc-text-controls { margin-bottom: 8px; }
.kvpc .kvpc-text-input {
	display: block; width: 100%; margin: 0 0 8px; padding: 8px 10px; resize: vertical; min-height: 0;
	border: 1px solid #cfd2d9; border-radius: 8px; background: #fff; color: #111; font: inherit; font-size: 15px;
}
.kvpc-text-row { display: flex; gap: 8px; align-items: center; }
.kvpc .kvpc-font { flex: 1 1 auto; min-width: 0; padding: 7px 8px; margin: 0; height: 36px; border: 1px solid #cfd2d9; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.kvpc .kvpc-color { flex: 0 0 auto; width: 42px; height: 36px; padding: 2px; margin: 0; border: 1px solid #cfd2d9; border-radius: 8px; background: #fff; cursor: pointer; }
.kvpc-obj-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.kvpc button.kvpc-mini {
	appearance: none; display: inline-flex; align-items: center; gap: 5px; margin: 0; min-height: 0;
	padding: 6px 10px; background: #fff; color: #333; border: 1px solid #cfd2d9; border-radius: 8px; box-shadow: none;
	font: inherit; font-size: 13px; line-height: 1.2; text-transform: none; letter-spacing: 0; cursor: pointer;
}
.kvpc button.kvpc-mini .kvpc-ico { width: 15px; height: 15px; }
.kvpc button.kvpc-mini:hover { border-color: var(--kvpc-accent); color: var(--kvpc-accent); }
.kvpc button.kvpc-mini.is-on { background: var(--kvpc-accent); border-color: var(--kvpc-accent); color: #fff; }
.kvpc button.kvpc-mini--danger { color: #b3261e; border-color: #f0c2bf; }
.kvpc button.kvpc-mini--danger:hover { background: #b3261e; color: #fff; border-color: #b3261e; }

.kvpc-hint { margin: 10px 4px 0; font-size: 12.5px; line-height: 1.5; color: var(--kvpc-muted); }
.kvpc-hint .kvpc-chart-link { margin-left: 4px; }

/* ---------- toast / busy ---------- */
.kvpc-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100001;
	max-width: min(92vw, 520px); padding: 11px 18px; border-radius: 10px;
	background: #1f2430; color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.kvpc-toast.is-error { background: #b3261e; }
.kvpc-busy {
	position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .72); backdrop-filter: blur(2px);
}
.kvpc-busy > div { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 14px; }
.kvpc-spin { width: 20px; height: 20px; border: 3px solid #eee; border-top-color: var(--kvpc-accent); border-radius: 50%; animation: kvpc-spin .8s linear infinite; }
@keyframes kvpc-spin { to { transform: rotate(360deg); } }

/* ---------- modals ---------- */
.kvpc-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kvpc-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 18, 28, .6); }
.kvpc-modal-box {
	position: relative; width: min(960px, 100%); max-height: 92vh; overflow: auto;
	background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
}
.kvpc-modal-box--sm { width: min(560px, 100%); }
.kvpc-modal-box h3 { margin: 0 34px 14px 0; font-size: 20px; line-height: 1.25; color: var(--kvpc-text); }
.kvpc-modal .kvpc-modal-x {
	appearance: none; position: absolute; top: 12px; right: 12px; display: inline-flex; padding: 6px; margin: 0; min-height: 0;
	background: #f2f4f7; border: 0; border-radius: 50%; color: #333; cursor: pointer; box-shadow: none;
}
.kvpc-modal .kvpc-modal-x:hover { background: var(--kvpc-accent); color: #fff; }
.kvpc-prev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kvpc-fig { margin: 0; text-align: center; }
.kvpc-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--kvpc-line); border-radius: 8px; background: #fff; }
.kvpc-fig figcaption { margin-top: 6px; font-weight: 600; font-size: 14px; }
.kvpc-fig-actions { display: flex; justify-content: center; gap: 14px; margin-top: 4px; }
.kvpc-modal a.kvpc-link, .kvpc a.kvpc-link { color: var(--kvpc-accent); font-size: 13px; text-decoration: underline; }
.kvpc-modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.kvpc-share-link { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 1px solid #cfd2d9; border-radius: 8px; font: inherit; font-size: 14px; color: #111; background: #fafafb; }

.kvpc-chart-wrap { overflow-x: auto; }
.kvpc-chart { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; margin: 0; }
.kvpc-chart th { background: var(--kvpc-dark); color: #fff; padding: 9px 10px; font-weight: 600; border: 0; }
.kvpc-chart td { padding: 9px 10px; border: 0; border-bottom: 1px solid var(--kvpc-line); background: #fff; }
.kvpc-chart tr:nth-child(even) td { background: #f8f9fb; }
.kvpc-chart-note { margin: 12px 0 0; font-size: 12.5px; color: var(--kvpc-muted); }
.kvpc-chart-note:empty { display: none; }

/* ---------- variation pills + swatches (live inside the WooCommerce form) ---------- */
.kvpc-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; pointer-events: none !important; }
.kvpc-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; --kvpc-accent: #FF6A00; }
.kvpc-pills--color { gap: 10px; }
button.kvpc-pill {
	appearance: none; margin: 0; min-height: 0; padding: 5px 14px;
	background: #fff; color: #222; border: 1px solid #cfd2d9; border-radius: 999px; box-shadow: none;
	font: inherit; font-size: 13px; line-height: 1.4; text-transform: none; letter-spacing: 0; cursor: pointer;
	transition: border-color .15s, box-shadow .15s, color .15s;
}
button.kvpc-pill:hover { border-color: var(--kvpc-accent); background: #fff; color: #222; }
button.kvpc-pill.is-on { border-color: var(--kvpc-accent); box-shadow: 0 0 0 1px var(--kvpc-accent); color: var(--kvpc-accent); background: #fff; }
button.kvpc-swatch {
	appearance: none; width: 30px; height: 30px; margin: 0; padding: 0; min-height: 0; border-radius: 50%;
	background: var(--sw, #ddd); border: 1px solid rgba(0, 0, 0, .25); box-shadow: none; cursor: pointer;
	transition: transform .12s, outline-color .12s;
}
button.kvpc-swatch:hover { transform: scale(1.1); background: var(--sw, #ddd); }
button.kvpc-swatch.is-on { outline: 2px solid var(--kvpc-accent); outline-offset: 2px; }
button.kvpc-swatch { position: relative; }
button.kvpc-swatch.is-on[data-name]::after {
	content: attr(data-name); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 28px; padding: 1px 3px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 3px; background: #fff; color: #111; font-size: 8px; font-weight: 600; line-height: 1.3; pointer-events: none;
}
button.kvpc-pill:focus-visible, button.kvpc-swatch:focus-visible { outline: 2px solid var(--kvpc-accent); outline-offset: 2px; }
a.kvpc-chart-link { margin-left: 10px; font-size: 12px; font-weight: 400; color: #FF6A00; text-decoration: underline; white-space: nowrap; }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
	.kvpc { margin-bottom: 14px; }
	.kvpc .kvpc-sides { gap: 6px 12px; font-size: 13px; padding: 10px; }
	.kvpc-tools { gap: 6px; padding: 10px; }
	.kvpc button.kvpc-btn { padding: 8px 12px; font-size: 13px; }
	.kvpc button.kvpc-btn--thumb { padding-left: 4px; }
	.kvpc .kvpc-views button.kvpc-view { padding: 7px 13px; }
	.kvpc-modal-box { padding: 16px; border-radius: 12px; }
	.kvpc-modal-box h3 { font-size: 18px; }
	.kvpc-prev-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.kvpc-spin { animation-duration: 2s; }
	.kvpc *, .kvpc-modal * { transition: none !important; }
}


/* ---------- text effects ---------- */
.kvpc-fx { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.kvpc-fx label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #555; margin: 0; min-width: 0; }
.kvpc-fx select { width: 100%; min-width: 0; padding: 6px 8px; font-size: 13px; }
.kvpc-fx input[type=color] { width: 100%; height: 30px; padding: 0; border: 1px solid #c9ccd6; border-radius: 6px; background: #fff; }
.kvpc-rot-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: #555; }
.kvpc-rot-row input[type=range] { flex: 1; min-width: 0; }
.kvpc-rot-row output { min-width: 36px; text-align: right; }

.kvpc-chart tr.is-current td { background: #fff1e6; font-weight: 700; color: #b34700; }

.kvpc-dupe { display: none !important; }
