/**
 * Woo Order Tracking - front-end styles.
 */

.wot-wrapper {
	--wot-accent: #b81442;
	--wot-accent-soft: color-mix(in srgb, var(--wot-accent) 12%, #ffffff);
	--wot-text: #1c2333;
	--wot-muted: #6b7280;
	--wot-line: #e6e8ef;
	--wot-surface: #ffffff;
	--wot-radius: 16px;
	max-width: 860px;
	margin: 0 auto;
	color: var(--wot-text);
	font-size: 16px;
	line-height: 1.55;
}

.wot-wrapper *,
.wot-wrapper *::before,
.wot-wrapper *::after {
	box-sizing: border-box;
}

.wot-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

/* ---------- Form ---------- */

.wot-form {
	background: var(--wot-surface);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius);
	padding: 26px;
	box-shadow: 0 10px 30px rgba(20, 25, 45, 0.05);
}

.wot-form__title {
	margin: 0 0 6px;
	font-size: 1.4em;
	line-height: 1.25;
	font-weight: 700;
}

.wot-form__desc {
	margin: 0 0 18px;
	color: var(--wot-muted);
	font-size: 0.95em;
}

.wot-form__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
}

.wot-field {
	flex: 1 1 220px;
	display: block;
	min-width: 0;
}

.wot-field__label {
	display: block;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wot-muted);
	margin-bottom: 6px;
}

.wot-field__control {
	position: relative;
	display: flex;
	align-items: center;
}

.wot-field__control .wot-icon {
	position: absolute;
	left: 12px;
	color: var(--wot-muted);
	pointer-events: none;
}

.wot-field__control .wot-icon + .wot-input {
	padding-left: 40px;
}

.wot-input {
	width: 100%;
	height: 50px;
	padding: 0 14px;
	border: 1px solid var(--wot-line);
	border-radius: 12px;
	background: #fbfbfd;
	font-size: 1em;
	color: var(--wot-text);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wot-input:focus {
	outline: none;
	background: #fff;
	border-color: var(--wot-accent);
	box-shadow: 0 0 0 4px rgba(184, 20, 66, 0.15);
}

.wot-button {
	flex: 0 0 auto;
	height: 50px;
	min-width: 150px;
	padding: 0 24px;
	border: 0;
	border-radius: 12px;
	background: var(--wot-accent);
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.wot-button:hover:not(:disabled) {
	filter: brightness(1.06);
	transform: translateY(-1px);
}

.wot-button:disabled {
	opacity: 0.75;
	cursor: progress;
}

.wot-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wot-spin 0.7s linear infinite;
}

.wot-button.is-loading .wot-spinner {
	display: inline-block;
}

@keyframes wot-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Notice ---------- */

.wot-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding: 14px 16px;
	border-radius: 12px;
	font-size: 0.95em;
}

.wot-notice--error {
	background: #fff4f4;
	border: 1px solid #ffd5d5;
	color: #a12a2a;
}

/* ---------- Result card ---------- */

.wot-result {
	margin-top: 20px;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.wot-result.is-visible {
	opacity: 1;
	transform: none;
}

.wot-result:focus {
	outline: none;
}

.wot-card {
	background: var(--wot-surface);
	border: 1px solid var(--wot-line);
	border-radius: var(--wot-radius);
	box-shadow: 0 12px 34px rgba(20, 25, 45, 0.06);
	overflow: hidden;
}

.wot-card__head {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 24px 26px;
	background: linear-gradient(135deg, rgba(184, 20, 66, 0.09), rgba(184, 20, 66, 0.02));
	border-bottom: 1px solid var(--wot-line);
}

.wot-card__eyebrow {
	display: block;
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wot-muted);
	font-weight: 600;
}

.wot-card__number {
	margin: 2px 0 4px;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.2;
}

.wot-card__meta {
	margin: 0;
	color: var(--wot-muted);
	font-size: 0.9em;
}

.wot-badge {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border-radius: 999px;
	font-size: 0.82em;
	font-weight: 700;
	letter-spacing: 0.02em;
	background: #eef0f6;
	color: #454c5e;
	white-space: nowrap;
}

.wot-badge--processing { background: #e6f0ff; color: #1d4ed8; }
.wot-badge--completed  { background: #e5f8ee; color: #15803d; }
.wot-badge--pending    { background: #fff5e0; color: #a36200; }
.wot-badge--on-hold    { background: #fdf0e3; color: #9a4d00; }
.wot-badge--cancelled,
.wot-badge--failed     { background: #fdecec; color: #b3261e; }
.wot-badge--refunded   { background: #f1eaff; color: #6b31d6; }
.wot-badge--shipped,
.wot-badge--out-for-delivery { background: #e4f6fb; color: #0a6f8c; }

/* ---------- Timeline ---------- */

.wot-timeline {
	position: relative;
	padding: 34px 26px 26px;
}

.wot-timeline__track {
	position: absolute;
	top: 56px;
	left: calc(26px + (100% - 52px) / var(--wot-steps) / 2);
	width: calc((100% - 52px) - (100% - 52px) / var(--wot-steps));
	height: 4px;
	background: var(--wot-line);
	border-radius: 4px;
	overflow: hidden;
}

.wot-timeline__fill {
	display: block;
	height: 100%;
	width: var(--wot-progress, 0%);
	background: var(--wot-accent);
	border-radius: 4px;
	transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.wot-timeline--stopped .wot-timeline__fill {
	background: #d64545;
}

.wot-timeline__steps {
	display: grid;
	grid-template-columns: repeat(var(--wot-steps), minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wot-step {
	position: relative;
	text-align: center;
	padding: 0 4px;
	margin: 0;
	list-style: none;
}

.wot-step__dot {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--wot-line);
	color: #b9bfcf;
	margin-bottom: 10px;
	transition: all 0.3s ease;
}

.wot-step.is-done .wot-step__dot {
	background: var(--wot-accent);
	border-color: var(--wot-accent);
	color: #fff;
}

.wot-step.is-current .wot-step__dot {
	background: #fff;
	border-color: var(--wot-accent);
	color: var(--wot-accent);
	box-shadow: 0 0 0 6px rgba(184, 20, 66, 0.16);
	animation: wot-pulse 2s ease-in-out infinite;
}

.wot-step.is-stopped .wot-step__dot {
	background: #d64545;
	border-color: #d64545;
	color: #fff;
}

@keyframes wot-pulse {
	0%, 100% { box-shadow: 0 0 0 6px rgba(184, 20, 66, 0.16); }
	50%      { box-shadow: 0 0 0 11px rgba(184, 20, 66, 0.06); }
}

.wot-step__label {
	display: block;
	font-size: 0.9em;
	font-weight: 600;
	color: var(--wot-muted);
	line-height: 1.3;
}

.wot-step.is-done .wot-step__label,
.wot-step.is-current .wot-step__label,
.wot-step.is-stopped .wot-step__label {
	color: var(--wot-text);
}

.wot-step__date {
	display: block;
	margin-top: 4px;
	font-size: 0.76em;
	color: var(--wot-muted);
}

/* ---------- Panels ---------- */

.wot-panel {
	padding: 22px 26px;
	border-top: 1px solid var(--wot-line);
}

.wot-panel__title {
	margin: 0 0 14px;
	font-size: 0.82em;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--wot-muted);
}

.wot-panel--shipment {
	background: #fdf5f7;
}

.wot-shipment {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.wot-shipment li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--wot-text);
}

.wot-shipment code {
	background: #eef0f8;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 0.9em;
}

.wot-items {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.wot-items__row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 0;
	border-bottom: 1px dashed var(--wot-line);
	margin: 0;
}

.wot-items__row:last-child {
	border-bottom: 0;
}

.wot-items__thumb img,
.wot-items__img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
	border: 1px solid var(--wot-line);
}

.wot-items__info {
	flex: 1 1 auto;
	min-width: 0;
}

.wot-items__name {
	display: block;
	font-weight: 600;
}

.wot-items__qty {
	display: block;
	font-size: 0.85em;
	color: var(--wot-muted);
}

.wot-items__price {
	font-weight: 600;
	white-space: nowrap;
}

.wot-totals {
	list-style: none;
	margin: 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--wot-line);
}

.wot-totals li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 4px 0;
	margin: 0;
	font-size: 0.95em;
	color: var(--wot-muted);
}

.wot-totals li:last-child {
	font-weight: 700;
	font-size: 1.05em;
	color: var(--wot-text);
	padding-top: 8px;
}

.wot-address-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
}

.wot-address__label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 6px;
}

.wot-address address {
	font-style: normal;
	color: var(--wot-muted);
	font-size: 0.95em;
	line-height: 1.6;
}

.wot-note {
	margin: 16px 0 0;
	padding: 12px 14px;
	background: #fdf5f7;
	border-left: 3px solid var(--wot-accent);
	border-radius: 0 10px 10px 0;
	font-size: 0.93em;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
	.wot-form {
		padding: 20px;
	}

	.wot-button {
		width: 100%;
	}

	.wot-timeline {
		padding: 24px 22px;
	}

	.wot-timeline__track {
		top: 46px;
		left: 42px;
		width: 4px;
		height: calc(100% - 92px);
	}

	.wot-timeline__fill {
		width: 4px !important;
		height: var(--wot-progress, 0);
	}

	.wot-timeline__steps {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.wot-step {
		display: grid;
		grid-template-columns: 44px 1fr;
		column-gap: 14px;
		text-align: left;
		align-items: center;
	}

	.wot-step__dot {
		grid-row: span 2;
		margin-bottom: 0;
	}

	.wot-card__head,
	.wot-panel {
		padding-left: 20px;
		padding-right: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wot-wrapper * {
		animation: none !important;
		transition: none !important;
	}
}
