/* MemoryMagnet Photos. Colours follow the MemoryMagnet theme when it's active. */
.mmp {
	--mmp-rose: var(--wp--preset--color--primary, #D63A44);
	--mmp-rose-dark: var(--wp--preset--color--primary-dark, #B52F38);
	--mmp-text: var(--wp--preset--color--contrast, #2F3247);
	--mmp-muted: var(--wp--preset--color--muted, #646982);
	--mmp-border: var(--wp--preset--color--border, #E4E5EC);
	--mmp-cream: var(--wp--preset--color--parchment, #F5F6F9);
	--mmp-blush: var(--wp--preset--color--blush, #FFF1F2);
	width: 100%;
	margin: 4px 0 8px;
	padding: 18px;
	border: 1px solid var(--mmp-border);
	border-radius: 16px;
	background: #fff;
	box-sizing: border-box;
	color: var(--mmp-text);
}
.mmp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.mmp-title { margin: 0; font-weight: 700; font-size: 1.0625rem; }
.mmp-count { font-weight: 500; color: var(--mmp-muted); }
.mmp.is-complete .mmp-count { color: #1F5A7A; }
.mmp-add { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--mmp-rose); color: #fff; font-weight: 600; cursor: pointer; }
.mmp-add:hover { background: var(--mmp-rose-dark); }
.mmp-add:focus-within { outline: 2px solid var(--mmp-text); outline-offset: 3px; }
.mmp-add input, .mmp-slot-btn input, .mmp-slot-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.mmp-hint { margin: 10px 0 0; font-size: 14px; color: var(--mmp-muted); line-height: 1.5; }
.mmp-error { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--mmp-blush); color: var(--mmp-text); font-size: 14px; }
.mmp [hidden], .mmp-modal[hidden], .mmp-modal [hidden] { display: none !important; }

.mmp-slots { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .mmp-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mmp-slot { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mmp-slot-btn { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; width: 100%; aspect-ratio: 90 / 65; padding: 0; border: 1.5px dashed #C9CCD8; border-radius: 10px; background: var(--mmp-cream); color: var(--mmp-muted); font: inherit; font-size: 13px; cursor: pointer; overflow: hidden; box-sizing: border-box; }
.mmp-slot.is-portrait .mmp-slot-btn { aspect-ratio: 90 / 65; }
.mmp-slot-btn:hover, .mmp-slot-btn:focus-within, .mmp-slot-btn:focus-visible { border-color: var(--mmp-rose); color: var(--mmp-rose); outline: none; }
.mmp-slot:not(.is-empty) .mmp-slot-btn { border-style: solid; border-color: var(--mmp-border); background: #EEF0F5; }
.mmp-slot-btn img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mmp-plus { font-size: 26px; line-height: 1; font-weight: 300; }
.mmp-badge { position: absolute; right: 6px; top: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.95); color: var(--mmp-text); font-size: 12px; font-weight: 600; }
.mmp-ok { background: #E4F0F7; color: #1F5A7A; }
.mmp-bad { background: var(--mmp-rose); color: #fff; }
.mmp-slot.is-loading .mmp-badge { position: static; }
.mmp-warn { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: #FFE3E5; color: var(--mmp-text); font-size: 11px; font-weight: 600; }
.mmp-slot-actions { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13px; }
.mmp-slot-actions button, .mmp-slot-actions label { position: relative; padding: 4px 0; border: 0; background: none; color: var(--mmp-rose); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.single_add_to_cart_button.mmp-incomplete { opacity: 0.6; }

/* Crop editor */
html.mmp-lock, html.mmp-lock body { overflow: hidden; }
.mmp-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(47, 50, 71, 0.72); box-sizing: border-box; }
.mmp-modal-box { width: 100%; max-width: 600px; max-height: 100%; overflow: auto; padding: 18px; border-radius: 18px; background: #fff; color: var(--wp--preset--color--contrast, #2F3247); box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; }
.mmp-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mmp-modal-title { margin: 0 !important; font-size: 1.25rem !important; }
.mmp-x { width: 44px; height: 44px; border: 0; border-radius: 999px; background: #EEF0F5; color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
.mmp-stage { display: flex; justify-content: center; background: #2F3247; border-radius: 12px; padding: 12px; }
.mmp-canvas { display: block; touch-action: none; cursor: grab; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.mmp-canvas:active { cursor: grabbing; }
.mmp-canvas:focus-visible { outline: 3px solid #FFE3E5; outline-offset: 3px; }
.mmp-lowres { margin: 0; padding: 8px 12px; border-radius: 10px; background: #FFE3E5; font-size: 14px; }
.mmp-zoom { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.mmp-zoom input { flex: 1 1 auto; accent-color: var(--wp--preset--color--primary, #D63A44); min-height: 32px; }
.mmp-tools, .mmp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mmp-actions { justify-content: flex-end; }
.mmp-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #C9CCD8; background: #fff; color: inherit; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.mmp-btn:hover { border-color: var(--wp--preset--color--contrast, #2F3247); }
.mmp-btn-main { border-color: var(--wp--preset--color--primary, #D63A44); background: var(--wp--preset--color--primary, #D63A44); color: #fff; }
.mmp-btn-main:hover { background: var(--wp--preset--color--primary-dark, #B52F38); }
@media (max-width: 480px) {
	.mmp-tools .mmp-btn { flex: 1 1 calc(50% - 8px); padding: 0 8px; font-size: 14px; }
	.mmp-actions .mmp-btn { flex: 1 1 calc(50% - 8px); }
}

/* Sit full width above the Add to cart button inside WooCommerce's flex row */
.woocommerce-variation-add-to-cart:has(.mmp), form.cart:has(> .mmp) { flex-wrap: wrap !important; }
.mmp { flex: 1 1 100%; }
.woocommerce-variation-add-to-cart:has(.mmp) .quantity, form.cart:has(> .mmp) .quantity { display: none !important; }
.mmp-slot-actions { gap: 2px 8px; font-size: 12.5px; }

/* Special requests and gift note */
.mmp-extra { width: 100%; margin: 4px 0 12px; box-sizing: border-box; }
.mmp-label { display: block; margin: 12px 0 0; font-weight: 700; font-size: 1rem; color: var(--wp--preset--color--contrast, #2F3247); }
.mmp-extra .mmp-hint { margin-top: 4px; }
.mmp-extra textarea { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--wp--preset--color--border, #E4E5EC); border-radius: 12px; font: inherit; font-size: 16px; line-height: 1.5; box-sizing: border-box; resize: vertical; background: #fff; color: inherit; }
.mmp-extra textarea:focus { outline: 2px solid var(--wp--preset--color--primary, #D63A44); outline-offset: 1px; border-color: transparent; }
.mmp-extra [hidden] { display: none !important; }
