/*!
 * Zardis Toolkit — order tracking page.
 * Scope: .zardis-track
 */

.zardis-track {
	--zt-radius: 18px;
	max-inline-size: 720px;
	margin-inline: auto;
	font-family: var(--ztk-font);
	color: var(--ztk-ink);
}

.zardis-track *,
.zardis-track *::before,
.zardis-track *::after {
	box-sizing: border-box;
}

/* ---------- hero ---------------------------------------------------- */

.zardis-track__hero {
	margin-block-end: 22px;
	text-align: center;
}

.zardis-track__title {
	margin: 0 0 8px;
	font-size: clamp(21px, 2.6vw, 28px);
	font-weight: 800;
	line-height: 1.5;
	color: var(--ztk-navy);
}

.zardis-track__sub {
	margin: 0 auto;
	max-inline-size: 52ch;
	color: var(--ztk-ink-soft);
	font-size: 14px;
	line-height: 1.95;
}

/* ---------- form ---------------------------------------------------- */

.zardis-track__form {
	padding: clamp(18px, 2.4vw, 26px);
	border: 1px solid var(--ztk-line);
	border-radius: var(--zt-radius);
	background:
		radial-gradient(120% 120% at 100% 0%, rgba(201, 162, 71, .09) 0%, rgba(201, 162, 71, 0) 55%),
		#fff;
	box-shadow: var(--ztk-shadow);
}

.zardis-track__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-block-end: 16px;
}

.zardis-track__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.zardis-track__label {
	font-size: 13px;
	font-weight: 700;
	color: var(--ztk-ink-soft);
}

.zardis-track__input {
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border: 1px solid var(--ztk-line);
	border-radius: 12px;
	background: #fff;
	color: var(--ztk-ink);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.zardis-track__input::placeholder {
	font-weight: 500;
	color: #a7adb6;
}

.zardis-track__input:focus {
	outline: none;
	border-color: var(--ztk-gold);
	box-shadow: 0 0 0 4px rgba(201, 162, 71, .16);
}

.zardis-track__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-track__submit:hover {
	filter: brightness(1.04);
}

.zardis-track__submit:active {
	transform: translateY(1px);
}

.zardis-track__submit[disabled] {
	opacity: .65;
	cursor: progress;
}

.zardis-track.is-loading .zardis-track__submit {
	position: relative;
	color: transparent;
}

.zardis-track.is-loading .zardis-track__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;
}

/* ---------- result card --------------------------------------------- */

.zardis-track__result {
	margin-block-start: 22px;
	animation: zt-rise .28s ease both;
}

.zardis-track__result[hidden] {
	display: none;
}

@keyframes zt-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.zt-card-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding: 16px 18px;
	border: 1px solid var(--ztk-line);
	border-radius: var(--zt-radius) var(--zt-radius) 0 0;
	background: var(--ztk-navy);
	color: #fff;
}

.zt-card-head__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.zt-card-head__label {
	font-size: 11.5px;
	opacity: .7;
}

.zt-card-head__number {
	font-size: 19px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.zt-card-head__pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(201, 162, 71, .18);
	color: #e8cd8c;
	font-size: 12.5px;
	font-weight: 800;
}

.zt-card-head__pill::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 3px rgba(232, 205, 140, .22);
}

.zt-card-body {
	padding: 20px 18px;
	border: 1px solid var(--ztk-line);
	border-block-start: 0;
	border-radius: 0 0 var(--zt-radius) var(--zt-radius);
	background: #fff;
}

/* ---------- timeline ------------------------------------------------- */

.zt-timeline {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.zt-step {
	position: relative;
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr);
	gap: 12px;
	padding-block-end: 22px;
}

.zt-step:last-child {
	padding-block-end: 0;
}

/* Connector line between the markers. */
.zt-step::before {
	content: "";
	position: absolute;
	inset-block: 30px 0;
	inset-inline-start: 16px;
	width: 2px;
	background: var(--ztk-line);
}

.zt-step:last-child::before {
	display: none;
}

.zt-step.is-done::before {
	background: var(--ztk-success);
}

.zt-step__marker {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	inline-size: 34px;
	block-size: 34px;
	border: 2px solid var(--ztk-line);
	border-radius: 50%;
	background: #fff;
	color: #b9bfc9;
	font-size: 13px;
	font-weight: 800;
}

.zt-step.is-done .zt-step__marker {
	border-color: var(--ztk-success);
	background: var(--ztk-success);
	color: #fff;
}

.zt-step.is-current .zt-step__marker {
	border-color: var(--ztk-gold);
	color: var(--ztk-gold-deep);
	box-shadow: 0 0 0 5px rgba(201, 162, 71, .16);
}

.zt-step.is-current .zt-step__marker::after {
	content: "";
	position: absolute;
	inset: -2px;
	border-radius: 50%;
	border: 2px solid var(--ztk-gold);
	animation: zt-pulse 1.8s ease-out infinite;
}

@keyframes zt-pulse {
	0%   { opacity: .7; transform: scale(1); }
	70%  { opacity: 0; transform: scale(1.45); }
	100% { opacity: 0; transform: scale(1.45); }
}

.zt-step__body {
	padding-block-start: 3px;
	min-width: 0;
}

.zt-step__title {
	margin: 0 0 2px;
	font-size: 14.5px;
	font-weight: 800;
	line-height: 1.6;
	color: var(--ztk-ink);
}

.zt-step.is-pending .zt-step__title {
	color: #9aa1ac;
}

.zt-step__desc {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.85;
	color: var(--ztk-ink-soft);
}

.zt-step.is-pending .zt-step__desc {
	color: #b6bcc5;
}

/* ---------- items + total ------------------------------------------- */

.zt-items {
	margin: 20px 0 0;
	padding: 14px 0 0;
	border-block-start: 1px dashed var(--ztk-line);
	list-style: none;
}

.zt-items li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding-block: 6px;
	font-size: 13.5px;
}

.zt-items__name {
	font-weight: 600;
	color: var(--ztk-ink);
}

.zt-items__qty {
	color: var(--ztk-ink-soft);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}

.zt-total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-block-start: 10px;
	padding-block-start: 10px;
	border-block-start: 1px solid var(--ztk-line);
	font-size: 14px;
}

.zt-total__label {
	color: var(--ztk-ink-soft);
}

.zt-total__value {
	font-weight: 800;
	color: var(--ztk-navy);
	font-variant-numeric: tabular-nums;
}

.zt-track-code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-block-start: 14px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--ztk-gold-soft);
	font-size: 13px;
}

.zt-track-code__label {
	color: var(--ztk-gold-deep);
	font-weight: 700;
}

.zt-track-code__value {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-weight: 800;
	color: var(--ztk-navy);
	letter-spacing: .04em;
}

/* ---------- messages ------------------------------------------------- */

.zt-msg {
	margin: 22px 0 0;
	padding: 14px 16px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.9;
}

.zt-msg--error {
	background: rgba(203, 64, 64, .08);
	border: 1px solid rgba(203, 64, 64, .22);
	color: #8d2c2c;
}

.zt-msg--info {
	background: var(--ztk-surface-alt);
	border: 1px solid var(--ztk-line);
	color: var(--ztk-ink-soft);
}

.zardis-track__note {
	margin: 18px 0 0;
	font-size: 12px;
	line-height: 1.9;
	color: var(--ztk-ink-soft);
	text-align: center;
}

/* ---------- header menu button -------------------------------------- */

.zardis-track-btn > a {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding-inline: 16px !important;
	border-radius: 999px;
	background: var(--ztk-gold, #c9a247);
	color: #14181c !important;
	font-weight: 800 !important;
}

.zardis-track-btn > a:hover,
.zardis-track-btn > a:focus {
	background: #b7913a;
	color: #14181c !important;
}

.zardis-track-btn > a::before {
	content: "";
	inline-size: 15px;
	block-size: 15px;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

/* ---------- responsive ----------------------------------------------- */

@media (max-width: 640px) {
	.zardis-track__fields {
		grid-template-columns: 1fr;
	}

	.zardis-track__input {
		font-size: 16px; /* prevents iOS zoom */
	}

	.zt-card-head {
		padding: 14px 14px;
	}

	.zt-card-body {
		padding: 16px 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zardis-track__result,
	.zt-step.is-current .zt-step__marker::after {
		animation: none;
	}
}
