/*!
 * Zardis Toolkit — gold / dollar calculator.
 * Scoped to .zardis-calc.
 */

.zardis-calc {
	--zc-radius: 18px;
	position: relative;
	padding: clamp(20px, 3vw, 36px);
	border: 1px solid var(--ztk-line);
	border-radius: var(--zc-radius);
	background:
		radial-gradient(120% 120% at 100% 0%, rgba(201, 162, 71, .10) 0%, rgba(201, 162, 71, 0) 55%),
		var(--ztk-surface);
	box-shadow: var(--ztk-shadow);
	font-family: var(--ztk-font);
	color: var(--ztk-ink);
}

.zardis-calc *,
.zardis-calc *::before,
.zardis-calc *::after {
	box-sizing: border-box;
}

.zardis-calc__head {
	margin-bottom: 18px;
}

.zardis-calc__title {
	margin: 0 0 6px;
	font-size: clamp(19px, 2.2vw, 24px);
	font-weight: 800;
	line-height: 1.4;
}

.zardis-calc__subtitle {
	margin: 0;
	color: var(--ztk-ink-soft);
	font-size: 14px;
	line-height: 1.9;
}

.zardis-calc__rates {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	margin-bottom: 18px;
	border-radius: 12px;
	background: var(--ztk-surface-alt);
}

.zardis-calc__rate {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	font-size: 13px;
}

.zardis-calc__rate + .zardis-calc__rate::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 16px;
	margin-inline-end: 4px;
	background: var(--ztk-line);
}

.zardis-calc__rate-label {
	color: var(--ztk-ink-soft);
}

.zardis-calc__rate-value {
	font-weight: 800;
	color: var(--ztk-gold-deep);
	font-variant-numeric: tabular-nums;
}

.zardis-calc__time {
	margin-inline-start: auto;
	color: var(--ztk-ink-soft);
	font-size: 12px;
}

.zardis-calc__fields {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 14px;
}

.zardis-calc__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.zardis-calc__label {
	font-size: 13px;
	font-weight: 700;
	color: var(--ztk-ink-soft);
}

.zardis-calc__input {
	width: 100%;
	min-height: 50px;
	padding: 0 16px;
	border: 1px solid var(--ztk-line);
	border-radius: 12px;
	background: #fff;
	color: var(--ztk-ink);
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.zardis-calc__input::placeholder {
	font-weight: 500;
	color: #a7adb6;
}

.zardis-calc__input:focus {
	outline: none;
	border-color: var(--ztk-gold);
	box-shadow: 0 0 0 4px rgba(201, 162, 71, .16);
}

.zardis-calc__select {
	appearance: none;
	-webkit-appearance: none;
	padding-inline-end: 38px;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6169' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 16px center;
	background-size: 14px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

html[dir="ltr"] .zardis-calc__select {
	background-position: right 16px center;
}

.zardis-calc__quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 14px 0 16px;
}

.zardis-calc__preset {
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid var(--ztk-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ztk-ink-soft);
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all .15s ease;
}

.zardis-calc__preset:hover,
.zardis-calc__preset:focus-visible {
	border-color: var(--ztk-gold);
	color: var(--ztk-gold-deep);
	background: var(--ztk-gold-soft);
}

.zardis-calc__submit {
	width: 100%;
	min-height: 52px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(180deg, #d4ad55 0%, #c9a247 100%);
	color: #14181c;
	font-family: inherit;
	font-size: 16px;
	font-weight: 800;
	cursor: pointer;
	transition: filter .15s ease, transform .15s ease;
}

.zardis-calc__submit:hover {
	filter: brightness(1.04);
}

.zardis-calc__submit:active {
	transform: translateY(1px);
}

.zardis-calc__submit[disabled] {
	opacity: .65;
	cursor: progress;
}

.zardis-calc__result {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px dashed var(--ztk-line);
	animation: zc-fade .25s ease both;
}

.zardis-calc__result[hidden] {
	display: none;
}

/*
 * The result is only revealed by JS after a calculation. Should the script
 * fail to run (blocked asset, old browser), the numbers must still be
 * readable rather than stuck at animation-start opacity.
 */
.zardis-calc:not(.is-ready) .zardis-calc__result {
	animation: none;
	opacity: 1;
	transform: none;
}

@keyframes zc-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

.zardis-calc__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.zardis-calc__cell {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px;
	border-radius: 12px;
	background: var(--ztk-surface-alt);
	text-align: center;
}

.zardis-calc__cell-label {
	font-size: 12px;
	color: var(--ztk-ink-soft);
}

.zardis-calc__cell-value {
	font-size: clamp(15px, 1.6vw, 18px);
	font-weight: 800;
	color: var(--ztk-navy);
	font-variant-numeric: tabular-nums;
}

.zardis-calc__suggestion {
	margin-top: 16px;
}

.zardis-calc__sug-text {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.9;
	color: var(--ztk-ink);
}

.zardis-calc__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.zardis-calc__card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--ztk-line);
	border-radius: 14px;
	background: #fff;
	transition: box-shadow .18s ease, transform .18s ease;
}

.zardis-calc__card:hover {
	box-shadow: var(--ztk-shadow-hover);
	transform: translateY(-2px);
}

.zardis-calc__card-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	border-radius: 10px;
	background: var(--ztk-surface-alt);
}

.zardis-calc__card-name {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.7;
	color: var(--ztk-ink);
}

/* Keep the «ضدجعل» badge on one line with the product name. */
.zardis-calc__card-name .ztk-badge {
	margin-inline-start: 4px;
	white-space: nowrap;
	vertical-align: middle;
	font-size: 11px;
	padding: 2px 8px;
}

.zardis-calc__card-name {
	overflow-wrap: anywhere;
}

.zardis-calc__card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
}

.zardis-calc__card-price {
	font-weight: 800;
	color: var(--ztk-gold-deep);
	font-variant-numeric: tabular-nums;
}

.zardis-calc__card-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	margin-top: auto;
	border-radius: 9px;
	background: var(--ztk-navy);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	text-decoration: none;
}

.zardis-calc__card-link:hover,
.zardis-calc__card-link:focus {
	background: #06224f;
	color: #fff;
	text-decoration: none;
}

.zardis-calc__empty {
	margin: 0;
	padding: 14px;
	border-radius: 12px;
	background: rgba(203, 64, 64, .07);
	color: #8d2c2c;
	font-size: 13px;
	line-height: 1.9;
}

.zardis-calc__country {
	opacity: .65;
}

.zardis-calc__note {
	margin: 16px 0 0;
	font-size: 12px;
	line-height: 1.9;
	color: var(--ztk-ink-soft);
}

.zardis-calc.is-loading .zardis-calc__submit {
	position: relative;
	color: transparent;
}

.zardis-calc.is-loading .zardis-calc__submit::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(0, 0, 0, .25);
	border-top-color: #14181c;
	border-radius: 50%;
	animation: ztk-spin .8s linear infinite;
}

@media (max-width: 640px) {
	.zardis-calc {
		padding: 18px 16px;
		border-radius: 14px;
	}

	.zardis-calc__fields {
		grid-template-columns: 1fr;
	}

	.zardis-calc__grid {
		grid-template-columns: 1fr;
	}

	.zardis-calc__time {
		width: 100%;
		margin-inline-start: 0;
	}

	.zardis-calc__input {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zardis-calc__result {
		animation: none;
	}

	.zardis-calc__card:hover {
		transform: none;
	}
}

/* Stale rate warning: the feed could not be read this tick. */
.zardis-calc__time.is-stale {
	color: #9a3b1f;
	font-weight: 700;
}

/* ---------- readability pass ---------------------------------------- */

/*
 * The calculator sits inside theme columns that can be narrow and use a
 * smaller body size. These rules raise the floor for every text element so
 * the numbers stay legible on the same page as the shop.
 */
.zardis-calc {
	font-size: 15px;
	line-height: 1.85;
}

.zardis-calc__title {
	font-size: clamp(21px, 2.4vw, 27px) !important;
	line-height: 1.45 !important;
	letter-spacing: -.01em;
}

.zardis-calc__subtitle {
	font-size: 15px !important;
	line-height: 2 !important;
	color: var(--ztk-ink-soft);
}

.zardis-calc__rate {
	font-size: 14px !important;
}

.zardis-calc__rate-value {
	font-size: 15.5px !important;
	font-weight: 800 !important;
	color: var(--ztk-navy);
}

.zardis-calc__time {
	font-size: 12.5px !important;
}

.zardis-calc__label {
	font-size: 14px !important;
	color: var(--ztk-ink);
}

.zardis-calc__input {
	font-size: 18px !important;
	font-weight: 800;
	color: var(--ztk-navy);
}

.zardis-calc__select {
	font-size: 15.5px !important;
}

.zardis-calc__preset {
	font-size: 14px !important;
}

.zardis-calc__submit {
	font-size: 16.5px !important;
}

.zardis-calc__cell-label {
	font-size: 13px !important;
	color: var(--ztk-ink-soft);
}

.zardis-calc__cell-value {
	font-size: clamp(17px, 1.8vw, 20px) !important;
	font-weight: 800 !important;
	color: var(--ztk-navy);
}

.zardis-calc__sug-text {
	font-size: 15px !important;
	line-height: 2 !important;
}

.zardis-calc__card-name {
	font-size: 14px !important;
	line-height: 1.8 !important;
	color: var(--ztk-ink);
}

.zardis-calc__card-price {
	font-size: 13.5px !important;
	font-weight: 800;
}

.zardis-calc__card-link {
	font-size: 13px !important;
}

.zardis-calc__note {
	font-size: 12.5px !important;
	line-height: 2 !important;
}

.zardis-calc__empty {
	font-size: 14px !important;
	line-height: 2 !important;
}

/* The rate strip is the first thing read; give it weight. */
.zardis-calc__rates {
	padding: 14px 16px;
	border: 1px solid var(--ztk-line);
	border-inline-start: 4px solid var(--ztk-gold);
}

.zardis-calc__rate-label {
	font-size: 13px;
}

/* Result numbers should be the loudest thing on the card. */
.zardis-calc__grid {
	gap: 12px;
}

.zardis-calc__cell {
	padding: 14px 12px;
	border: 1px solid var(--ztk-line);
	background: #fff;
}

@media (max-width: 640px) {
	.zardis-calc__input {
		font-size: 17px !important;
	}

	.zardis-calc__cell-value {
		font-size: 18px !important;
	}
}
