/*
 * MachShip Consignment Tracking — styles.
 * Minimal and theme-friendly. Only two brand colours are hardcoded, as CSS
 * variables on .machship-tracking (override to re-theme). Everything else uses
 * currentColor / color-mix / opacity so it inherits the host theme, including
 * dark mode. Neutral hairlines use color-mix(currentColor) — no extra vars.
 */

.machship-tracking {
	--machship-primary: #00adff;
	--machship-danger: #b00020;
}

/* --- Search form --- */
.machship-tracking__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.machship-tracking__label {
	width: 100%;
	font-weight: 700;
}

.machship-tracking__input {
	flex: 1 1 220px;
	padding: 0.55rem 0.75rem;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 6px;
}

.machship-tracking__input:focus {
	outline: 2px solid var(--machship-primary);
	outline-offset: 1px;
	border-color: transparent;
}

.machship-tracking__button {
	padding: 0.55rem 1.4rem;
	font: inherit;
	font-weight: 700;
	color: #fff;
	background: var(--machship-primary);
	border: 0;
	border-radius: 0px;
	cursor: pointer;
}

.machship-tracking__button:hover {
	opacity: 0.9;
}

.machship-tracking__result {
	margin-top: 1.25rem;
}

.machship-tracking__loading {
	opacity: 0.6;
}

.machship-tracking__error {
	color: var(--machship-danger);
}

.machship-tracking__empty {
	opacity: 0.7;
}

/* --- Consignment card --- */
.machship-consignment+.machship-consignment {
	margin-top: 1.5rem;
}

.machship-consignment__intro {
	margin: 0 0 0.25rem;
}

.machship-consignment__status {
	margin: 0;
	font-size: 2rem;
	line-height: 1.1;
	font-weight: 700;
	color: var(--machship-primary);
}

.machship-consignment__date {
	margin: 0.25rem 0 0;
	font-size: 1.05rem;
	opacity: 0.85;
}

.machship-consignment__eta {
	margin: 0.25rem 0 0;
	font-size: 1.05rem;
}

.machship-consignment__eta-label {
	opacity: 0.6;
	margin-right: 0.35rem;
}

/* --- Milestone progress bar --- */
.machship-steps {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin: 1.5rem 0;
}

.machship-steps__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 0 0 auto;
	text-align: center;
	width: 88px;
}

/* Base / upcoming: inherit text colour, just dimmed. */
.machship-steps__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid currentColor;
	background: transparent;
	opacity: 0.3;
	transition: color 0.2s, border-color 0.2s, background 0.2s, opacity 0.2s;
}

.machship-steps__label {
	margin-top: 0.5rem;
	font-size: 0.72rem;
	line-height: 1.2;
	opacity: 0.3;
}

.machship-steps__line {
	flex: 1 1 auto;
	height: 0;
	margin-top: 26px;
	/* vertically centre on the 52px circle */
	border-top: 2px dashed currentColor;
	opacity: 0.3;
}

.machship-steps__item.is-done .machship-steps__icon,
.machship-steps__item.is-active .machship-steps__icon {
	color: var(--machship-primary);
	border-color: var(--machship-primary);
	opacity: 1;
}

.machship-steps__item.is-done .machship-steps__label,
.machship-steps__item.is-active .machship-steps__label {
	opacity: 1;
}

.machship-steps__item.is-active .machship-steps__icon {
	background: var(--machship-primary);
	color: Canvas;
}

.machship-steps__item.is-active .machship-steps__label {
	font-weight: 700;
}

.machship-steps__line.is-done {
	border-top-color: var(--machship-primary);
	opacity: 1;
}

/* --- Status history --- */
.machship-history {
	margin-top: 1.5rem;
	border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.machship-history__day {
	font-weight: 700;
	font-size: 0.9rem;
	margin-top: 1rem;
	margin-bottom: 0.25rem;
}

.machship-history__row {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}

.machship-history__row:last-child {
	border-bottom: 0;
}

.machship-history__name {
	flex: 0 0 40%;
}

.machship-history__info {
	flex: 1 1 auto;
	opacity: 0.6;
	font-size: 0.9rem;
}

.machship-history__time {
	flex: 0 0 auto;
	margin-left: auto;
	opacity: 0.7;
	font-size: 0.9rem;
	white-space: nowrap;
}

/* --- Carrier + meta --- */
.machship-consignment__carrier,
.machship-consignment__meta {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.machship-consignment h4 {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
}

.machship-consignment__carrier p {
	display: inline-block;
	margin: 0;
	vertical-align: middle;
}

.machship-consignment__carrier-logo {
	margin-right: 0.5rem;
	vertical-align: middle;
	object-fit: contain;
}

.machship-consignment__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
}

.machship-consignment__meta>div {
	flex: 1 1 220px;
}

.machship-consignment__meta p {
	margin: 0.15rem 0;
	opacity: 0.85;
}

.machship-consignment__tracking-link {
	margin: 1.5rem 0 0;
}

@media (max-width: 480px) {
	.machship-steps__label {
		display: none;
	}

	.machship-steps__item {
		width: 52px;
	}

	.machship-history__name {
		flex-basis: auto;
	}
}