/**
 * Melted gold purchase page — cream / ink luxury UI.
 * Scoped to .tala-melted-page. No Tailwind CDN.
 */

.tala-melted-page {
	--ink: #1c1714;
	--gold: #a9803d;
	--cream: #faf8f3;
	--line: #e7e1d3;
	--muted: #8b8378;
	--sand: #f3ead7;
	background:
		radial-gradient(ellipse 80% 50% at 100% 0%, rgba(169, 128, 61, 0.12), transparent 55%),
		radial-gradient(ellipse 60% 40% at 0% 100%, rgba(28, 23, 20, 0.04), transparent 50%),
		var(--cream);
	color: var(--ink);
	font-family: var(--tala-font-body, "Vazirmatn", Tahoma, sans-serif);
	line-height: 1.7;
	min-height: 60vh;
}

.tala-melted-page *,
.tala-melted-page *::before,
.tala-melted-page *::after {
	box-sizing: border-box;
}

.tala-melted-page__inner {
	max-width: 640px;
	margin: 0 auto;
	padding: 40px 16px 72px;
	width: 100%;
}

@media (min-width: 768px) {
	.tala-melted-page__inner {
		padding: 64px 24px 96px;
	}
}

.tala-melted__intro {
	text-align: center;
	margin-bottom: 32px;
	animation: talaMeltedFadeUp 0.7s ease both;
}

.tala-melted__brand {
	font-family: var(--tala-font-heading, "Markazi Text", Georgia, serif);
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--gold);
	margin: 0 0 8px;
	line-height: 1.1;
}

.tala-melted__title {
	font-family: var(--tala-font-heading, "Markazi Text", Georgia, serif);
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 12px;
	line-height: 1.25;
}

.tala-melted__trust {
	margin: 0 auto;
	max-width: 36em;
	color: var(--muted);
	font-size: 0.95rem;
}

.tala-melted__notice {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 20px 18px;
	color: var(--muted);
	text-align: center;
}

.tala-melted__panel {
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 24px 18px 28px;
	box-shadow: 0 18px 40px rgba(28, 23, 20, 0.05);
	animation: talaMeltedFadeUp 0.7s ease 0.12s both;
}

@media (min-width: 640px) {
	.tala-melted__panel {
		padding: 32px 28px 36px;
	}
}

.tala-melted__rate {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	text-align: center;
	padding: 16px 14px;
	margin-bottom: 28px;
	background: linear-gradient(135deg, var(--sand), #fff);
	border: 1px solid var(--line);
	border-radius: 4px;
}

.tala-melted__rate-label {
	font-size: 0.8rem;
	color: var(--muted);
	letter-spacing: 0.02em;
}

.tala-melted__rate-value {
	font-family: var(--tala-font-heading, "Markazi Text", Georgia, serif);
	font-size: clamp(1.35rem, 3.5vw, 1.75rem);
	font-weight: 600;
	color: var(--ink);
}

.tala-melted__rate.is-error .tala-melted__rate-value {
	color: #8c2d19;
	font-size: 1rem;
	font-family: var(--tala-font-body, "Vazirmatn", sans-serif);
	font-weight: 500;
}

.tala-melted__weight {
	margin-bottom: 28px;
}

.tala-melted__weight-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 14px;
}

.tala-melted__weight-label {
	font-weight: 600;
	color: var(--ink);
	font-size: 0.95rem;
}

.tala-melted__weight-hint {
	font-size: 0.78rem;
	color: var(--muted);
}

.tala-melted__weight-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 18px;
}

.tala-melted__stepper {
	width: 44px;
	height: 44px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tala-melted__stepper:hover {
	border-color: var(--gold);
	color: var(--gold);
}

.tala-melted__stepper:active {
	background: var(--sand);
}

.tala-melted__weight-input {
	width: 7.5rem;
	height: 48px;
	text-align: center;
	font-size: 1.25rem;
	font-weight: 600;
	font-family: var(--tala-font-heading, "Markazi Text", Georgia, serif);
	border: 1.5px solid var(--line);
	border-radius: 4px;
	background: #fff;
	color: var(--ink);
	-moz-appearance: textfield;
}

.tala-melted__weight-input::-webkit-outer-spin-button,
.tala-melted__weight-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tala-melted__weight-input:focus {
	outline: none;
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(169, 128, 61, 0.18);
}

.tala-melted__weight-input.is-invalid {
	border-color: #8c2d19;
}

.tala-melted__unit {
	color: var(--muted);
	font-size: 0.9rem;
	min-width: 2em;
}

.tala-melted__slider {
	display: block;
	width: 100%;
	height: 6px;
	appearance: none;
	-webkit-appearance: none;
	background: var(--line);
	border-radius: 999px;
	outline: none;
	cursor: pointer;
}

.tala-melted__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--gold);
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(28, 23, 20, 0.2);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.tala-melted__slider::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--gold);
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(28, 23, 20, 0.2);
	cursor: pointer;
}

.tala-melted__slider:active::-webkit-slider-thumb {
	transform: scale(1.08);
}

.tala-melted__breakdown {
	border-top: 1px solid var(--line);
	padding-top: 18px;
	margin-bottom: 24px;
}

.tala-melted__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding: 8px 0;
	font-size: 0.92rem;
	color: var(--muted);
}

.tala-melted__row strong {
	font-weight: 600;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.tala-melted__row--total {
	margin-top: 8px;
	padding-top: 14px;
	border-top: 1px dashed var(--line);
	font-size: 1.05rem;
	color: var(--ink);
}

.tala-melted__row--total strong {
	font-family: var(--tala-font-heading, "Markazi Text", Georgia, serif);
	font-size: 1.45rem;
	color: var(--gold);
}

.tala-melted__error {
	margin: 10px 0 0;
	color: #8c2d19;
	font-size: 0.85rem;
}

.tala-melted__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

@media (min-width: 480px) {
	.tala-melted__actions {
		flex-direction: row;
		align-items: center;
	}
}

.tala-melted__buy {
	flex: 1;
	appearance: none;
	border: none;
	background: var(--ink);
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	padding: 14px 22px;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.tala-melted__buy:hover:not(:disabled) {
	background: var(--gold);
}

.tala-melted__buy:active:not(:disabled) {
	transform: translateY(1px);
}

.tala-melted__buy:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.tala-melted__buy.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.tala-melted__cart-link {
	text-align: center;
	color: var(--muted);
	font-size: 0.9rem;
	text-decoration: none;
	padding: 10px 12px;
	transition: color 0.2s ease;
}

.tala-melted__cart-link:hover {
	color: var(--gold);
}

.tala-melted__status {
	margin: 14px 0 0;
	text-align: center;
	font-size: 0.9rem;
	color: var(--ink);
}

.tala-melted__status.is-ok {
	color: #2f6b3a;
}

.tala-melted__status.is-err {
	color: #8c2d19;
}

@keyframes talaMeltedFadeUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tala-melted__intro,
	.tala-melted__panel {
		animation: none;
	}
}
