/* ============================================================
   Dynamic Window Calculator - Frontend Styles v2.1
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
	font-family: 'Vazirmatn';
	src: url('../../fonts/Vazirmatn-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Vazirmatn';
	src: url('../../fonts/Vazirmatn-Medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Vazirmatn';
	src: url('../../fonts/Vazirmatn-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------- Reset & Root ---------- */
.dwc-calculator {
	--dwc-navy: #0a192f;
	--dwc-orange: #ff6b00;
	--dwc-ink: #243247;
	--dwc-muted: #758196;
	--dwc-line: #e4e9f0;
	--dwc-soft: #f5f7fa;
	--dwc-radius: 16px;
	--dwc-shadow: 0 14px 36px rgba(10, 25, 47, .08);
	box-sizing: border-box;
	max-width: 1240px;
	margin: 32px auto;
	padding: 26px;
	color: var(--dwc-ink);
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	line-height: 1.7;
	background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
	border: 1px solid #eef1f5;
	border-radius: 28px;
	overflow: hidden;
	direction: rtl;
}
.dwc-calculator *,
.dwc-calculator *::before,
.dwc-calculator *::after {
	box-sizing: border-box;
	font-family: inherit;
}
.dwc-calculator button,
.dwc-calculator input,
.dwc-calculator select,
.dwc-calculator textarea { font: inherit; }

/* ---------- Header ---------- */
.dwc-wizard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 18px;
	margin-bottom: 28px;
}
.dwc-kicker {
	display: block;
	color: var(--dwc-orange);
	font-size: 11px;
	font-weight: 700;
}
.dwc-wizard-header h2 {
	margin: 4px 0 3px;
	color: var(--dwc-navy);
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.4;
}
.dwc-wizard-header p {
	margin: 0;
	color: var(--dwc-muted);
	font-size: 13px;
}
.dwc-header-badge {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 14px;
	border: 1px solid #ffe0c8;
	border-radius: 999px;
	background: #fff8f2;
	color: #9b4a15;
	font-size: 12px;
	white-space: nowrap;
}
.dwc-header-badge span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dwc-orange);
	box-shadow: 0 0 0 5px #ffeadb;
}

/* ---------- Progress (RTL) ---------- */
.dwc-progress { margin: 8px 0 35px; }
.dwc-progress-track {
	height: 7px;
	background: #edf0f4;
	border-radius: 20px;
	overflow: hidden;
	direction: rtl;
}
.dwc-progress-track i {
	display: block;
	width: 8%;
	height: 100%;
	border-radius: 20px;
	background: linear-gradient(270deg, var(--dwc-orange), #ffbd6d);
	transition: width .35s ease;
	margin-right: 0;
	margin-left: auto;
	float: right;
}
.dwc-progress-steps {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	color: #a1aaba;
	font-size: 10px;
	direction: rtl;
}
.dwc-progress-steps span {
	transition: color .25s;
	min-width: 18px;
	text-align: center;
}
.dwc-progress-steps span.is-active,
.dwc-progress-steps span.is-done {
	color: var(--dwc-orange);
	font-weight: 800;
}

/* ---------- Layout ---------- */
.dwc-wizard-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 315px;
	gap: 28px;
	align-items: start;
}
.dwc-wizard-main { min-width: 0; }

/* ---------- Steps ---------- */
.dwc-step { display: none; animation: dwc-in .3s ease; }
.dwc-step.is-active { display: block; }
@keyframes dwc-in {
	from { opacity: 0; transform: translateY(7px); }
	to   { opacity: 1; transform: none; }
}

.dwc-step-heading {
	display: flex;
	gap: 15px;
	align-items: flex-start;
	margin-bottom: 25px;
}
.dwc-step-heading > b {
	display: grid;
	place-items: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: var(--dwc-navy);
	color: #fff;
	font-size: 13px;
	direction: ltr;
}
.dwc-step-heading h3 {
	margin: 0;
	color: var(--dwc-navy);
	font-size: 24px;
	line-height: 1.35;
}
.dwc-step-heading p {
	margin: 3px 0 0;
	color: var(--dwc-muted);
	font-size: 13px;
}

/* ---------- Grid layouts (پایه) ---------- */
.dwc-choice-grid,
.dwc-card-grid,
.dwc-option-grid,
.dwc-dimensions-grid {
	display: grid;
	gap: 12px;
	align-items: stretch;
}
.dwc-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dwc-card-grid   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dwc-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dwc-dimensions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Cards base ---------- */
.dwc-choice-card,
.dwc-select-card,
.dwc-option-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 13px;
	min-height: 115px;
	padding: 14px;
	border: 1px solid var(--dwc-line);
	border-radius: var(--dwc-radius);
	background: #fff;
	cursor: pointer;
	transition: .2s ease;
	box-shadow: 0 4px 14px rgba(10, 25, 47, .025);
	height: 100%;
}
.dwc-choice-card:hover,
.dwc-select-card:hover,
.dwc-option-card:hover {
	border-color: #ffc49d;
	transform: translateY(-2px);
	box-shadow: var(--dwc-shadow);
}
.dwc-choice-card:has(input:checked),
.dwc-select-card:has(input:checked),
.dwc-option-card:has(input:checked) {
	border-color: var(--dwc-orange);
	background: #fff9f4;
	box-shadow: 0 0 0 3px #ffeadb;
}
.dwc-choice-card input,
.dwc-select-card input,
.dwc-option-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.dwc-choice-icon {
	display: grid;
	place-items: center;
	flex: 0 0 53px;
	width: 53px;
	height: 53px;
	border-radius: 16px;
	background: #fff0e5;
	color: var(--dwc-orange);
	font-size: 16px;
	font-weight: 800;
}
.dwc-percent-icon {
	display: grid;
	place-items: center;
	flex: 0 0 53px;
	width: 53px;
	height: 53px;
	border-radius: 16px;
	background: #eef4ff;
	color: #3765ba;
	font-weight: 800;
	font-size: 18px;
}
.dwc-choice-card strong,
.dwc-select-card strong,
.dwc-option-card strong {
	display: block;
	color: var(--dwc-navy);
	font-size: 14px;
	font-weight: 700;
}
.dwc-choice-card small,
.dwc-select-card small,
.dwc-option-card small {
	display: block;
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-choice-card > i,
.dwc-select-card > i,
.dwc-option-card > i {
	position: absolute;
	top: 11px;
	left: 11px;
	display: grid;
	place-items: center;
	width: 21px;
	height: 21px;
	border: 1px solid var(--dwc-line);
	border-radius: 50%;
	color: transparent;
	font-style: normal;
	font-size: 12px;
	background: #fff;
	z-index: 2;
}
.dwc-choice-card:has(input:checked) > i,
.dwc-select-card:has(input:checked) > i,
.dwc-option-card:has(input:checked) > i {
	border-color: var(--dwc-orange);
	background: var(--dwc-orange);
	color: #fff;
}

/* ============================================================
   کارت‌های افقی با تصویر
   ============================================================ */
.dwc-choice-with-img {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 14px;
	min-height: 120px;
	padding: 12px;
	height: 100%;
}
.dwc-choice-with-img .dwc-choice-visual {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 120px;
	width: 120px;
	height: 90px;
	border-radius: 12px;
	background: #f5f7fa;
	overflow: hidden;
	padding: 6px;
}
.dwc-choice-with-img .dwc-choice-visual img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: center;
}
.dwc-choice-with-img .dwc-choice-copy {
	flex: 1;
	min-width: 0;
	text-align: right;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.dwc-choice-with-img .dwc-choice-copy strong {
	display: block;
	color: var(--dwc-navy);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
}
.dwc-choice-with-img .dwc-choice-copy small {
	display: block;
	color: var(--dwc-muted);
	font-size: 11px;
	margin-top: 2px;
}

/* ============================================================
   کارت‌های بزرگ با تصویر
   ============================================================ */
.dwc-unified-card {
	display: flex;
	flex-direction: column;
	padding: 10px;
	height: 100%;
}
.dwc-unified-card .dwc-card-visual {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 110px;
	margin-bottom: 10px;
	padding: 8px;
	border-radius: 12px;
	background: #f5f7fa;
	overflow: hidden;
	flex-shrink: 0;
}
.dwc-unified-card .dwc-card-visual img,
.dwc-unified-card .dwc-card-image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	object-position: center;
}
.dwc-unified-card .dwc-card-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	font-size: 12px;
	font-weight: 700;
	color: #b7c0cd;
}
.dwc-unified-card .dwc-card-copy {
	display: block;
	text-align: center;
	padding: 0 4px;
	flex-grow: 1;
}
.dwc-unified-card .dwc-card-copy strong {
	display: block;
	color: var(--dwc-navy);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
}
.dwc-unified-card .dwc-card-copy small {
	display: block;
	color: var(--dwc-muted);
	font-size: 10px;
	margin-top: 2px;
}

/* رنگ‌ها و برندها: ارتفاع کمی بیشتر */
[data-colors] .dwc-card-visual,
[data-brands] .dwc-card-visual {
	height: 120px;
}

/* مدل‌ها (SVG preview) */
.dwc-model-preview,
.dwc-model-preview svg {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 100%;
}
.dwc-model-preview svg { stroke: currentColor; stroke-width: 2; }

/* ---------- Dimensions ---------- */
.dwc-dimension-card {
	padding: 17px;
	border: 1px solid var(--dwc-line);
	border-radius: var(--dwc-radius);
	background: #fff;
}
.dwc-field-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}
.dwc-field-label label {
	font-weight: 700;
	color: var(--dwc-navy);
}
.dwc-field-label span {
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-number-input {
	width: 100%;
	border: 0;
	border-bottom: 2px solid #e9edf2;
	outline: 0;
	color: var(--dwc-navy);
	font-size: 28px;
	font-weight: 800;
	background: transparent;
	padding: 6px 0;
}
.dwc-number-input:focus { border-color: var(--dwc-orange); }
.dwc-range {
	width: 100%;
	margin-top: 18px;
	accent-color: var(--dwc-orange);
}
.dwc-dimension-preview {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-top: 18px;
	padding: 17px;
	border-radius: var(--dwc-radius);
	background: var(--dwc-navy);
	color: #fff;
}
.dwc-mini-window {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: 1fr auto;
	gap: 4px;
	width: 90px;
	height: 72px;
	padding: 8px;
	border: 2px solid #ffb16e;
	border-radius: 8px;
	color: #ffb16e;
	font-size: 9px;
	direction: ltr;
}
.dwc-mini-window i {
	grid-row: 1/3;
	display: block;
	width: 2px;
	background: #ffb16e;
}
.dwc-mini-window span:last-child {
	grid-column: 1/3;
	text-align: center;
}
.dwc-dimension-preview strong,
.dwc-dimension-preview b,
.dwc-dimension-preview small { display: block; }
.dwc-dimension-preview b {
	margin: 3px 0;
	color: #ffbd7c;
	font-size: 18px;
}
.dwc-dimension-preview small {
	color: #aab7c8;
	font-size: 10px;
}

/* ---------- Options / Order fields ---------- */
.dwc-order-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}
.dwc-order-fields label {
	display: grid;
	gap: 4px;
	padding: 15px;
	border: 1px solid var(--dwc-line);
	border-radius: 16px;
	background: #fff;
	color: var(--dwc-navy);
	font-size: 11px;
	font-weight: 700;
}
.dwc-order-fields input {
	padding: 9px 10px;
	border: 1px solid var(--dwc-line);
	border-radius: 10px;
	background: #fff;
	outline: 0;
	font-size: 13px;
}
.dwc-order-fields input:focus { border-color: var(--dwc-orange); }
.dwc-order-fields em { color: var(--dwc-orange); font-style: normal; }
.dwc-order-fields small,
.dwc-order-fields i {
	color: var(--dwc-muted);
	font-size: 10px;
	font-style: normal;
	font-weight: 400;
}
.dwc-order-fields i { color: #bd3c32; }

.dwc-contact-method {
	margin-top: 16px;
	padding: 16px;
	border: 1px solid var(--dwc-line);
	border-radius: 16px;
	background: #fff;
}
.dwc-contact-method > strong {
	font-size: 13px;
	color: var(--dwc-navy);
}
.dwc-contact-method > div {
	display: flex;
	gap: 9px;
	margin-top: 10px;
	flex-wrap: wrap;
}
.dwc-contact-method label { cursor: pointer; }
.dwc-contact-method input { display: none; }
.dwc-contact-method span {
	display: block;
	padding: 8px 17px;
	border: 1px solid var(--dwc-line);
	border-radius: 999px;
	color: var(--dwc-muted);
	font-size: 12px;
}
.dwc-contact-method input:checked + span {
	border-color: var(--dwc-orange);
	background: #fff3e9;
	color: #a84d13;
}

/* ---------- Galvanized filters ---------- */
.dwc-galv-filters {
	display: flex;
	gap: 12px;
	margin-bottom: 18px;
	padding: 14px;
	border: 1px solid var(--dwc-line);
	border-radius: 14px;
	background: #fff;
}
.dwc-galv-filters label {
	display: grid;
	gap: 5px;
	flex: 1;
	color: var(--dwc-navy);
	font-size: 12px;
	font-weight: 700;
}
.dwc-galv-filters select {
	padding: 9px 11px;
	border: 1px solid var(--dwc-line);
	border-radius: 10px;
	background: #fff;
	font: inherit;
	font-size: 13px;
	outline: 0;
}
.dwc-galv-filters select:focus { border-color: var(--dwc-orange); }

/* ---------- Buttons ---------- */
.dwc-step-actions {
	display: flex;
	justify-content: flex-start;
	gap: 10px;
	margin-top: 28px;
	flex-wrap: wrap;
}
.dwc-btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	min-height: 45px;
	padding: 10px 20px;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	transition: .2s;
}
.dwc-btn-primary {
	background: var(--dwc-orange);
	color: #fff;
	box-shadow: 0 8px 18px rgba(255, 107, 0, .22);
}
.dwc-btn-primary:hover {
	background: #e95f00;
	transform: translateY(-1px);
}
.dwc-btn-ghost {
	border: 1px solid var(--dwc-line);
	background: #fff;
	color: var(--dwc-navy);
}
.dwc-btn-ghost:hover {
	border-color: #ffc49d;
	color: var(--dwc-orange);
}
.dwc-submit.is-loading {
	opacity: .65;
	pointer-events: none;
}

/* ---------- Field errors & states ---------- */
.dwc-field-error {
	min-height: 20px;
	margin-top: 7px;
	color: #bd3c32;
	font-size: 11px;
}
.dwc-async-state {
	padding: 18px;
	text-align: center;
	color: var(--dwc-muted);
	font-size: 12px;
}

/* ---------- Summary (sidebar) ---------- */
.dwc-summary {
	position: sticky;
	top: 22px;
	padding: 20px;
	border: 1px solid #e8edf3;
	border-radius: 22px;
	background: #fff;
	box-shadow: var(--dwc-shadow);
}
.dwc-summary-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.dwc-summary h3 {
	margin: 2px 0 0;
	color: var(--dwc-navy);
	font-size: 19px;
}
.dwc-live-dot {
	padding: 3px 7px;
	border-radius: 5px;
	background: #e9fff3;
	color: #16884e;
	font-size: 9px;
	font-weight: 800;
}
.dwc-summary-dimensions {
	margin: 15px 0;
	padding: 10px 12px;
	border-radius: 11px;
	background: var(--dwc-soft);
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-summary-lines { display: grid; gap: 7px; }
.dwc-summary-line {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-summary-line strong {
	color: var(--dwc-ink);
	font-size: 11px;
	white-space: nowrap;
}
.dwc-empty-summary {
	padding: 20px 4px;
	text-align: center;
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-summary-mobile { display: none; }

/* ---------- Final price (step 14) ---------- */
.dwc-final-price-box {
	display: grid;
	place-items: center;
	margin: 30px auto;
	padding: 40px 24px;
	max-width: 520px;
	border: 1px solid #ffe0c8;
	border-radius: 22px;
	background: linear-gradient(145deg, #fff8f2, #fff);
	text-align: center;
	box-shadow: 0 14px 36px rgba(255, 107, 0, .08);
}
.dwc-final-price-box .dwc-kicker {
	color: var(--dwc-orange);
	font-size: 12px;
	margin-bottom: 8px;
}
.dwc-final-price-box strong {
	display: block;
	margin: 6px 0;
	color: var(--dwc-navy);
	font-size: 34px;
	font-weight: 800;
	letter-spacing: -.5px;
}
.dwc-final-price-box small {
	color: var(--dwc-muted);
	font-size: 13px;
}
.dwc-calculation-debug {
	margin: 20px 0;
	padding: 16px;
	border: 1px dashed #c9d2dc;
	border-radius: 12px;
	background: #f8fafc;
	color: var(--dwc-navy);
	font-size: 12px;
}
.dwc-calculation-debug summary { cursor: pointer; font-weight: 700; }
.dwc-calculation-debug [data-calculation-debug-content] { margin-top: 14px; overflow-x: auto; }
.dwc-calculation-debug table { width: 100%; border-collapse: collapse; text-align: right; }
.dwc-calculation-debug th,
.dwc-calculation-debug td { padding: 8px; border: 1px solid #dfe5eb; vertical-align: top; }
.dwc-calculation-debug thead { background: #eef2f6; }
.dwc-calculation-debug tbody th { min-width: 120px; }

/* ---------- Thank you ---------- */
.dwc-thank-you {
	display: block;
	max-width: 560px;
	margin: 20px auto;
	padding: 42px 28px;
	text-align: center;
	border: 1px solid #dff0e6;
	border-radius: 24px;
	background: #fff;
	box-shadow: var(--dwc-shadow);
	animation: dwc-in .3s ease;
}
.dwc-thank-you[hidden] { display: none; }
.dwc-thank-you h3 {
	margin: 8px 0;
	color: var(--dwc-navy);
	font-size: 24px;
}
.dwc-thank-you p {
	margin: 6px 0;
	color: var(--dwc-muted);
	font-size: 13px;
}
.dwc-order-reference { margin-top: 18px !important; }
.dwc-thank-you-price {
	margin: 20px 0;
	padding: 14px;
	border-radius: 14px;
	background: #f0fff5;
}
.dwc-thank-you-price span {
	display: block;
	color: var(--dwc-muted);
	font-size: 11px;
}
.dwc-thank-you-price strong {
	color: #169454;
	font-size: 24px;
}
.dwc-thank-you .dwc-btn { min-width: 190px; }
.dwc-success-icon {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: #e8fff1;
	color: #169454;
	font-size: 30px;
}
.dwc-contact-links {
	display: flex;
	justify-content: center;
	gap: 7px;
	flex-wrap: wrap;
	margin-bottom: 17px;
}
.dwc-contact-links a {
	padding: 7px 12px;
	border-radius: 999px;
	background: #eef5ff;
	color: #285ea9;
	text-decoration: none;
	font-size: 11px;
}
.dwc-contact-links a:hover { background: #dceaff; }

/* ---------- Complete state ---------- */
.dwc-calculator.is-complete .dwc-progress,
.dwc-calculator.is-complete .dwc-summary { display: none; }
.dwc-calculator.is-complete .dwc-wizard-layout { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.dwc-calculator {
		margin: 18px 10px;
		padding: 19px;
		border-radius: 22px;
	}
	.dwc-wizard-layout { grid-template-columns: 1fr; }
	.dwc-summary { display: none; }
	.dwc-summary-mobile { display: block; }
	.dwc-summary-mobile .dwc-summary {
		display: block;
		position: static;
		box-shadow: none;
		padding: 0;
		border: 0;
	}
	.dwc-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dwc-unified-card .dwc-card-visual { height: 100px; }
	[data-colors] .dwc-card-visual,
	[data-brands] .dwc-card-visual { height: 110px; }
}
@media (max-width: 560px) {
	.dwc-wizard-header { display: block; }
	.dwc-header-badge { display: inline-flex; margin-top: 14px; }
	.dwc-progress-steps span:nth-child(even) { display: none; }
	.dwc-choice-grid,
	.dwc-card-grid,
	.dwc-dimensions-grid,
	.dwc-order-fields,
	.dwc-option-grid { grid-template-columns: 1fr; }
	.dwc-choice-card { min-height: 100px; }
	.dwc-step-heading h3 { font-size: 20px; }
	.dwc-galv-filters { flex-direction: column; }
	.dwc-step-actions { flex-wrap: wrap; }
	.dwc-step-actions .dwc-btn { flex: 1; }
	.dwc-dimension-preview { align-items: flex-start; flex-direction: column; }
	.dwc-final-price-box strong { font-size: 26px; }
	.dwc-unified-card .dwc-card-visual { height: 130px; }
	.dwc-choice-with-img { min-height: 110px; }
	.dwc-choice-with-img .dwc-choice-visual { flex: 0 0 100px; width: 100px; height: 80px; }
}
