/* Doorstep Social Media Business Card Designer */

.dsm-calculator { max-width: 460px; margin: 0 0 24px; font-size: 14px; }
.dsm-field { margin-bottom: 16px; }
.dsm-field > label { display: block; font-weight: 600; margin-bottom: 6px; color: #222; }
.dsm-select { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; background: #fff; box-sizing: border-box; }
.dsm-opt { font-weight: 400; color: #888; font-size: 12px; }
.dsm-req { color: #c1272d; }
.dsm-help { font-size: 12px; color: #666; margin-top: 6px; }

/* ---- Small front/back preview on the product page ---- */
.dsm-preview-strip { display: flex; gap: 14px; justify-content: center; margin: 0 0 12px; }
.dsm-mini { text-align: center; font-size: 12px; color: #666; }
.dsm-mini span { display: block; margin-top: 4px; }
.dsm-mini-canvas { width: 120px; height: auto; aspect-ratio: 2 / 3.5; display: block; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); background: #eee; }
.dsm-open-designer { display: block; width: 100%; padding: 13px; margin: 0 0 8px; border: 2px solid #27a1ff !important; background: #fff !important; color: #27a1ff !important; border-radius: 6px; font-weight: 700; font-size: 15px; cursor: pointer; }
.dsm-open-designer:hover, .dsm-open-designer:focus { background: #27a1ff !important; color: #fff !important; }
.dsm-design-status { font-size: 13px; color: #555; margin-bottom: 18px; }
.dsm-design-status.is-ok { color: #4f8f1f; font-weight: 600; }
.dsm-design-status.is-err { color: #b26200; font-weight: 600; }

.dsm-notes { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; box-sizing: border-box; resize: vertical; }

.dsm-quote-notice { background: #fff3cd; border: 1px solid #ffe08a; color: #7a5b00; padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.dsm-price-box { border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; padding: 10px 0; margin-bottom: 14px; }
.dsm-price-line { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.dsm-price-sub { font-size: 13px; color: #666; }
.dsm-price-total { font-weight: 700; font-size: 18px; }

.dsm-approve { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; margin: 0 0 14px; cursor: pointer; padding: 6px; border-radius: 6px; transition: background .3s; }
.dsm-approve input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.dsm-approve.is-flash { background: #fff3cd; }

.dsm-add-to-cart-btn, .dsm-quote-btn { display: block; width: 100%; text-align: center; padding: 14px; border-radius: 6px; font-weight: 700; font-size: 15px; cursor: pointer; box-sizing: border-box; }
.dsm-add-to-cart-btn { background: #222529 !important; color: #fff !important; border: none !important; }
.dsm-add-to-cart-btn[disabled] { opacity: .6; cursor: wait; }
.dsm-quote-btn { background: #c1272d; color: #fff !important; text-decoration: none; }
.dsm-cart-msg { margin-top: 10px; font-size: 13px; font-weight: 600; color: #555; }
.dsm-cart-msg.is-err { color: #c1272d; }
.dsm-cart-msg.is-ok { color: #2a7d2a; }

/* Hide the native WooCommerce quantity box and Add to Cart button (JS fallback in DSM_Core). */
form.cart:has(#dsm-calculator-root) > .quantity,
form.cart:has(#dsm-calculator-root) > .single_add_to_cart_button { display: none !important; }

/* ================= Full-screen designer ================= */
html.dsm-lock, html.dsm-lock body { overflow: hidden !important; }
.dsm-modal[hidden] { display: none !important; }
.dsm-modal { position: fixed; inset: 0; z-index: 999999; background: #fff; color: #222; font-size: 14px; line-height: 1.45; }
.dsm-modal *, .dsm-modal *::before, .dsm-modal *::after { box-sizing: border-box; }
.dsm-modal-inner { display: flex; flex-direction: column; height: 100%; }
.dsm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #e5e5e5; }
.dsm-modal-head h2 { margin: 0; font-size: 18px; line-height: 1.3; color: #010101; }
.dsm-modal-close { width: 38px; height: 38px; padding: 0 !important; border: 1px solid #ddd !important; border-radius: 50% !important; background: #fff !important; color: #333 !important; font-size: 24px; line-height: 34px; cursor: pointer; flex: 0 0 auto; }
.dsm-modal-close:hover, .dsm-modal-close:focus { border-color: #222 !important; }
.dsm-modal-body { flex: 1 1 auto; display: flex; min-height: 0; }
.dsm-form { flex: 1 1 52%; overflow-y: auto; padding: 18px 24px 40px; position: relative; }
.dsm-stage { flex: 1 1 48%; background: #f4f4f4; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.dsm-stage-cards { display: flex; gap: 22px; justify-content: center; align-items: flex-start; }
.dsm-stage figure { margin: 0; text-align: center; font-size: 12px; color: #666; }
.dsm-big-canvas { width: min(250px, 19vw); height: auto; aspect-ratio: 2 / 3.5; display: block; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); background: #ddd; margin-bottom: 6px; }
.dsm-stage-note { font-size: 12px; color: #777; margin: 14px 0 0; text-align: center; }
.dsm-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 12px 20px; border-top: 1px solid #e5e5e5; background: #fff; }
.dsm-modal-msg { flex: 1 1 auto; font-size: 13px; font-weight: 600; color: #555; }
.dsm-modal-msg.is-err { color: #c1272d; }
.dsm-done { padding: 12px 26px; border: none !important; border-radius: 6px; background: #222529 !important; color: #fff !important; font-weight: 700; font-size: 15px; cursor: pointer; }

.dsm-style-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.dsm-style-toggle button { flex: 1 1 0; padding: 10px 8px; border: 1px solid #ccc !important; border-radius: 6px; background: #fff !important; color: #333 !important; font-weight: 600; font-size: 13px; cursor: pointer; }
.dsm-style-toggle button.is-on { border-color: #27a1ff !important; color: #27a1ff !important; box-shadow: inset 0 0 0 1px #27a1ff; }

.dsm-sec { padding: 6px 0 14px; border-bottom: 1px solid #eee; margin-bottom: 14px; }
.dsm-sec h3 { font-size: 16px; margin: 4px 0 12px; color: #27a1ff; }
.dsm-sec h3 small { font-size: 12px; color: #888; font-weight: 400; margin-left: 6px; }

.dsm-input { margin-bottom: 12px; }
.dsm-input label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: #222; }
.dsm-input input, .dsm-input textarea, .dsm-select-in { width: 100%; padding: 9px 11px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px; background: #fff; color: #222; }
.dsm-input textarea { resize: vertical; min-height: 58px; }
.dsm-input.has-err input, .dsm-input.has-err textarea, .dsm-input.has-err select { border-color: #c1272d; }
.dsm-err { font-size: 12px; color: #c1272d; font-weight: 600; margin-top: 3px; }
.dsm-err:empty { display: none; }
.dsm-stats-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.dsm-stats-row { display: flex; gap: 10px; }
.dsm-stats-row .dsm-input { flex: 1 1 0; min-width: 0; }
.dsm-stats-row .dsm-input label .dsm-opt { display: none; }

/* Photo slots */
.dsm-photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.dsm-photo-help { font-size: 12px; color: #666; }
.dsm-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; }
.dsm-photo { position: relative; }
.dsm-photo-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; border: 1px dashed #bbb; border-radius: 6px; background: #fafafa; cursor: pointer; overflow: hidden; position: relative; margin: 0; }
.dsm-photo-round .dsm-photo-drop { width: 96px; border-radius: 50%; }
.dsm-photo-logo .dsm-photo-drop { width: 130px; aspect-ratio: 13 / 8; }
.dsm-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dsm-photo-drop:focus-within { outline: 2px solid #27a1ff; outline-offset: 2px; }
.dsm-photo-thumb { position: absolute; inset: 0; background: center / cover no-repeat; }
.dsm-photo-logo .dsm-photo-thumb { background-size: contain; background-color: #fff; }
.dsm-photo-label { position: relative; font-size: 12px; font-weight: 600; color: #555; text-align: center; padding: 0 4px; }
.dsm-photo-label::before { content: "+"; display: block; font-size: 22px; line-height: 1; color: #27a1ff; font-weight: 400; }
.dsm-photo.has-img .dsm-photo-label { display: none; }
.dsm-photo.has-img .dsm-photo-drop { border-style: solid; border-color: #d9e8cc; }
.dsm-photo.has-err .dsm-photo-drop { border-color: #c1272d; background: #fff6f6; }
.dsm-photo-progress { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); padding: 1px 6px; border-radius: 8px; }
.dsm-photo-progress:empty { display: none; }
.dsm-photo-remove { display: none; position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; padding: 0 !important; line-height: 21px; border-radius: 50% !important; border: 1px solid #ccc !important; background: #fff !important; color: #c0392b !important; font-size: 17px; font-weight: 700; text-align: center; cursor: pointer; z-index: 2; }
.dsm-photo.has-img .dsm-photo-remove { display: block; }
.dsm-photo-round .dsm-photo-remove { right: auto; left: 80px; }
.dsm-photo-remove:hover, .dsm-photo-remove:focus { background: #c0392b !important; color: #fff !important; border-color: #c0392b !important; }

.dsm-qr-check { font-size: 12px; color: #555; overflow-wrap: anywhere; }
.dsm-qr-check:empty { display: none; }
.dsm-qr-check a { color: #27a1ff; }
.dsm-qr-check.is-ok .dsm-qr-test { color: #4f8f1f; font-weight: 600; }
.dsm-qr-check.is-err { color: #c1272d; font-weight: 600; }

/* Phones and small tablets: preview pinned on top, form scrolls under it. */
@media (max-width: 820px) {
	.dsm-modal-body { flex-direction: column; }
	.dsm-stage { order: -1; flex: 0 0 auto; padding: 10px; }
	.dsm-stage-cards { gap: 12px; }
	.dsm-big-canvas { width: min(120px, 30vw); }
	.dsm-stage-note { display: none; }
	.dsm-form { padding: 14px 16px 30px; }
	.dsm-modal-head { padding: 8px 12px; }
	.dsm-modal-head h2 { font-size: 15px; }
	.dsm-modal-foot { padding: 10px 12px; }
	.dsm-done { padding: 11px 18px; }
}
