/* Crafted Moments – Magnet Builder (uses the theme's --cm-* tokens, with fallbacks) */
.cm-mb { --ink: var(--cm-ink, #3B2620); --muted: var(--cm-muted, #8C766C); --line: var(--cm-line, #EDE0D8); --gold: var(--cm-gold, #9A4A26);
	margin: 18px 0 20px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; display: grid; gap: 14px; width: 100%; box-sizing: border-box; }
.cm-mb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cm-mb-title { font-family: var(--wp--preset--font-family--serif, Georgia, serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.cm-mb-progress { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cm-mb-bar { width: 110px; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cm-mb-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s ease; }
.cm-mb-slots { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.cm-mb-slot { position: relative; aspect-ratio: 1; min-height: 44px; border: 2px dashed #D9C6BB; border-radius: 6px; background: #FDFAF8 center / cover no-repeat; cursor: pointer; padding: 0; display: grid; place-items: center; color: var(--muted); font: inherit; }
.cm-mb-slot:hover { border-color: var(--ink); }
.cm-mb-slot.has-photo { border: 6px solid #fff; border-radius: 2px; box-shadow: 0 2px 8px rgba(59,38,32,.18); }
.cm-mb-slot.is-busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6) linear-gradient(90deg, transparent, rgba(154,74,38,.35), transparent) 0 0 / 200% 100%; animation: cm-mb-shimmer 1s linear infinite; }
.cm-mb-plus { font-size: 26px; line-height: 1; }
.cm-mb-flag { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; border-radius: 50%; background: #B4462F; color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.cm-mb-drop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 44px; border: 2px dashed #D9C6BB; border-radius: 14px; background: #FDFAF8; cursor: pointer; }
.cm-mb-drop:hover { border-color: var(--ink); }
.cm-mb-drop span { display: grid; }
.cm-mb-drop small { color: var(--muted); font-size: 13px; }
.cm-mb.is-waiting .cm-mb-drop, .cm-mb.is-waiting .cm-mb-progress { opacity: .45; pointer-events: none; }
.cm-mb-msg { margin: 0; font-size: 14px; color: var(--muted); min-height: 1em; }
.cm-mb-msg:empty { display: none; }
.cm-mb-msg.is-error { color: #7A2E1E; background: #FBEDE8; padding: 10px 12px; border-radius: 10px; }
.cm-mb-privacy { margin: 0; font-size: 12px; color: var(--muted); }
.single_add_to_cart_button.cm-mb-blocked { opacity: .5; }

/* round pieces (badges): circular slots and crop guide; the print file stays square */
.cm-mb-shape-circle .cm-mb-slot, .cm-mb-shape-circle .cm-mb-slot.has-photo { border-radius: 50%; }
.cm-mb-shape-circle .cm-mb-flag { top: 0; right: 0; }
.cm-mb-modal.cm-mb-shape-circle .cm-mb-frame { border-radius: 50%; background-size: 50% 50%; }

/* set pills */
.cm-mb-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 4px; }
.cm-mb-pill { display: grid; gap: 2px; justify-items: start; text-align: left; min-height: 72px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--cm-line, #EDE0D8); background: #fff; color: var(--cm-ink, #3B2620); font: inherit; cursor: pointer; }
.cm-mb-pill strong { font-family: var(--wp--preset--font-family--serif, Georgia, serif); font-weight: 400; font-size: 18px; line-height: 1.15; }
.cm-mb-pill span { font-size: 13px; color: var(--cm-muted, #8C766C); }
.cm-mb-pill em { font-style: normal; font-weight: 700; font-size: 15px; }
.cm-mb-pill[aria-checked="true"] { border: 2px solid var(--cm-ink, #3B2620); padding: 11.5px 13.5px; }
.cm-mb-hidden-select { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cm-mb-hidden-select + .single_variation_wrap .woocommerce-variation-price { display: none; }
.reset_variations { display: none !important; }

/* mobile sticky bar */
.cm-mb-sticky { display: none; }
@media (max-width: 781px) {
	.cm-mb-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--cm-line, #EDE0D8); box-shadow: 0 -6px 18px rgba(59,38,32,.08); transform: translateY(110%); transition: transform .2s ease; }
	.cm-mb-sticky.is-on { transform: none; }
	.cm-mb-sticky span { font-weight: 600; font-size: 15px; }
	.cm-mb-sticky button { min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--cm-gold, #9A4A26); color: #fff; font: inherit; font-weight: 600; box-shadow: 0 2px 0 var(--cm-gold-dark, #6E3218); }
	body:has(.cm-mb-sticky.is-on) .cm-wa-float { bottom: 88px; }
	.cm-mb-pills { gap: 8px; }
	.cm-mb-pill { padding: 10px; min-height: 76px; }
	.cm-mb-pill[aria-checked="true"] { padding: 9.5px; }
	.cm-mb-pill strong { font-size: 16px; }
}

/* editor */
.cm-mb-lock, .cm-mb-lock body { overflow: hidden; }
.cm-mb-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(42,27,22,.72); display: none; align-items: center; justify-content: center; padding: 20px; }
.cm-mb-modal.is-open { display: flex; }
.cm-mb-sheet { width: min(640px, 100%); height: min(760px, 100%); background: #3B2620; color: #FCF8F5; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.cm-mb-sheet header { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; text-align: center; }
.cm-mb-sheet header small { display: block; color: #CDB8AE; font-size: 12px; }
.cm-mb-sheet button { font: inherit; min-height: 44px; border-radius: 999px; cursor: pointer; }
.cm-mb-x { background: none; border: 0; color: inherit; font-size: 22px; }
.cm-mb-done { background: #9A4A26; color: #fff; border: 0; padding: 0 20px; font-weight: 600; }
.cm-mb-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; background: #2A1B16; }
.cm-mb-stage:active { cursor: grabbing; }
.cm-mb-view { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none !important; user-select: none; }
.cm-mb-frame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(42,27,22,.62); pointer-events: none;
	background-image: linear-gradient(rgba(255,255,255,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.28) 1px, transparent 1px); background-size: 33.333% 33.333%; }
.cm-mb-sheet footer { padding: 14px 16px 16px; display: grid; gap: 12px; }
.cm-mb-zoom { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.cm-mb-zoom input { flex: 1; accent-color: #9A4A26; }
.cm-mb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cm-mb-actions button { background: none; color: inherit; border: 1.5px solid #7C6358; }
.cm-mb-del { color: #F2A99B !important; }

@media (max-width: 600px) {
	.cm-mb { padding: 14px; }
	.cm-mb-modal { padding: 0; }
	.cm-mb-sheet { width: 100%; height: 100%; border-radius: 0; }
}
@keyframes cm-mb-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cm-mb-slot.is-busy::after { animation: none; } .cm-mb-bar i { transition: none; } }
