/*
 * No @font-face here on purpose. Faces are generated from whatever is in assets/fonts and appended
 * to this stylesheet at enqueue time, so a hard-coded rule would either duplicate one of them or
 * request a file that has since been renamed.
 */

/*
 * Tokens lifted from the shop's own Elementor globals and computed styles, so the designer is the
 * same object as the rest of the site rather than an approximation of it:
 *   page #FFE5E6 · cards white / 20px / 0 8px 24px rgba(0,0,0,.08)
 *   buttons 16px with the signature red glow and inset top highlight
 */
:root {
	--nd-red: #f04a4a;
	--nd-red-dark: #d93f3f;
	--nd-page: #ffe5e6;
	--nd-surface: #ffffff;
	--nd-tint: #fff5f4;
	--nd-ink: #333333;
	--nd-muted: #9a9a9a;
	--nd-line: #f3dede;

	--nd-radius: 20px;
	--nd-radius-sm: 16px;
	--nd-card: 0 8px 24px rgba( 0, 0, 0, 0.08 );
	--nd-soft: 0 1px 3px rgba( 0, 0, 0, 0.12 ), 0 5px 10px rgba( 240, 74, 74, 0.3 ), inset 0 1px 0 rgba( 255, 255, 255, 0.4 );
	--nd-soft-flat: 0 1px 3px rgba( 0, 0, 0, 0.06 ), 0 4px 10px rgba( 240, 74, 74, 0.1 ), inset 0 1px 0 rgba( 255, 255, 255, 0.7 );
}

.nd-body * { box-sizing: border-box; }

html:has( .nd-app ),
body.nd-body {
	margin: 0;
	padding: 0;
	overflow: hidden;
	overscroll-behavior: none;
	background: var( --nd-page );
	color: var( --nd-ink );
	font-family: 'Vazirmatn', system-ui, sans-serif;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}

/*
 * Fixed rather than `height: 100dvh`. A themed WordPress page carries margins that are not ours —
 * the admin bar alone pushes `html` down by 32px — and any of them would shove the bottom bar off
 * the screen with no way to scroll to it.
 */
.nd-app {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	max-width: 720px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	background: var( --nd-page );
}

/* ---------- boot curtain ---------- */

.nd-boot {
	position: fixed;
	inset: 0;
	z-index: 90;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: var( --nd-page );
	transition: opacity 0.35s ease, visibility 0.35s;
}

.nd-boot p {
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
	color: var( --nd-red );
}

.nd-boot-mark {
	display: grid;
	place-items: center;
	width: 78px;
	height: 78px;
	color: var( --nd-red );
	background: var( --nd-surface );
	border-radius: 26px;
	box-shadow: var( --nd-card );
	animation: nd-breathe 1.5s ease-in-out infinite;
}

@keyframes nd-breathe {
	0%, 100% { transform: scale( 1 ); box-shadow: var( --nd-card ); }
	50%      { transform: scale( 1.07 ); box-shadow: var( --nd-soft ); }
}

/* The app is built behind the curtain, so nothing half-drawn is ever visible. */
.nd-app { opacity: 0; transition: opacity 0.3s ease 0.05s; }

.nd-ready .nd-app { opacity: 1; }

.nd-ready .nd-boot {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* ---------- top strip: back button sits with the view tabs ---------- */

.nd-topstrip {
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 12px 6px;
	margin-top: calc( 10px + env( safe-area-inset-top ) );
	min-width: 0;
}

.nd-back {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	flex: none;
	color: var( --nd-red );
	background: var( --nd-surface );
	border-radius: var( --nd-radius-sm );
	box-shadow: var( --nd-card );
	text-decoration: none;
	transition: transform 0.15s;
}

.nd-back:active { transform: scale( 0.93 ); }

/* ---------- view tabs ---------- */

.nd-sides {
	flex: 1;
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 5px;
	min-width: 0;
	background: var( --nd-surface );
	border-radius: 999px;
	box-shadow: var( --nd-card );
}

/*
 * Every tab takes an equal share and shrinks with the viewport rather than scrolling out of the
 * pill. `min-width: 0` is what lets a flex item go narrower than its own text.
 */
.nd-side {
	flex: 1 1 0;
	min-width: 0;
	padding: 9px 4px;
	font: inherit;
	font-size: clamp( 10.5px, 3.1vw, 13.5px );
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var( --nd-muted );
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.nd-side.is-active {
	color: #fff;
	background: var( --nd-red );
	box-shadow: var( --nd-soft );
}

/* ---------- canvas ---------- */

/*
 * `min-height: 0` is doing real work here. Without it a flex item refuses to shrink below its
 * content, the stage keeps its natural size, and on a phone it overflows on to the tabs above and
 * the toolbar below — which is exactly what it did.
 */
.nd-stage-wrap {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	overflow: hidden;
}

/*
 * No card, no fill. The mockups carry their own transparency, so anything painted behind them shows
 * as a rectangle around the garment — the page's own pink is what should be there instead.
 */
.nd-stage {
	position: relative;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	touch-action: none;
}

.nd-stage canvas { display: block; }

/*
 * The printable polygon. Dashed so it never reads as part of the design, and drawn over the canvas
 * rather than under it so the boundary stays visible beneath artwork.
 */
.nd-guide {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
}

.nd-guide polygon {
	fill: none;
	stroke: rgba( 255, 255, 255, 0.65 );
	stroke-width: 1.5;
	stroke-dasharray: 7 6;
	vector-effect: non-scaling-stroke;
}

/* ---------- selection toolbar ---------- */

/* Floats over the canvas instead of taking a row of its own: vertical space is the scarce
   resource on a phone, and the toolbar is only present while something is selected. */
.nd-toolbar {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX( -50% );
	z-index: 5;
	display: flex;
	justify-content: center;
	gap: 2px;
	max-width: calc( 100% - 20px );
	padding: 5px;
	background: rgba( 255, 255, 255, 0.96 );
	backdrop-filter: blur( 6px );
	border-radius: var( --nd-radius-sm );
	box-shadow: var( --nd-card );
	overflow-x: auto;
	scrollbar-width: none;
}

.nd-toolbar::-webkit-scrollbar { display: none; }

.nd-toolbar button {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	color: var( --nd-ink );
	background: none;
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	transition: background 0.15s;
}

.nd-toolbar button:hover { background: var( --nd-tint ); }
.nd-toolbar button.nd-danger { color: var( --nd-red ); }
.nd-toolbar button.nd-danger:hover { background: var( --nd-page ); }

/* ---------- bottom actions ---------- */

/*
 * Two rows: tools on top, the commitment below. Six controls in a single row is unreadable at
 * 375px, and burying "ثبت سفارش" among the tools makes the one action that matters the hardest
 * to find.
 */
.nd-actions {
	flex: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 6px 12px 12px;
	margin-bottom: calc( 12px + env( safe-area-inset-bottom ) );
	padding: 10px;
	background: var( --nd-surface );
	border-radius: var( --nd-radius );
	box-shadow: var( --nd-card );
}

/* One row, five equal columns: four tools and the commitment. */
.nd-tools {
	display: grid;
	grid-template-columns: repeat( 5, 1fr );
	gap: 6px;
}

.nd-action {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 10px 2px;
	font: inherit;
	font-size: clamp( 9.5px, 2.9vw, 11.5px );
	font-weight: 600;
	color: var( --nd-ink );
	background: var( --nd-tint );
	border: 0;
	border-radius: 14px;
	box-shadow: var( --nd-soft-flat );
	text-align: center;
	line-height: 1.3;
	cursor: pointer;
	transition: transform 0.1s, background 0.15s;
}

.nd-action svg { color: var( --nd-red ); }
.nd-action:active { transform: translateY( 1px ); }

.nd-action--primary {
	color: #fff;
	background: var( --nd-red );
	box-shadow: var( --nd-soft );
}

.nd-action--primary svg { color: #fff; }

/* Ghost button: same weight as the primary, without claiming to be the next step. */
/* Destructive, and never the button the thumb lands on by default. */
.nd-btn--quiet {
	margin-top: 6px;
	color: var( --nd-muted );
	background: none;
	box-shadow: none;
	font-weight: 600;
	font-size: 13.5px;
}

.nd-btn--ghost {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	color: var( --nd-red );
	background: var( --nd-tint );
	box-shadow: var( --nd-soft-flat );
}

.nd-btn--ghost svg { width: 18px; height: 18px; }

/* Count of uploaded files, and the "you wrote something" dot on the notes button. */
.nd-badge {
	position: absolute;
	top: 6px;
	inset-inline-end: 8px;
	min-width: 18px;
	padding: 0 5px;
	font-size: 10.5px;
	font-style: normal;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	color: #fff;
	background: var( --nd-red );
	border-radius: 999px;
}

.nd-dot {
	position: absolute;
	top: 9px;
	inset-inline-end: 11px;
	width: 8px;
	height: 8px;
	background: var( --nd-red );
	border-radius: 50%;
}

/* ---------- sheets ---------- */

.nd-scrim {
	position: fixed;
	inset: 0;
	z-index: 25;
	background: rgba( 51, 30, 30, 0.35 );
	backdrop-filter: blur( 2px );
}

.nd-sheet {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 30;
	max-width: 720px;
	max-height: 82vh;
	overflow-y: auto;
	margin-inline: auto;
	background: var( --nd-surface );
	border-radius: 24px 24px 0 0;
	box-shadow: 0 -6px 32px rgba( 0, 0, 0, 0.16 );
	animation: nd-rise 0.2s ease-out;
}

@keyframes nd-rise {
	from { transform: translateY( 100% ); }
	to   { transform: translateY( 0 ); }
}

.nd-sheet-inner {
	padding: 8px 16px calc( 20px + env( safe-area-inset-bottom ) );
}

/* Grab handle, drawn rather than marked up. */
.nd-sheet-inner::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	margin: 6px auto 14px;
	background: var( --nd-line );
	border-radius: 999px;
}

.nd-sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.nd-sheet-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: var( --nd-ink );
}

.nd-sheet-close {
	width: 32px;
	height: 32px;
	font-size: 24px;
	line-height: 1;
	color: var( --nd-muted );
	background: var( --nd-tint );
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.nd-hint {
	margin: 0 0 14px;
	font-size: 12.5px;
	line-height: 1.8;
	color: var( --nd-muted );
}

/* ---------- size picker on the mockup ---------- */

.nd-sizepicker {
	position: absolute;
	top: 14px;
	inset-inline-start: 14px;
	z-index: 6;
}

/* Sized by its label, not by the column it sits in. */
.nd-sizebtn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	width: auto;
	padding: 7px 12px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 700;
	white-space: nowrap;
	color: var( --nd-red );
	background: var( --nd-surface );
	border: 0;
	border-radius: 999px;
	box-shadow: var( --nd-card );
	cursor: pointer;
}

.nd-sizepicker.is-chosen .nd-sizebtn {
	color: #fff;
	background: var( --nd-red );
	box-shadow: var( --nd-soft );
}

.nd-sizebtn svg { width: 14px; height: 14px; flex: none; }
.nd-sizebtn[aria-expanded="true"] svg { transform: rotate( 180deg ); }

.nd-sizepanel {
	position: absolute;
	top: 100%;
	inset-inline-start: 0;
	width: max-content;
	min-width: 190px;
	max-width: 62vw;
	margin-top: 6px;
	padding: 8px;
	background: var( --nd-surface );
	border-radius: var( --nd-radius-sm );
	box-shadow: var( --nd-card );
}

.nd-sizelist {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 52px, 1fr ) );
	gap: 5px;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}

.nd-sizeopt {
	width: 100%;
	padding: 9px 4px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 700;
	color: var( --nd-ink );
	background: var( --nd-tint );
	border: 1px solid transparent;
	border-radius: 10px;
	cursor: pointer;
}

.nd-sizeopt.is-active {
	color: #fff;
	background: var( --nd-red );
}

.nd-sizelinks {
	display: flex;
	gap: 6px;
	padding-top: 8px;
	border-top: 1px solid var( --nd-line );
}

.nd-sizelink {
	flex: 1;
	padding: 9px 6px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 700;
	color: #fff;
	background: var( --nd-red );
	border: 0;
	border-radius: 10px;
	box-shadow: var( --nd-soft );
	cursor: pointer;
}

.nd-sizelink:active { transform: translateY( 1px ); }
.nd-sizelink[hidden] { display: none; }

/* Elementor content borrowed from the product pages needs room and its own scroll. */
.nd-sheet--tall .nd-sheet-inner { max-height: 82vh; }

.nd-popup-body {
	max-height: 66vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.nd-popup-body img { max-width: 100%; height: auto; }
.nd-popup-body table { width: 100%; border-collapse: collapse; }

/* The detached popup document is a plain container now; let it use the sheet's full width. */
.nd-popup-body .elementor,
.nd-popup-body .nd-embedded-popup {
	width: 100% !important;
	max-width: 100% !important;
}

.nd-popup-body .e-con,
.nd-popup-body .e-con-inner {
	max-width: 100% !important;
}

/*
 * Belt and braces: if a future Elementor build still wraps the content in dialog chrome, unwrap it.
 *
 * A popup document renders wrapped in `.dialog-widget > .dialog-widget-content > .dialog-message`,
 * and Elementor's own stylesheet keeps that wrapper at `display: none`, absolutely positioned, until
 * its dialog script opens it. We embed the markup without running that script, so without these
 * overrides the sheet slides up containing content the browser has been told not to paint.
 */
.nd-popup-body .dialog-widget,
.nd-popup-body .dialog-lightbox-widget,
.nd-popup-body .elementor-popup-modal {
	display: block !important;
	position: static !important;
	inset: auto !important;
	width: auto !important;
	height: auto !important;
	background: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

.nd-popup-body .dialog-widget-content {
	position: static !important;
	transform: none !important;
	animation: none !important;
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	max-height: none !important;
	margin: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

.nd-popup-body .dialog-message {
	display: block !important;
	width: auto !important;
	max-height: none !important;
	overflow: visible !important;
	padding: 0 !important;
}

/* The sheet has its own close control; Elementor's would be a second, differently-styled one. */
.nd-popup-body .dialog-close-button,
.nd-popup-body .elementor-popup-modal .dialog-close-button {
	display: none !important;
}

/* Per-file upload progress. Sits between the name and the status line. */
.nd-fileprogress {
	display: block;
	height: 4px;
	margin: 6px 0 4px;
	background: var( --nd-line );
	border-radius: 999px;
	overflow: hidden;
}

.nd-fileprogress[hidden] { display: none; }

.nd-fileprogress i {
	display: block;
	height: 100%;
	width: 0;
	background: var( --nd-red );
	border-radius: 999px;
	transition: width 0.15s linear;
}

.nd-filestatus.is-warn { color: var( --nd-warn, #b45309 ); font-weight: 600; }

/* ---------- text editor ---------- */

#nd-text-input {
	width: 100%;
	padding: 14px;
	font: inherit;
	font-size: 16px;      /* below 16px iOS zooms the whole page on focus */
	font-weight: 600;
	color: var( --nd-ink );
	background: var( --nd-tint );
	border: 1px solid var( --nd-line );
	border-radius: var( --nd-radius-sm );
	resize: none;
}

#nd-text-input:focus {
	outline: none;
	border-color: var( --nd-red );
	background: var( --nd-surface );
}

.nd-text-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 12px;
}

.nd-control {
	padding: 10px 12px;
	background: var( --nd-tint );
	border-radius: var( --nd-radius-sm );
}

.nd-control > label {
	display: block;
	margin-bottom: 7px;
	font-size: 11.5px;
	font-weight: 700;
	color: var( --nd-muted );
}

.nd-control select {
	width: 100%;
	padding: 9px 10px;
	font: inherit;
	font-size: 14px;
	color: var( --nd-ink );
	background: var( --nd-surface );
	border: 1px solid var( --nd-line );
	border-radius: 11px;
}

/* Size as a stepper rather than a slider: on a phone a slider is a coin toss. */
.nd-stepper {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 3px;
	background: var( --nd-surface );
	border: 1px solid var( --nd-line );
	border-radius: 11px;
}

.nd-stepper button {
	flex: none;
	width: 34px;
	height: 32px;
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	color: var( --nd-red );
	background: var( --nd-tint );
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.nd-stepper button:active { transform: translateY( 1px ); }

.nd-stepper output {
	flex: 1;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.nd-control--color { grid-column: 1 / -1; }

.nd-swatches {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	vertical-align: middle;
}

.nd-swatch {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 2px solid var( --nd-surface );
	border-radius: 50%;
	box-shadow: 0 0 0 1px var( --nd-line );
	cursor: pointer;
	transition: transform 0.12s, box-shadow 0.12s;
}

.nd-swatch.is-active {
	transform: scale( 1.14 );
	box-shadow: 0 0 0 2px var( --nd-red );
}

/* The native picker stays, for anything outside the preset row. */
.nd-control--color input[type="color"] {
	width: 32px;
	height: 32px;
	margin-inline-start: 8px;
	padding: 0;
	vertical-align: middle;
	background: none;
	border: 1px dashed var( --nd-muted );
	border-radius: 50%;
	cursor: pointer;
}

/* ---------- sheet tabs ---------- */

.nd-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var( --nd-tint );
	border-radius: 999px;
}

.nd-tab {
	padding: 8px 14px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
	color: var( --nd-muted );
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

.nd-tab.is-active {
	color: #fff;
	background: var( --nd-red );
}

/* ---------- layer list ---------- */

.nd-layerlist {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nd-layeritem {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	background: var( --nd-tint );
	border: 1px solid transparent;
	border-radius: 14px;
}

.nd-layeritem.is-active {
	border-color: var( --nd-red );
	background: var( --nd-page );
}

.nd-layerthumb {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	font-size: 17px;
	font-weight: 800;
	color: var( --nd-red );
	background-color: var( --nd-surface );
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid var( --nd-line );
	border-radius: 10px;
}

.nd-layername {
	flex: 1;
	min-width: 0;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	text-align: start;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var( --nd-ink );
	background: none;
	border: 0;
	cursor: pointer;
}

.nd-layerbtn {
	flex: none;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	color: var( --nd-ink );
	background: var( --nd-surface );
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.nd-layerbtn svg { width: 17px; height: 17px; }
.nd-layerbtn.nd-danger { color: var( --nd-red ); }

/* Ring around the layers button while anything is still uploading. */
.nd-uploading {
	position: absolute;
	top: 6px;
	inset-inline-start: 8px;
	width: 13px;
	height: 13px;
	border: 2px solid var( --nd-page );
	border-top-color: var( --nd-red );
	border-radius: 50%;
	animation: nd-spin 0.7s linear infinite;
}

.nd-uploading[hidden] { display: none; }

.nd-action.is-uploading svg { color: var( --nd-red ); }

/* ---------- file tray ---------- */

.nd-filelist {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nd-fileitem {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	background: var( --nd-tint );
	border-radius: var( --nd-radius-sm );
}

.nd-fileitem.is-failed { background: var( --nd-page ); }

.nd-filethumb {
	flex: none;
	width: 58px;
	height: 58px;
	padding: 0;
	background-color: var( --nd-surface );
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid var( --nd-line );
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.12s;
}

.nd-filethumb:active { transform: scale( 0.95 ); }

.nd-filemeta {
	flex: 1;
	min-width: 0;
}

.nd-filename {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nd-filestatus {
	margin: 0 0 6px;
	font-size: 11.5px;
	color: var( --nd-muted );
}

.nd-cutout {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: var( --nd-ink );
	cursor: pointer;
}

.nd-cutout input {
	width: 18px;
	height: 18px;
	accent-color: var( --nd-red );
}

.nd-filedel {
	flex: none;
	width: 32px;
	height: 32px;
	font-size: 20px;
	line-height: 1;
	color: var( --nd-muted );
	background: none;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.nd-filedel:hover { color: var( --nd-red ); background: var( --nd-page ); }

.nd-empty {
	margin: 24px 0;
	font-size: 13.5px;
	text-align: center;
	color: var( --nd-muted );
}

/* ---------- form controls ---------- */

#nd-notes,
.nd-field select {
	width: 100%;
	padding: 13px;
	font: inherit;
	font-size: 16px;      /* below 16px iOS zooms the whole page on focus */
	color: var( --nd-ink );
	background: var( --nd-tint );
	border: 1px solid var( --nd-line );
	border-radius: 14px;
	resize: none;
}

#nd-notes:focus,
.nd-field select:focus {
	outline: none;
	border-color: var( --nd-red );
}

.nd-field { display: block; margin-bottom: 14px; }

.nd-field > span {
	display: block;
	margin-bottom: 7px;
	font-size: 13px;
	font-weight: 600;
	color: var( --nd-muted );
}

/* Price breakdown: every row that adds up to the figure the customer is asked to pay. */
.nd-breakdown {
	width: 100%;
	margin: 0 0 4px;
	border-collapse: collapse;
	font-size: 13.5px;
}

.nd-breakdown th,
.nd-breakdown td {
	padding: 11px 4px;
	text-align: start;
	font-weight: 500;
	color: var( --nd-ink );
	border-bottom: 1px solid var( --nd-line );
}

.nd-breakdown td {
	text-align: end;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.nd-breakdown td.is-free { color: var( --nd-muted ); }

.nd-breakdown tfoot th,
.nd-breakdown tfoot td {
	padding-top: 14px;
	font-weight: 800;
	border-bottom: 0;
}

.nd-breakdown tfoot td {
	font-size: 19px;
	color: var( --nd-red );
}

.nd-btn {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 15px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	border: 0;
	border-radius: var( --nd-radius-sm );
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
}

.nd-btn--primary {
	color: #fff;
	background: var( --nd-red );
	box-shadow: var( --nd-soft );
}

.nd-btn--primary:hover { background: var( --nd-red-dark ); }
.nd-btn--primary:active { transform: translateY( 1px ); }

/* ---------- overlays ---------- */

.nd-busy {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	font-size: 14px;
	font-weight: 600;
	color: var( --nd-ink );
	background: rgba( 255, 229, 230, 0.88 );
	backdrop-filter: blur( 3px );
}

.nd-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba( 240, 74, 74, 0.25 );
	border-top-color: var( --nd-red );
	border-radius: 50%;
	animation: nd-spin 0.7s linear infinite;
}

@keyframes nd-spin { to { transform: rotate( 360deg ); } }

.nd-toast {
	position: fixed;
	bottom: calc( 110px + env( safe-area-inset-bottom ) );
	inset-inline: 0;
	z-index: 60;
	width: fit-content;
	max-width: min( 88%, 420px );
	margin-inline: auto;
	padding: 12px 18px;
	font-size: 13px;
	line-height: 1.7;
	text-align: center;
	color: #fff;
	background: rgba( 51, 30, 30, 0.95 );
	border-radius: 14px;
}

[hidden] { display: none !important; }

/* Rendered inside the theme when the designer is closed or not yet configured. */
.nd-notice {
	margin: 32px auto;
	max-width: 640px;
	padding: 18px 20px;
	font-family: 'Vazirmatn', system-ui, sans-serif;
	font-size: 15px;
	line-height: 1.9;
	color: var( --nd-ink );
	background: var( --nd-page );
	border-radius: var( --nd-radius );
}

.nd-notice a { color: var( --nd-red-dark ); }

/* ---------- desktop ---------- */

@media ( min-width: 768px ) {
	.nd-app {
		top: 20px;
		bottom: 20px;
		border-radius: 26px;
		overflow: hidden;
	}

	.nd-action { font-size: 12.5px; }

	.nd-sheet {
		border-radius: var( --nd-radius );
		bottom: 20px;
		inset-inline: 20px;
		max-width: 680px;
	}
}
