/* Printcandy PDF klant-editor (frontend) */
:root {
	--pcc-naval: #4c5c6b;
	--pcc-greige: #d7d0c6;
	--pcc-ink: #2a2a2a;
	--pcc-muted: #6b7280;
	--pcc-line: #e5e2de;
	--pcc-panel: #f7f5f2;
	--pcc-preview: #eceae6;
}

.pcc-pdf-front-wrap,
.pcc-pdf-front-wrap *,
.pcc-pdf-modal,
.pcc-pdf-modal * {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.pcc-pdf-front-wrap { margin: 16px 0; }

/* Standaard WC-knop verbergen; toevoegen gaat via de modal. */
form.cart:has( .pcc-pdf-front-wrap ) .single_add_to_cart_button,
form.variations_form:has( .pcc-pdf-front-wrap ) .single_add_to_cart_button {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect( 0, 0, 0, 0 ) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.pcc-pdf-product-card {
	max-width: 440px;
	padding: 18px 20px 22px;
	background: linear-gradient( 180deg, #faf9f7 0%, var( --pcc-panel ) 100% );
	border: 1px solid var( --pcc-line );
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba( 42, 42, 42, 0.06 );
	overflow: visible;
}
.pcc-pdf-product-card__title {
	margin: 0 0 14px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var( --pcc-naval );
}

.pcc-pdf-open.button {
	display: block;
	width: 100%;
	cursor: pointer;
	background: var( --pcc-naval );
	border-color: var( --pcc-naval );
	color: #fff;
	padding: 0.85em 1.5em;
	font-size: 1em;
	font-weight: 600;
	border-radius: 8px;
	margin-top: 4px;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 6px rgba( 76, 92, 107, 0.22 );
}
.pcc-pdf-open.button:hover {
	background: #3d4a56;
	border-color: #3d4a56;
	color: #fff;
	transform: translateY( -1px );
	box-shadow: 0 4px 10px rgba( 76, 92, 107, 0.28 );
}
.pcc-pdf-open.button[hidden] { display: none !important; }
.pcc-pdf-open.button.is-disabled,
.pcc-pdf-open.button[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.pcc-pdf-optshint {
	margin: 8px 0 0;
	font-size: 0.86em;
	font-weight: 600;
	color: #a1462b;
}
.pcc-pdf-optshint[hidden] { display: none !important; }

.pcc-pdf-prechoice {
	margin-bottom: 12px;
}
.pcc-pdf-prechoice__label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	font-size: 0.95em;
	color: var( --pcc-ink );
}
.pcc-pdf-select-wrap {
	position: relative;
}
.pcc-pdf-tab-display {
	display: none;
	position: absolute;
	left: 14px;
	right: 40px;
	top: 50%;
	transform: translateY( -50% );
	pointer-events: none;
	color: var( --pcc-ink );
	font-size: 0.95em;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pcc-pdf-select-wrap.has-choice .pcc-pdf-tab-display {
	display: block;
}
/* Alleen overlay tonen na keuze; native select-tekst verbergen. */
.pcc-pdf-prechoice .pcc-pdf-select-wrap.has-choice .pcc-pdf-tab-select {
	color: transparent !important;
	-webkit-text-fill-color: transparent !important;
}
.pcc-pdf-select-wrap::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 14px;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var( --pcc-naval );
	border-bottom: 2px solid var( --pcc-naval );
	transform: rotate( 45deg );
	pointer-events: none;
}
.pcc-pdf-prechoice .pcc-pdf-tab-select {
	width: 100%;
	padding: 12px 40px 12px 14px;
	border: 1px solid #c8c4bf;
	border-radius: 8px;
	background: #fff !important;
	font-size: 0.95em;
	line-height: 1.4;
	min-height: 46px;
	color: var( --pcc-muted ) !important;
	-webkit-text-fill-color: var( --pcc-muted ) !important;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pcc-pdf-prechoice .pcc-pdf-tab-select option {
	color: var( --pcc-ink );
	background: #fff;
}
.pcc-pdf-prechoice .pcc-pdf-tab-select option[value=""] {
	color: var( --pcc-muted ) !important;
}
.pcc-pdf-prechoice .pcc-pdf-tab-select:focus {
	outline: none;
	border-color: var( --pcc-naval );
	box-shadow: 0 0 0 3px rgba( 76, 92, 107, 0.15 );
}
.pcc-pdf-prechoice__hint {
	margin: 10px 0 0;
	font-size: 0.84em;
	color: var( --pcc-muted );
	line-height: 1.45;
}

/* Modal */
.pcc-pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 20, 20, 22, 0.62 );
	padding: 16px;
}
.pcc-pdf-modal[hidden] { display: none; }
body.pcc-pdf-open-body { overflow: hidden; }

.pcc-pdf-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	width: min( 1040px, 96vw );
	max-height: 92vh;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, 0.28 );
}

.pcc-pdf-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	cursor: pointer;
	color: #444;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.12 );
	transition: background 0.15s ease, color 0.15s ease;
}
.pcc-pdf-close:hover { background: #fff; color: #111; }

.pcc-pdf-header {
	padding: 12px 48px 10px 20px;
	border-bottom: 1px solid var( --pcc-line );
	background: #fff;
	flex-shrink: 0;
}
.pcc-pdf-title {
	margin: 0 0 2px;
	font-size: 1.12em;
	font-weight: 700;
	color: var( --pcc-ink );
	line-height: 1.2;
}
.pcc-pdf-subtitle {
	margin: 0;
	font-size: 0.82em;
	color: var( --pcc-muted );
	line-height: 1.35;
}
.pcc-pdf-variant-badge {
	display: inline-block;
	margin: 6px 0 0;
	padding: 2px 8px;
	font-size: 0.76em;
	font-weight: 600;
	font-style: normal;
	color: var( --pcc-naval );
	background: var( --pcc-panel );
	border: 1px solid var( --pcc-line );
	border-radius: 999px;
}

.pcc-pdf-body {
	display: grid;
	grid-template-columns: 340px 1fr;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.pcc-pdf-controls {
	min-width: 0;
	padding: 18px 20px;
	overflow-y: auto;
	background: var( --pcc-panel );
	border-right: 1px solid var( --pcc-line );
}

.pcc-pdf-section {
	margin-bottom: 18px;
	padding-bottom: 4px;
}
.pcc-pdf-section:last-child { margin-bottom: 0; }

.pcc-pdf-h {
	margin: 0 0 12px;
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var( --pcc-naval );
}

.pcc-pdf-field {
	margin-bottom: 14px;
	padding: 12px 12px 10px;
	background: #fff;
	border: 1px solid var( --pcc-line );
	border-radius: 8px;
}
.pcc-pdf-field:last-child { margin-bottom: 0; }
.pcc-pdf-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	font-size: 0.9em;
	color: var( --pcc-ink );
}
.pcc-pdf-charcount {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: #6b7280;
}

.pcc-pdf-field input[type="text"],
.pcc-pdf-field textarea,
.pcc-pdf-field select {
	width: 100%;
	padding: 10px 12px;
	box-sizing: border-box;
	font: inherit;
	font-size: 0.95em;
	line-height: 1.4;
	border: 1px solid #c8c4bf;
	border-radius: 6px;
	background: #fff;
	color: var( --pcc-ink );
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Theme-CSS zet soms een te lage height op select → tekst wordt afgeknipt. */
.pcc-pdf-field select {
	display: block;
	min-height: 44px;
	height: auto !important;
	padding: 11px 36px 11px 12px;
	line-height: 1.35 !important;
	appearance: none;
	-webkit-appearance: none;
	background-color: #fff;
	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='%234c5c6b' d='M1.4.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 8px;
}
.pcc-pdf-field input[type="text"]:focus,
.pcc-pdf-field textarea:focus,
.pcc-pdf-field select:focus {
	outline: none;
	border-color: var( --pcc-naval );
	box-shadow: 0 0 0 3px rgba( 76, 92, 107, 0.15 );
}
.pcc-pdf-field textarea {
	min-height: 80px;
	resize: vertical;
	line-height: 1.45;
}

.pcc-pdf-swatch-group { margin-top: 2px; }
.pcc-pdf-swatch-label {
	display: block;
	margin-top: 8px;
	font-size: 0.82em;
	font-weight: 500;
	color: var( --pcc-muted );
}
.pcc-pdf-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.pcc-pdf-swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid rgba( 0, 0, 0, 0.1 );
	cursor: pointer;
	padding: 0;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pcc-pdf-swatch:hover { transform: scale( 1.08 ); }
.pcc-pdf-swatch-transparent {
	background: repeating-conic-gradient( #e8e8e8 0% 25%, #fff 0% 50% ) 0 / 10px 10px !important;
}
.pcc-pdf-swatch-none {
	background: #fff !important;
	color: #888;
	font-size: 16px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pcc-pdf-swatch.is-on {
	border-color: var( --pcc-naval );
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var( --pcc-naval );
}

/* Preview */
.pcc-pdf-preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var( --pcc-preview );
	padding: 18px 20px 22px;
	overflow: hidden;
	min-height: 0;
	height: 100%;
	box-sizing: border-box;
}

.pcc-pdf-preview-inner {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	box-sizing: border-box;
}

.pcc-pdf-preview img {
	display: block;
	max-width: calc( 100% - 8px );
	max-height: calc( 100% - 8px );
	width: auto;
	height: auto;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 8px 28px rgba( 0, 0, 0, 0.14 );
	border-radius: 2px;
}
.pcc-pdf-preview img[hidden] { display: none; }

/* Gecentreerde loader (initieel + bij wijzigingen) */
.pcc-pdf-preview.is-loading .pcc-pdf-preview-inner::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba( 255, 255, 255, 0.55 );
	border-radius: 4px;
	z-index: 1;
}
.pcc-pdf-preview.is-loading .pcc-pdf-preview-inner::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 3px solid rgba( 76, 92, 107, 0.18 );
	border-top-color: var( --pcc-naval );
	border-radius: 50%;
	animation: pcc-pdf-spin 0.75s linear infinite;
	z-index: 2;
}

.pcc-pdf-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 10px 20px;
	border-top: 1px solid var( --pcc-line );
	background: #fff;
	flex-shrink: 0;
}
.pcc-pdf-confirm {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	flex: 1 1 220px;
	max-width: 520px;
	font-size: 0.82em;
	color: var( --pcc-ink );
	line-height: 1.35;
	cursor: pointer;
}
.pcc-pdf-confirm input {
	margin-top: 2px;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	accent-color: var( --pcc-naval );
}
.pcc-pdf-footer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	flex-shrink: 0;
}
.pcc-pdf-btn-secondary.button {
	background: #fff;
	border-color: #c8c4bf;
	color: var( --pcc-ink );
	border-radius: 8px;
	padding: 0.5em 1em;
	font-weight: 600;
	font-size: 0.9em;
}
.pcc-pdf-btn-secondary.button:hover {
	background: var( --pcc-panel );
	border-color: var( --pcc-naval );
	color: var( --pcc-ink );
}
.pcc-pdf-btn-cart.button.alt {
	background: var( --pcc-naval );
	border-color: var( --pcc-naval );
	border-radius: 8px;
	padding: 0.55em 1.2em;
	font-weight: 700;
	font-size: 0.9em;
	min-width: 140px;
	box-shadow: 0 2px 8px rgba( 76, 92, 107, 0.25 );
}
.pcc-pdf-btn-cart.button.alt:hover:not( :disabled ) {
	background: #3d4a56;
	border-color: #3d4a56;
}
.pcc-pdf-btn-cart.button.alt:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}
.pcc-pdf-footer__err {
	margin: 0;
	width: 100%;
	font-size: 0.82em;
	color: #b42318;
	text-align: right;
}

@keyframes pcc-pdf-spin { to { transform: rotate( 360deg ); } }

@media ( max-width: 720px ) {
	.pcc-pdf-body {
		grid-template-columns: 1fr;
		grid-template-rows: minmax( 240px, 42vh ) 1fr;
	}
	.pcc-pdf-preview { order: -1; padding: 16px; min-height: 240px; }
	.pcc-pdf-controls {
		border-right: 0;
		border-top: 1px solid var( --pcc-line );
	}
	.pcc-pdf-header { padding-right: 52px; }
}
