/* Advanced Shipment Tracking - frontend styles */

.dispatchio-tracking-info {
	margin: 24px 0;
}
.dispatchio-table .dispatchio-track-button {
	white-space: nowrap;
}

/* Public tracking page. Colours use translucent greys so the page reads on
   light and dark themes alike; the accent comes from the tracking page
   settings through --dispatchio-accent. */
.dispatchio-lookup {
	max-width: 640px;
	margin: 0 auto;
}
.dispatchio-lookup *,
.dispatchio-lookup *::before,
.dispatchio-lookup *::after {
	box-sizing: border-box;
}
.dispatchio-lookup-logo {
	text-align: center;
	margin: 0 0 20px;
}
.dispatchio-lookup-logo img {
	display: inline-block;
	max-width: min(240px, 100%);
	max-height: 80px;
	width: auto;
	height: auto;
}

/* Lookup form */
.dispatchio-lookup-form {
	background: rgba(127, 127, 127, 0.06);
	border: 1px solid rgba(127, 127, 127, 0.3);
	border-radius: 8px;
	padding: 24px 28px;
}
.dispatchio-lookup-form h3 {
	margin-top: 0;
}
.dispatchio-lookup-form fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.dispatchio-lookup-form fieldset[hidden] {
	display: none;
}
.dispatchio-lookup-mode {
	margin-bottom: 12px;
}
.dispatchio-lookup-mode legend {
	font-weight: 600;
	margin-bottom: 6px;
	padding: 0;
}
.dispatchio-lookup-form .dispatchio-lookup-mode label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 20px 6px 0;
	font-weight: normal;
}
.dispatchio-lookup-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}
.dispatchio-lookup-form input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid rgba(127, 127, 127, 0.6);
	border-radius: 4px;
}
.dispatchio-lookup.has-dispatchio-accent .dispatchio-lookup-btn,
.dispatchio-lookup.has-dispatchio-accent .dispatchio-track-button {
	background-color: var(--dispatchio-accent);
	border-color: var(--dispatchio-accent);
	color: var(--dispatchio-accent-text, #fff);
}
.dispatchio-lookup-form input:focus-visible {
	outline: 2px solid var(--dispatchio-accent, #7f54b3);
	outline-offset: 1px;
}
.dispatchio-lookup-result {
	margin-top: 24px;
}
.dispatchio-lookup-result:focus {
	outline: none;
}
.dispatchio-lookup-error {
	color: #b32d2e;
	padding: 12px 0;
}
.dispatchio-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Timeline */
.dispatchio-timeline {
	display: flex;
	list-style: none;
	margin: 24px 0 32px;
	padding: 0;
}
.dispatchio-timeline li {
	flex: 1;
	position: relative;
	text-align: center;
	margin: 0;
}
.dispatchio-timeline li::before {
	content: "";
	position: absolute;
	top: 9px;
	left: -50%;
	width: 100%;
	height: 3px;
	background: rgba(127, 127, 127, 0.3);
	z-index: 0;
}
.dispatchio-timeline li:first-child::before {
	display: none;
}
.dispatchio-timeline li.is-done::before {
	background: var(--dispatchio-accent, #7f54b3);
}
.dispatchio-dot {
	position: relative;
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ddd;
	border: 3px solid #fff;
	box-shadow: 0 0 0 2px #ddd;
	z-index: 1;
}
.dispatchio-timeline li.is-done .dispatchio-dot {
	background: var(--dispatchio-accent, #7f54b3);
	box-shadow: 0 0 0 2px var(--dispatchio-accent, #7f54b3);
}
.dispatchio-step-label {
	display: block;
	margin-top: 8px;
	font-size: 0.9em;
	line-height: 1.3;
}
.dispatchio-timeline li[aria-current="step"] .dispatchio-step-label {
	font-weight: 600;
}
.dispatchio-timeline-wrap .dispatchio-table {
	width: 100%;
	border-collapse: collapse;
}
.dispatchio-timeline-wrap .dispatchio-table th,
.dispatchio-timeline-wrap .dispatchio-table td {
	border: 1px solid #e2e2e2;
	padding: 8px 12px;
	text-align: left;
}
.dispatchio-no-tracking {
	opacity: 0.8;
	font-style: italic;
}

/* Parcels on the tracking page */
.dispatchio-parcel {
	border: 1px solid rgba(127, 127, 127, 0.3);
	border-radius: 8px;
	padding: 16px 20px;
	margin: 0 0 16px;
}
.dispatchio-parcel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.dispatchio-parcel-title {
	margin: 0;
	font-size: 1em;
}
.dispatchio-parcel-badges {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}
.dispatchio-parcel-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px 20px;
	margin: 14px 0 0;
}
.dispatchio-parcel-meta dt {
	margin: 0;
	font-size: 0.8em;
	opacity: 0.75;
}
.dispatchio-parcel-meta dd {
	margin: 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}
.dispatchio-parcel-last-event {
	margin: 12px 0 0;
}
.dispatchio-parcel-items {
	margin: 14px 0 0;
}
.dispatchio-parcel-items-title {
	margin: 0 0 4px;
	font-weight: 600;
}
.dispatchio-parcel-items ul {
	margin: 0;
	padding-left: 1.2em;
}
.dispatchio-parcel-item-qty {
	opacity: 0.75;
	white-space: nowrap;
}
.dispatchio-parcel .dispatchio-checkpoints {
	margin-top: 14px;
}
.dispatchio-parcel-actions {
	margin: 14px 0 0;
}

@media (max-width: 480px) {
	.dispatchio-lookup-form {
		padding: 18px 16px;
	}
	.dispatchio-step-label {
		font-size: 0.75em;
	}
	.dispatchio-parcel {
		padding: 14px 16px;
	}
}

/* Live tracking badges + checkpoints */
.dispatchio-live-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	background: #e5e5e5;
	color: #333;
}
.st-live-in_transit { background: #d6e4ff; color: #1d39c4; }
.st-live-out_for_delivery,
.st-live-available_for_pickup { background: #fff1b8; color: #ad6800; }
.st-live-delivered { background: #d9f2d9; color: #1e7a1e; }
.st-live-failed_attempt,
.st-live-exception { background: #ffd6d6; color: #a8071a; }
.st-live-returned { background: #ffe7ba; color: #873800; }
.st-live-expired { background: #eee; color: #666; }
.st-live-pending,
.st-live-info_received { background: #efe6fb; color: #531dab; }

.dispatchio-checkpoints summary {
	cursor: pointer;
	font-weight: 600;
}
.dispatchio-checkpoint-list {
	list-style: none;
	margin: 12px 0 0;
	padding: 0 0 0 14px;
	border-left: 2px solid var(--dispatchio-accent, #7f54b3);
}
.dispatchio-checkpoint-list li {
	position: relative;
	margin-bottom: 12px;
	padding-left: 10px;
}
.dispatchio-checkpoint-list li::before {
	content: "";
	position: absolute;
	left: -19px;
	top: 5px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dispatchio-accent, #7f54b3);
}
.st-cp-time,
.dispatchio-cp-time {
	display: block;
	font-size: 0.85em;
	opacity: 0.75;
}
.st-cp-desc,
.dispatchio-cp-desc {
	display: block;
}
.st-cp-loc,
.dispatchio-cp-loc {
	display: block;
	font-size: 0.85em;
	opacity: 0.75;
}

/* Vendor panels */
.dispatchio-vendor-panel .dispatchio-vendor-form label {
	display: block;
	font-weight: 600;
}
.dispatchio-vendor-msg,
.dispatchio-wcfm-msg {
	margin-left: 8px;
}

/* Return badge */
.dispatchio-return-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	background: #fde2e2;
	color: #a8071a;
}

/* Tracking number doubles as the link to the carrier, so customers can reach
   the carrier's own page to leave delivery instructions without retyping it. */
.dispatchio-tracking-number {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.dispatchio-tracking-number:hover,
.dispatchio-tracking-number:focus {
	text-decoration-thickness: 2px;
}
.dispatchio-tracking-number.is-plain {
	text-decoration: none;
}
