/* Premium Magic Configurator — frontend.
   Alles gescoped onder .pmcfg; kleuren via CSS-variabelen zodat het thema
   (of een UX Block met custom CSS) ze kan overschrijven zonder de plugin
   aan te raken. */

.pmcfg {
	--pmcfg-accent: #2e5c48;        /* merkgroen (leaf) */
	--pmcfg-accent-dark: #1d3727;
	--pmcfg-gold: #c9a36a;
	--pmcfg-ink: #13241a;
	--pmcfg-paper: #ffffff;
	--pmcfg-mist: #f4f4f2;
	--pmcfg-line: #e3e3df;
	--pmcfg-radius: 12px;

	max-width: 1080px;
	margin: 0 auto;
	color: var(--pmcfg-ink);
	font-size: 16px;
	line-height: 1.5;
	scroll-margin-top: 96px; /* ruimte voor de sticky Flatsome-header bij stapwissel */
}

/* Niet leunen op de box-sizing-reset van het thema. */
.pmcfg,
.pmcfg *,
.pmcfg *::before,
.pmcfg *::after {
	box-sizing: border-box;
}

/* ---- Productpagina-launcher / modal ---------------------------------- */

html.pmcfg-modal-open { overflow: hidden; }

.pmcfg-launchers-auto {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0;
}

.pmcfg-launchers-auto[hidden] { display: none !important; }

.pmcfg-launchers-auto .pmcfg-launch-button {
	margin: 0;
}

.pmcfg-modal[hidden] { display: none !important; }

.pmcfg-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pmcfg-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 18, 13, 0.72);
	backdrop-filter: blur(3px);
}

.pmcfg-modal-panel {
	position: relative;
	z-index: 1;
	width: min(1160px, 100%);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 28px;
	border-radius: 16px;
	background: var(--pmcfg-paper, #fff);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.pmcfg-modal-close {
	position: sticky;
	top: 0;
	z-index: 5;
	display: block;
	width: 40px;
	height: 40px;
	margin: 0 0 -40px auto;
	padding: 0;
	border: 1px solid #d7d7d2;
	border-radius: 50%;
	background: #fff;
	color: #13241a;
	font-size: 28px;
	line-height: 36px;
	cursor: pointer;
}

.pmcfg-modal-close:focus-visible {
	outline: 3px solid #c9a36a;
	outline-offset: 2px;
}

.pmcfg-mode-sleeves .pmcfg-solid-content,
.pmcfg-mode-sleeves .pmcfg-back-step2 {
	display: none !important;
}

/* ---- Stappen ------------------------------------------------------- */

.pmcfg-step {
	background: var(--pmcfg-paper);
	border: 1px solid var(--pmcfg-line);
	border-radius: var(--pmcfg-radius);
	padding: 28px 28px 20px;
	box-shadow: 0 8px 28px rgba(19, 36, 26, 0.06);
}

.pmcfg-step.is-active {
	animation: pmcfg-in 0.25s ease-out;
}

@keyframes pmcfg-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pmcfg-step.is-active { animation: none; }
}

.pmcfg-title {
	margin: 0 0 6px;
	font-size: 1.45em;
	line-height: 1.25;
	color: var(--pmcfg-ink);
}

.pmcfg-stepno {
	display: block;
	font-size: 0.58em;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pmcfg-gold);
	margin-bottom: 2px;
}

.pmcfg-intro {
	margin: 0 0 18px;
	color: #4a544c;
}

.pmcfg-smallprint {
	margin: 10px 0 0;
	font-size: 0.85em;
	color: #6b746d;
}

/* ---- Kaarten-grid --------------------------------------------------- */

.pmcfg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
	margin: 18px 0 6px;
}

.pmcfg-grid-sleeves {
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Grid-items mogen nooit breder worden dan hun kolom (afbeeldingen met een
   intrinsieke breedte blazen anders de kaarten op). */
.pmcfg-grid > * { min-width: 0; }

.pmcfg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--pmcfg-paper);
	border: 2px solid var(--pmcfg-line);
	border-radius: var(--pmcfg-radius);
	padding: 12px;
	margin: 0;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
	font: inherit;
	color: inherit;
	width: 100%;
}

button.pmcfg-card { appearance: none; }

.pmcfg-card:hover {
	border-color: var(--pmcfg-accent);
	box-shadow: 0 6px 18px rgba(19, 36, 26, 0.10);
	transform: translateY(-1px);
}

.pmcfg-card:focus-visible {
	outline: 3px solid var(--pmcfg-gold);
	outline-offset: 2px;
}

.pmcfg-card.is-selected,
.pmcfg-card.has-qty {
	border-color: var(--pmcfg-accent);
	box-shadow: 0 0 0 1px var(--pmcfg-accent), 0 6px 18px rgba(46, 92, 72, 0.14);
}

.pmcfg-card.is-selected::after {
	content: "✓";
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--pmcfg-accent);
	color: #fff;
	font-size: 14px;
	line-height: 24px;
	text-align: center;
}

.pmcfg-card-name {
	font-weight: 600;
	font-size: 0.95em;
	min-height: 2.4em;
}

.pmcfg-card-img {
	display: block;
	background: var(--pmcfg-mist);
	border-radius: calc(var(--pmcfg-radius) - 4px);
	overflow: hidden;
}

.pmcfg-card-img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.pmcfg-card-price {
	font-weight: 700;
	color: var(--pmcfg-accent-dark);
}

.pmcfg-card-price .woocommerce-Price-amount { font-weight: 700; }

/* ---- Aantal-stepper (sleeves) --------------------------------------- */

.pmcfg-qty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 2px;
}

.pmcfg-qty-btn {
	appearance: none;
	width: 34px;
	height: 34px;
	border: 1px solid var(--pmcfg-line);
	border-radius: 8px;
	background: var(--pmcfg-paper);
	color: var(--pmcfg-ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s ease, border-color 0.12s ease;
	padding: 0;
}

.pmcfg-qty-btn:hover {
	background: var(--pmcfg-mist);
	border-color: var(--pmcfg-accent);
}

.pmcfg-qty-btn:focus-visible {
	outline: 2px solid var(--pmcfg-gold);
	outline-offset: 1px;
}

.pmcfg-qty-val {
	min-width: 2ch;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.pmcfg-card-qty { cursor: default; }
.pmcfg-card-qty:hover { transform: none; }

.pmcfg-qty-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 12px;
	background: var(--pmcfg-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 24px;
	text-align: center;
}

/* ---- Engraving per sleeve -------------------------------------------- */

.pmcfg-engraving {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 2px;
	padding-top: 9px;
	border-top: 1px solid var(--pmcfg-line);
	font-size: 0.86em;
	font-weight: 600;
	cursor: pointer;
}

.pmcfg-engraving input {
	flex: 0 0 auto;
	margin: 3px 0 0;
	accent-color: var(--pmcfg-accent);
}

.pmcfg-engraving small {
	display: block;
	color: #6b746d;
	font-size: 0.86em;
	font-weight: 400;
}

.pmcfg-card-qty:not(.has-qty) .pmcfg-engraving {
	opacity: 0.48;
	cursor: not-allowed;
}

.pmcfg-card-qty.is-engraved .pmcfg-engraving {
	color: var(--pmcfg-accent-dark);
}

/* ---- Solid cup-kaart ------------------------------------------------- */

.pmcfg-solid {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	border: 2px solid var(--pmcfg-line);
	border-radius: var(--pmcfg-radius);
	padding: 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	margin: 4px 0 0;
}

.pmcfg-solid:hover { border-color: var(--pmcfg-accent); }

.pmcfg-solid.is-selected {
	border-color: var(--pmcfg-accent);
	box-shadow: 0 0 0 1px var(--pmcfg-accent), 0 6px 18px rgba(46, 92, 72, 0.14);
}

.pmcfg-solid-check {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.pmcfg-solid-img {
	flex: 0 0 120px;
	background: var(--pmcfg-mist);
	border-radius: calc(var(--pmcfg-radius) - 4px);
	overflow: hidden;
}

.pmcfg-solid-img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.pmcfg-solid-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pmcfg-solid-name { font-weight: 700; }

.pmcfg-solid-name::before {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	vertical-align: -3px;
	border: 2px solid var(--pmcfg-line);
	border-radius: 5px;
	transition: background 0.12s ease, border-color 0.12s ease;
}

.pmcfg-solid.is-selected .pmcfg-solid-name::before {
	background: var(--pmcfg-accent) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="none" stroke="white" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" d="M3 8.5l3.2 3.2L13 5"/></svg>') center/12px no-repeat;
	border-color: var(--pmcfg-accent);
}

.pmcfg-solid-desc {
	color: #4a544c;
	font-size: 0.92em;
}

/* ---- Samenvatting ---------------------------------------------------- */

.pmcfg-summary {
	margin-top: 18px;
	border: 1px dashed var(--pmcfg-gold);
	border-radius: var(--pmcfg-radius);
	background: #fbf8f1;
	padding: 14px 18px;
}

.pmcfg-summary:empty { display: none; }

.pmcfg-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 3px 0;
	font-size: 0.95em;
}

.pmcfg-summary-row .pmcfg-sum-label { color: #4a544c; }
.pmcfg-summary-row .pmcfg-sum-value { text-align: right; font-weight: 600; }

.pmcfg-summary-row.pmcfg-summary-total {
	border-top: 1px solid var(--pmcfg-gold);
	margin-top: 8px;
	padding-top: 9px;
	font-size: 1.08em;
}

.pmcfg-summary-row.pmcfg-summary-total .pmcfg-sum-value { color: var(--pmcfg-accent-dark); font-weight: 800; }

/* ---- Voet: melding + knoppen ----------------------------------------- */

.pmcfg-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--pmcfg-line);
	flex-wrap: wrap;
}

.pmcfg-note {
	color: #4a544c;
	font-size: 0.95em;
	min-height: 1.2em;
}

.pmcfg-note.is-warn { color: #9a6b1f; }

.pmcfg-foot-btns {
	display: flex;
	gap: 10px;
	margin-left: auto;
}

.pmcfg-btn {
	appearance: none;
	border: 0;
	border-radius: 10px;
	background: var(--pmcfg-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	padding: 12px 22px;
	cursor: pointer;
	transition: background 0.12s ease, transform 0.12s ease;
}

.pmcfg-btn:hover { background: var(--pmcfg-accent-dark); color: #fff; }
.pmcfg-btn:active { transform: translateY(1px); }

.pmcfg-btn:focus-visible {
	outline: 3px solid var(--pmcfg-gold);
	outline-offset: 2px;
}

.pmcfg-btn[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.pmcfg-btn-ghost {
	background: transparent;
	color: var(--pmcfg-ink);
	border: 1px solid var(--pmcfg-line);
	font-weight: 600;
}

.pmcfg-btn-ghost:hover {
	background: var(--pmcfg-mist);
	color: var(--pmcfg-ink);
}

.pmcfg-error {
	margin-top: 14px;
	border-radius: 10px;
	background: #fdf0ef;
	border: 1px solid #ecc8c5;
	color: #8a2724;
	padding: 10px 14px;
	font-size: 0.95em;
}

/* ---- Mobiel ----------------------------------------------------------- */

@media (max-width: 640px) {
	.pmcfg-modal { padding: 0; align-items: stretch; }
	.pmcfg-modal-panel { max-height: 100vh; padding: 16px 10px; border-radius: 0; }
	.pmcfg { font-size: 15px; }
	.pmcfg-step { padding: 18px 14px 14px; border-radius: 10px; }
	.pmcfg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.pmcfg-grid-sleeves { grid-template-columns: repeat(2, 1fr); }
	.pmcfg-solid { flex-direction: column; }
	.pmcfg-solid-img { flex-basis: auto; width: 50%; }
	.pmcfg-foot { flex-direction: column; align-items: stretch; }
	.pmcfg-foot-btns { margin-left: 0; }
	.pmcfg-foot-btns .pmcfg-btn { flex: 1; }
	.pmcfg-note { text-align: center; }
}
