/* طراح سه‌بعدی رک فوکا — تم شیشه‌ای (کریستالی) سفید و زرد */
.fuka-rd {
	--fuka-accent: var(--fuka-accent-g, #fdc60a);
	--fuka-accent-2: #ffdf6b;
	--fuka-text: #1c2430;
	--fuka-muted: #6b7280;
	--fuka-glass: rgba(255, 255, 255, .58);
	--fuka-glass-2: rgba(255, 255, 255, .78);
	--fuka-panel: var(--fuka-glass);
	--fuka-line: rgba(255, 255, 255, .85);
	--fuka-hair: rgba(28, 36, 48, .08);
	--fuka-shadow: 0 10px 34px rgba(120, 96, 20, .10), 0 2px 8px rgba(28, 36, 48, .06);
	--fuka-radius: 18px;
	position: relative;
	isolation: isolate;
	direction: rtl;
	text-align: right;
	color: var(--fuka-text);
	font-family: inherit;
	line-height: 1.65;
	box-sizing: border-box;
	padding: 18px;
	border-radius: calc(var(--fuka-radius) + 8px);
	background:
		radial-gradient(900px 420px at 88% -10%, rgba(253, 198, 10, .30), transparent 60%),
		radial-gradient(700px 380px at 0% 110%, rgba(253, 198, 10, .18), transparent 60%),
		linear-gradient(160deg, #ffffff 0%, #fffaf0 55%, #fff4d6 100%);
	overflow: hidden;
}
.fuka-rd::before, .fuka-rd::after {
	content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); pointer-events: none;
}
.fuka-rd::before { width: 320px; height: 320px; top: -120px; left: 18%; background: rgba(253, 198, 10, .22); }
.fuka-rd::after { width: 260px; height: 260px; bottom: -110px; right: 12%; background: rgba(255, 255, 255, .9); }
.fuka-rd *, .fuka-rd *::before, .fuka-rd *::after { box-sizing: border-box; }

.fuka-rd-section { margin: 32px 0; }
.fuka-rd-section > h2 { margin-bottom: 14px; }
.fuka-rd-msg { padding: 14px; background: #fff8e1; border: 1px solid #f5dd8a; border-radius: 12px; }

/* شیشه */
.fuka-rd-card, .fuka-rd-bottom, .fuka-rd-toolbar, .fuka-rd-stage {
	background: var(--fuka-glass);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	backdrop-filter: blur(16px) saturate(160%);
	border: 1px solid var(--fuka-line);
	box-shadow: var(--fuka-shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
	border-radius: var(--fuka-radius);
}

.fuka-rd-ui { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 16px; align-items: start; }

.fuka-rd-card { padding: 16px; margin-bottom: 12px; }
.fuka-rd-card h3 { margin: 0 0 12px; font-size: 1em; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.fuka-rd-card h3::before {
	content: ''; width: 8px; height: 18px; border-radius: 4px;
	background: linear-gradient(180deg, var(--fuka-accent-2), var(--fuka-accent));
	box-shadow: 0 0 10px rgba(253, 198, 10, .6);
}

.fuka-rd select, .fuka-rd input[type=number] {
	width: 100%; min-height: 40px; padding: 6px 12px;
	border: 1px solid rgba(28, 36, 48, .1); border-radius: 12px;
	background: var(--fuka-glass-2); color: inherit; font: inherit;
	transition: border-color .15s, box-shadow .15s;
}
.fuka-rd select:focus, .fuka-rd input[type=number]:focus { outline: none; border-color: var(--fuka-accent); box-shadow: 0 0 0 3px rgba(253, 198, 10, .25); }

.fuka-rd-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fuka-rd-custom[hidden] { display: none; }
.fuka-rd-custom label { font-size: .85em; color: var(--fuka-muted); }
.fuka-rd-custom input, .fuka-rd-custom select { margin-top: 3px; }
.fuka-rd-custom .full { grid-column: 1 / -1; }

.fuka-rd-rackinfo { margin-top: 12px; font-size: .9em; }
.fuka-rd-dims { display: flex; flex-wrap: wrap; gap: 6px; }
.fuka-rd-dims span { background: rgba(255, 255, 255, .75); border: 1px solid var(--fuka-hair); border-radius: 999px; padding: 2px 11px; font-size: .85em; }
.fuka-rd-price { margin-top: 10px; }
.fuka-rd-price b { color: #9a7200; }
.fuka-rd-link { display: inline-block; margin-top: 4px; color: inherit; text-decoration: underline; text-decoration-color: var(--fuka-accent); text-underline-offset: 4px; }
.fuka-rd-note { margin-top: 8px; font-size: .85em; color: var(--fuka-muted); }

.fuka-rd-gt { font-size: .8em; color: var(--fuka-muted); margin: 8px 0 6px; }
.fuka-rd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fuka-rd-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, .95); border-radius: 999px; background: rgba(255, 255, 255, .7);
	color: inherit; font: inherit; font-size: .85em; cursor: pointer; box-shadow: 0 2px 8px rgba(28, 36, 48, .05);
	transition: transform .12s, box-shadow .15s, background .15s;
}
.fuka-rd-chip:hover { background: #fff; box-shadow: 0 4px 14px rgba(253, 198, 10, .28); }
.fuka-rd-chip:active { transform: scale(.96); }
.fuka-rd-chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fuka-rd-chip small { color: var(--fuka-muted); }

.fuka-rd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fuka-rd-actions button, .fuka-rd-views button, .fuka-rd-toggles button {
	padding: 6px 13px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 12px; background: rgba(255, 255, 255, .7);
	color: inherit; font: inherit; font-size: .85em; cursor: pointer; transition: background .15s, box-shadow .15s;
}
.fuka-rd-actions button:hover, .fuka-rd-views button:hover, .fuka-rd-toggles button:hover { background: #fff; box-shadow: 0 3px 12px rgba(253, 198, 10, .3); }

.fuka-rd-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.fuka-rd-empty { color: var(--fuka-muted); font-size: .9em; padding: 6px 0; }
.fuka-rd-row {
	display: flex; align-items: center; gap: 6px; padding: 7px 9px; margin-bottom: 5px;
	border: 1px solid rgba(255, 255, 255, .95); border-radius: 12px; background: rgba(255, 255, 255, .66); cursor: pointer;
	transition: background .15s, box-shadow .15s;
}
.fuka-rd-row:hover { background: rgba(255, 255, 255, .92); }
.fuka-rd-row.sel { border-color: var(--fuka-accent); box-shadow: 0 0 0 3px rgba(253, 198, 10, .25); background: #fffdf3; }
.fuka-rd-row.bad { border-color: #f3b4b4; background: rgba(255, 240, 240, .85); }
.fuka-rd-row i { width: 8px; height: 24px; border-radius: 4px; flex: none; }
.fuka-rd-row .n { flex: 1; min-width: 0; font-size: .88em; display: flex; flex-direction: column; line-height: 1.3; }
.fuka-rd-row .n small { color: var(--fuka-muted); font-size: .8em; }
.fuka-rd-row .d { display: flex; align-items: center; gap: 2px; flex: none; }
.fuka-rd-row .d input { width: 56px; min-height: 30px; padding: 2px 4px; text-align: center; border-radius: 9px; }
.fuka-rd-row .d em { font-style: normal; font-size: .72em; color: var(--fuka-muted); }
.fuka-rd-row button {
	width: 27px; height: 27px; padding: 0; border: 1px solid var(--fuka-hair); border-radius: 8px;
	background: rgba(255, 255, 255, .85); color: inherit; cursor: pointer; font-size: .75em; flex: none;
}
.fuka-rd-row button:hover { border-color: var(--fuka-accent); background: #fff8dc; }

.fuka-rd-main { min-width: 0; }
.fuka-rd-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding: 8px; }
.fuka-rd-views, .fuka-rd-toggles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fuka-rd-toggles label { font-size: .85em; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 0 4px; }
.fuka-rd-toggles input { accent-color: var(--fuka-accent); }

.fuka-rd-stage { position: relative; height: var(--fuka-stage-h, 640px); overflow: hidden; padding: 0; }
.fuka-rd-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; border-radius: inherit; }
.fuka-rd-stage canvas:active { cursor: grabbing; }
.fuka-rd-hint {
	position: absolute; left: 0; right: 0; bottom: 10px; margin: auto; width: max-content; max-width: 92%;
	padding: 4px 14px; border-radius: 999px; text-align: center; font-size: .74em; color: #5b6270; pointer-events: none;
	background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .9);
}
.fuka-rd-stage:fullscreen { height: 100vh !important; border-radius: 0; }

.fuka-rd-bottom { margin-top: 12px; padding: 16px; }
.fuka-rd-status { display: inline-block; padding: 3px 14px; border-radius: 999px; font-size: .85em; font-weight: 700; }
.fuka-rd-status.ok { background: rgba(231, 247, 236, .9); color: #166534; }
.fuka-rd-status.bad { background: rgba(253, 232, 232, .9); color: #b91c1c; }
.fuka-rd-meter { height: 9px; background: rgba(28, 36, 48, .07); border-radius: 99px; margin: 12px 0 6px; overflow: hidden; }
.fuka-rd-meter span {
	display: block; height: 100%; border-radius: 99px; transition: width .25s;
	background: linear-gradient(90deg, var(--fuka-accent-2), var(--fuka-accent)); box-shadow: 0 0 12px rgba(253, 198, 10, .6);
}
.fuka-rd-nums { font-size: .9em; }
.fuka-rd-msgs { margin-top: 10px; display: grid; gap: 6px; }
.fuka-rd-msgs .m { padding: 8px 12px; border-radius: 12px; font-size: .85em; border: 1px solid; }
.fuka-rd-msgs .e { background: rgba(255, 245, 245, .85); border-color: #f3c4c4; color: #991b1b; }
.fuka-rd-msgs .w { background: rgba(255, 250, 230, .9); border-color: #f1dd9a; color: #7a5a06; }
.fuka-rd-msgs .i { background: rgba(255, 255, 255, .75); border-color: rgba(28, 36, 48, .08); color: #374151; }

.fuka-rd-out { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fuka-rd-btn {
	display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px;
	border: 1px solid rgba(255, 255, 255, .95); border-radius: 14px; background: rgba(255, 255, 255, .72);
	color: inherit; font: inherit; font-size: .9em; text-decoration: none; cursor: pointer;
	box-shadow: 0 2px 10px rgba(28, 36, 48, .05); transition: background .15s, box-shadow .15s, transform .1s;
}
.fuka-rd-btn:hover { background: #fff; box-shadow: 0 6px 18px rgba(253, 198, 10, .3); }
.fuka-rd-btn:active { transform: translateY(1px); }
.fuka-rd-btn.primary {
	background: linear-gradient(180deg, var(--fuka-accent-2), var(--fuka-accent)); border-color: rgba(255, 255, 255, .6);
	color: #1c1c1c; font-weight: 800; box-shadow: 0 6px 20px rgba(253, 198, 10, .45), inset 0 1px 0 rgba(255, 255, 255, .7);
}

@media (max-width: 900px) {
	.fuka-rd { padding: 10px; }
	.fuka-rd-ui { grid-template-columns: 1fr; }
	.fuka-rd-main { order: -1; }
	.fuka-rd-stage { height: min(var(--fuka-stage-h, 640px), 70vh); }
	.fuka-rd-list { max-height: 280px; }
}

/* ---- پیش‌فاکتور در طراح ---- */
.fuka-rd-bom:empty { display: none; }
.fuka-rd-bom { margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .95); }
.fuka-rd-bomhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.fuka-rd-bomhead b { font-weight: 800; }
.fuka-rd-fans { display: inline-flex; align-items: center; gap: 6px; font-size: .85em; color: var(--fuka-muted); }
.fuka-rd-fans button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--fuka-hair); background: #fff; cursor: pointer; font: inherit; line-height: 1; }
.fuka-rd-fans button:hover { border-color: var(--fuka-accent); }
.fuka-rd-fans em { font-style: normal; min-width: 14px; text-align: center; color: var(--fuka-text); font-weight: 700; }
.fuka-rd-bomt { width: 100%; border-collapse: collapse; font-size: .9em; }
.fuka-rd-bomt td { padding: 7px 4px; border-top: 1px solid var(--fuka-hair); vertical-align: top; }
.fuka-rd-bomt tbody tr:first-child td { border-top: 0; }
.fuka-rd-bomt .p { text-align: left; white-space: nowrap; direction: rtl; }
.fuka-rd-bomt .p small, .fuka-rd-order .fro-p small { color: var(--fuka-muted); font-weight: 400; }
.fuka-rd-bomt .q { color: var(--fuka-muted); font-size: .9em; }
.fuka-rd-bomt em { font-style: normal; color: #9a7200; font-size: .9em; }
.fuka-rd-bomt tfoot td { border-top: 2px solid rgba(253, 198, 10, .6); font-size: 1.05em; padding-top: 10px; }
.fuka-rd-bomt tfoot b { color: #1c2430; }
.fuka-rd-devs { margin-top: 8px; font-size: .82em; color: var(--fuka-muted); }
.fuka-rd-btn.big { padding: 11px 24px; font-size: 1em; }
.fuka-rd-btn.disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }

/* ---- کادر پیکربندی در صفحه‌ی محصول ---- */
.fuka-rd-order {
	direction: rtl; text-align: right; margin: 18px 0; padding: 16px; border-radius: 20px; color: #1c2430;
	background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 248, 225, .9));
	border: 1px solid rgba(253, 198, 10, .45);
	box-shadow: 0 10px 34px rgba(120, 96, 20, .12), inset 0 1px 0 #fff;
}
.fuka-rd-order .fro-table { width: 100%; border-collapse: collapse; font-size: .92em; margin: 0; border: 0; }
.fuka-rd-order .fro-table td { padding: 7px 4px; border: 0; border-top: 1px solid rgba(28, 36, 48, .08); background: transparent; }
.fuka-rd-order .fro-p { text-align: left; white-space: nowrap; }
.fuka-rd-order .fro-q { color: #6b7280; }
.fuka-rd-order em { font-style: normal; color: #9a7200; }
.fuka-rd-order tfoot td { border-top: 2px solid rgba(253, 198, 10, .7) !important; font-size: 1.06em; }
.fuka-rd-order .fro-note { margin: 8px 0 0; font-size: .82em; color: #6b7280; }
.fuka-rd-order .fro-warn { margin: 8px 0 0; font-size: .85em; color: #991b1b; }
.fuka-rd-order .fro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.fuka-rd-order .fro-btn {
	display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 14px; cursor: pointer;
	border: 1px solid rgba(28, 36, 48, .1); background: rgba(255, 255, 255, .85); color: #1c2430; font: inherit; text-decoration: none;
}
.fuka-rd-order .fro-btn.primary {
	background: linear-gradient(180deg, #ffdf6b, #fdc60a); border-color: rgba(255, 255, 255, .6); font-weight: 800; color: #1c1c1c;
	box-shadow: 0 6px 20px rgba(253, 198, 10, .45), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.fuka-rd-btn small { margin-inline-start: 5px; font-weight: 500; }
.fuka-rd-dimline { margin-top: 8px; font-size: .88em; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .7); border: 1px solid rgba(28, 36, 48, .07); }
.fuka-rd-chip.off { opacity: .42; cursor: not-allowed; filter: grayscale(.6); }
.fuka-rd-toast {
	position: absolute; top: 14px; left: 50%; transform: translate(-50%, -12px); max-width: 86%; z-index: 3;
	padding: 9px 16px; border-radius: 14px; font-size: .86em; text-align: center; color: #1c2430; pointer-events: none;
	background: rgba(255, 248, 225, .9); border: 1px solid rgba(253, 198, 10, .7); box-shadow: 0 8px 24px rgba(120, 96, 20, .18);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s, transform .2s;
}
.fuka-rd-toast.on { opacity: 1; transform: translate(-50%, 0); }
