/* ==================================================================
   18 - ORDER TRACKING
   The guest "Track My Order" page: the lookup form and its result.

   Everything is scoped to .wo-track, so this cannot reach the cart,
   checkout, account, or any other page - including the WooCommerce
   order-details table rendered inside .wo-track__details, which is
   only restyled where it sits within this wrapper.
   ================================================================== */

.wo-track {
	max-width: 560px;
	margin-inline: auto;
}

.wo-track--result {
	max-width: 720px;
}


/* ------------------------------------------------------------------
   LOOKUP FORM
   ------------------------------------------------------------------ */

.wo-track__card {
	padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.25rem);

	background: var(--wo-grad-surface);
	border: 1px solid var(--wo-line);
	border-radius: var(--wo-radius-lg);
	box-shadow: var(--wo-shadow-lg);
}

.wo-track__title {
	margin: 0 0 var(--wo-space-2);
	font-family: var(--wo-font-display);
	font-size: var(--wo-text-2xl);
	color: var(--wo-text);
	text-align: center;
}

.wo-track__lead {
	margin: 0 0 var(--wo-space-6);
	font-size: var(--wo-text-sm);
	line-height: 1.6;
	color: var(--wo-text-muted);
	text-align: center;
}

.wo-track .wo-field {
	margin-bottom: var(--wo-space-5);
}

.wo-track .wo-field label {
	display: block;
	margin-bottom: var(--wo-space-2);
	font-size: var(--wo-text-sm);
	font-weight: var(--wo-weight-medium);
	color: var(--wo-text);
}

.wo-track .wo-field__hint {
	margin: var(--wo-space-2) 0 0;
	font-size: var(--wo-text-xs);
	color: var(--wo-text-dim);
}

.wo-track__help {
	margin: var(--wo-space-6) 0 0;
	font-size: var(--wo-text-xs);
	line-height: 1.6;
	color: var(--wo-text-dim);
	text-align: center;
}


/* ------------------------------------------------------------------
   RESULT - SUMMARY STRIP
   ------------------------------------------------------------------ */

.wo-track__summary {
	display: grid;
	gap: var(--wo-space-3);
	padding: var(--wo-space-5);
	margin-bottom: var(--wo-space-6);

	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--wo-line);
	border-radius: var(--wo-radius-md);
}

.wo-track__summary-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--wo-space-3);
}

.wo-track__label {
	font-size: var(--wo-text-sm);
	color: var(--wo-text-muted);
}

.wo-track__value {
	font-size: var(--wo-text-sm);
	font-weight: var(--wo-weight-semibold);
	color: var(--wo-text);
	text-align: right;
	overflow-wrap: anywhere;
}

.wo-track__status {
	padding: 0.25rem 0.75rem;
	font-size: var(--wo-text-xs);
	border-radius: var(--wo-radius-pill);
	background: var(--wo-primary-soft);
	color: var(--wo-primary-hover);
}

.wo-track__status--completed {
	background: rgba(74, 222, 128, 0.14);
	color: var(--wo-success);
}

.wo-track__status--cancelled,
.wo-track__status--failed {
	background: rgba(255, 107, 107, 0.14);
	color: var(--wo-error);
}

.wo-track__status--refunded {
	background: var(--wo-gold-soft);
	color: var(--wo-gold);
}


/* ------------------------------------------------------------------
   RESULT - PROGRESS TIMELINE
   ------------------------------------------------------------------ */

.wo-track__timeline {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wo-space-2);
	margin: 0 0 var(--wo-space-6);
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.wo-track__step {
	position: relative;
	padding-top: var(--wo-space-6);
	text-align: center;
}

/* The connecting rail, drawn behind the dots. Not on the first
   step, so the line only ever appears BETWEEN two dots. */
.wo-track__step::before {
	content: '';
	position: absolute;
	top: 9px;
	right: 50%;
	left: -50%;
	height: 2px;
	background: var(--wo-line);
}

.wo-track__step:first-child::before {
	display: none;
}

.wo-track__step.is-done::before {
	background: var(--wo-primary);
}

.wo-track__dot {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);

	width: 20px;
	height: 20px;

	background: var(--wo-surface);
	border: 2px solid var(--wo-line-strong);
	border-radius: var(--wo-radius-circle);
}

.wo-track__step.is-done .wo-track__dot {
	background: var(--wo-primary);
	border-color: var(--wo-primary);
}

.wo-track__step.is-current .wo-track__dot {
	box-shadow: 0 0 0 5px var(--wo-primary-soft);
}

.wo-track__step-label {
	display: block;
	font-size: var(--wo-text-xs);
	line-height: 1.4;
	color: var(--wo-text-dim);
}

.wo-track__step.is-done .wo-track__step-label {
	color: var(--wo-text);
	font-weight: var(--wo-weight-medium);
}


/* ------------------------------------------------------------------
   RESULT - HALTED STATES (cancelled / refunded / failed)
   ------------------------------------------------------------------ */

.wo-track__halted {
	padding: var(--wo-space-5);
	margin-bottom: var(--wo-space-6);

	border: 1px solid var(--wo-line);
	border-left-width: 3px;
	border-radius: var(--wo-radius-md);
	background: rgba(255, 255, 255, 0.03);
}

.wo-track__halted--cancelled,
.wo-track__halted--failed {
	border-left-color: var(--wo-error);
}

.wo-track__halted--refunded {
	border-left-color: var(--wo-gold);
}

.wo-track__halted-title {
	margin: 0 0 var(--wo-space-2);
	font-size: var(--wo-text-base);
	font-weight: var(--wo-weight-semibold);
	color: var(--wo-text);
}

.wo-track__halted-text {
	margin: 0;
	font-size: var(--wo-text-sm);
	line-height: 1.6;
	color: var(--wo-text-muted);
}


/* ------------------------------------------------------------------
   RESULT - UPDATES (customer-visible order notes)
   ------------------------------------------------------------------ */

.wo-track__updates {
	margin-bottom: var(--wo-space-6);
}

.wo-track__updates-title {
	margin: 0 0 var(--wo-space-4);
	font-family: var(--wo-font-display);
	font-size: var(--wo-text-lg);
	color: var(--wo-text);
}

.wo-track__notes {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wo-track__note {
	padding: var(--wo-space-4);
	margin-bottom: var(--wo-space-3);

	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--wo-line);
	border-radius: var(--wo-radius-md);
}

.wo-track__note-date {
	margin: 0 0 var(--wo-space-2);
	font-size: var(--wo-text-xs);
	color: var(--wo-text-dim);
}

.wo-track__note-body {
	font-size: var(--wo-text-sm);
	line-height: 1.6;
	color: var(--wo-text);
}

.wo-track__note-body p:last-child {
	margin-bottom: 0;
}


/* ------------------------------------------------------------------
   RESULT - WOOCOMMERCE ORDER DETAILS TABLE
   Restyled only inside .wo-track__details.
   ------------------------------------------------------------------ */

.wo-track__details table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--wo-line);
	border-radius: var(--wo-radius-md);
	overflow: hidden;
}

.wo-track__details table.shop_table th,
.wo-track__details table.shop_table td {
	padding: var(--wo-space-3) var(--wo-space-4);
	font-size: var(--wo-text-sm);
	text-align: left;
	border-bottom: 1px solid var(--wo-line-faint);
	color: var(--wo-text);
}

.wo-track__details table.shop_table th {
	font-weight: var(--wo-weight-semibold);
	color: var(--wo-text-muted);
	background: rgba(255, 255, 255, 0.03);
}

.wo-track__details .woocommerce-columns--addresses {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--wo-space-5);
	margin-top: var(--wo-space-6);
}

.wo-track__details address {
	font-style: normal;
	font-size: var(--wo-text-sm);
	line-height: 1.7;
	color: var(--wo-text-muted);
}


/* ------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------ */

@media (max-width: 479.98px) {

	.wo-track__card {
		padding: var(--wo-space-6) var(--wo-space-4);
		border-radius: var(--wo-radius-md);
	}

	.wo-track__summary-row {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--wo-space-1);
	}

	.wo-track__value {
		text-align: left;
	}

	.wo-track__step-label {
		font-size: 0.6875rem;
	}

	.wo-track__details table.shop_table th,
	.wo-track__details table.shop_table td {
		padding: var(--wo-space-3);
	}
}
