/* AusPost Tracking — frontend */

.auspost-tracking-section {
	margin: 2rem 0;
}
.auspost-tracking-section h2 {
	margin-bottom: 1rem;
}

.auspost-tracking-item {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.25rem;
	background: #fff;
}

.auspost-tracking-header {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: center;
	border-bottom: 1px solid #eee;
	padding-bottom: 0.75rem;
	margin-bottom: 1rem;
}
.auspost-tracking-header > div { display: flex; flex-direction: column; }
.auspost-tracking-header small {
	font-size: 11px;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.auspost-tracking-header strong {
	font-size: 16px;
	color: #111;
}
.auspost-external-link {
	text-decoration: none;
	color: #d40511;
	font-weight: 500;
}

/* Status colour accents */
.auspost-tracking-item.status-delivered { border-left: 4px solid #16a34a; }
.auspost-tracking-item.status-in-transit { border-left: 4px solid #2563eb; }
.auspost-tracking-item.status-with-courier { border-left: 4px solid #f59e0b; }
.auspost-tracking-item.status-pending { border-left: 4px solid #9ca3af; }
.auspost-tracking-item.status-pending-sync { border-left: 4px solid #9ca3af; }
.auspost-tracking-item.status-awaiting-carrier-scan { border-left: 4px solid #f59e0b; }
.auspost-tracking-item.status-error { border-left: 4px solid #b91c1c; }
.auspost-tracking-item.status-returned-to-sender { border-left: 4px solid #b91c1c; }

/* Timeline */
.auspost-tracking-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
}
.auspost-tracking-timeline::before {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: 0.5rem;
	width: 2px;
	background: #e5e7eb;
}
.auspost-event {
	position: relative;
	padding: 0.25rem 0 0.75rem 1.75rem;
}
.auspost-event::before {
	content: "";
	position: absolute;
	left: 0.25rem;
	top: 0.55rem;
	width: 0.625rem;
	height: 0.625rem;
	border-radius: 999px;
	background: #cbd5e1;
}
.auspost-event.is-latest::before {
	background: #d40511;
	box-shadow: 0 0 0 4px rgba(212, 5, 17, 0.18);
}
.auspost-event time {
	display: block;
	font-size: 12px;
	color: #6b7280;
	margin-bottom: 2px;
}
.auspost-event-body strong { display: block; color: #111; }
.auspost-event-body small { color: #6b7280; }

.auspost-tracking-empty { color: #6b7280; font-style: italic; }

/* Shortcode widget */
.auspost-tracking-widget {
	max-width: 520px;
	padding: 1.25rem;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fafafa;
}
.auspost-tracking-form {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.auspost-tracking-input {
	flex: 1;
	padding: 0.6rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 15px;
}
.auspost-tracking-button {
	padding: 0.6rem 1rem;
	background: #d40511;
	color: #fff;
	border: 0;
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
}
.auspost-tracking-button:hover { background: #b00410; }
.auspost-tracking-result { min-height: 1.5em; }
.auspost-tracking-result.is-error { color: #b91c1c; }

/* My Account */
.auspost-my-account-order {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}
.auspost-my-account-order-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	gap: 1rem;
	flex-wrap: wrap;
}

/* "Track" button on the My Account → Orders list. WC outputs
   `<a class="woocommerce-button button auspost-track">` so we
   target that to tint it without touching the theme's other buttons. */
.woocommerce-button.button.auspost-track,
.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions .auspost-track {
	background-color: #2563eb;
	border-color: #2563eb;
	color: #ffffff;
}
.woocommerce-button.button.auspost-track:hover,
.woocommerce-button.button.auspost-track:focus {
	background-color: #1d4ed8;
	border-color: #1d4ed8;
	color: #ffffff;
}



/* ============================================================================
   v1.0.115 — Customer-facing tracking page (rewritten)
   Earlier v1.0.112 styling relied heavily on flexbox layouts the theme would
   override (e.g. headline + date side-by-side via .event-row1 flex). The
   rewrite favours block-stacked layouts, uses minimal flex, and applies
   !important on layout-critical declarations the theme would otherwise win.
   ============================================================================ */

.auspost-track-page,
.auspost-track-page * {
	box-sizing: border-box;
}

.auspost-track-page {
	max-width: 720px !important;
	margin: 24px auto 32px !important;
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	border-radius: 12px !important;
	overflow: hidden !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
	color: #111827;
	line-height: 1.5;
}

/* Banner — carrier name + (external carriers only) product type pill. */
.auspost-track-page-banner {
	background: #111111;
	color: #fff;
	padding: 18px 28px;
}
.auspost-track-page-banner-inner {
	display: flex !important;
	align-items: center !important;
	gap: 12px;
	flex-wrap: wrap;
}
.auspost-track-page-carrier-name {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: #fff;
}
.auspost-track-page-product-type {
	font-size: 11px;
	background: rgba(255, 255, 255, 0.18);
	padding: 3px 10px;
	border-radius: 999px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
}

/* Carrier-specific banner colours. */
.auspost-track-page--carrier-auspost      .auspost-track-page-banner { background: #d31920; }
.auspost-track-page--carrier-startrack    .auspost-track-page-banner { background: #003a70; }
.auspost-track-page--carrier-fedex        .auspost-track-page-banner { background: #4d148c; }
.auspost-track-page--carrier-pickup       .auspost-track-page-banner { background: #111111; }
.auspost-track-page--carrier-consolidated .auspost-track-page-banner { background: #111111; }

/* Headline — tracking number left, status pill right. Both blocks stack on
   narrow screens (handled by flex-wrap + min-width). */
.auspost-track-page-headline {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 20px;
	padding: 24px 28px;
	border-bottom: 1px solid #f0f0f1;
	flex-wrap: wrap;
}
.auspost-track-page-id-block { min-width: 0; }
.auspost-track-page-id-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #6b7280;
	font-weight: 600;
	margin: 0 0 4px;
}
.auspost-track-page-id {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 22px;
	font-weight: 700;
	color: #111827;
	word-break: break-all;
	line-height: 1.2;
}
.auspost-track-page-status-block { text-align: right; }

/* Status pill — slightly bigger than v1.0.112 so it actually reads as the
   primary status indicator. */
.auspost-track-page-status-pill {
	display: inline-block !important;
	padding: 8px 16px !important;
	border-radius: 999px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	background: #f3f4f6;
	color: #374151;
	line-height: 1.2;
}
.auspost-track-page-last-updated {
	font-size: 11px;
	color: #6b7280;
	margin-top: 8px;
}

/* Status colour palette — mirrors the admin pill colours. */
.auspost-track-page-status-pill.auspost-status-delivered                { background: #d1fae5; color: #065f46; }
.auspost-track-page-status-pill.auspost-status-in-transit               { background: #dbeafe; color: #1e40af; }
.auspost-track-page-status-pill.auspost-status-awaiting,
.auspost-track-page-status-pill.auspost-status-with-courier             { background: #fef3c7; color: #92400e; }
.auspost-track-page-status-pill.auspost-status-error,
.auspost-track-page-status-pill.auspost-status-returned                 { background: #fee2e2; color: #991b1b; }
.auspost-track-page-status-pill.auspost-status-order-payment-received   { background: #e0e7ff; color: #3730a3; }
.auspost-track-page-status-pill.auspost-status-picking,
.auspost-track-page-status-pill.auspost-status-packed                   { background: #f3f4f6; color: #374151; }
.auspost-track-page-status-pill.auspost-status-ready-for-pickup         { background: #d1fae5; color: #065f46; }

/* Timeline. */
.auspost-track-page-timeline,
.auspost-track-page-timeline-empty {
	padding: 24px 28px;
}
.auspost-track-page-section-title {
	margin: 0 0 18px !important;
	font-size: 12px !important;
	text-transform: uppercase !important;
	letter-spacing: 0.6px !important;
	color: #6b7280 !important;
	font-weight: 700 !important;
}

.auspost-track-page-events {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 0 0 20px !important;
	border-left: 2px solid #e5e7eb !important;
}
.auspost-track-page-event {
	position: relative !important;
	padding: 0 0 22px 16px !important;
	margin: 0 !important;
	list-style: none !important;
}
.auspost-track-page-event:last-child {
	padding-bottom: 0 !important;
}

/* Marker dot — positioned ON the vertical timeline. */
.auspost-track-page-event-marker {
	position: absolute !important;
	left: -27px !important;
	top: 2px !important;
	width: 14px !important;
	height: 14px !important;
	border-radius: 50% !important;
	background: #d1d5db !important;
	border: 2px solid #fff !important;
	box-shadow: 0 0 0 1px #d1d5db !important;
	display: block !important;
}
.auspost-track-page-event.is-latest .auspost-track-page-event-marker {
	background: #16a34a !important;
	box-shadow: 0 0 0 1px #16a34a, 0 0 0 5px rgba(22, 163, 74, 0.18) !important;
}
.auspost-track-page-event-marker.auspost-status-delivered   { background: #16a34a !important; box-shadow: 0 0 0 1px #16a34a !important; }
.auspost-track-page-event-marker.auspost-status-in-transit  { background: #2563eb !important; box-shadow: 0 0 0 1px #2563eb !important; }
.auspost-track-page-event-marker.auspost-status-awaiting,
.auspost-track-page-event-marker.auspost-status-with-courier{ background: #d97706 !important; box-shadow: 0 0 0 1px #d97706 !important; }
.auspost-track-page-event-marker.auspost-status-error,
.auspost-track-page-event-marker.auspost-status-returned    { background: #dc2626 !important; box-shadow: 0 0 0 1px #dc2626 !important; }

/* Event body — stacked. Status above, date below, then description, then
   location. No flexbox = no theme-side breakage. */
.auspost-track-page-event-body {
	display: block !important;
}
.auspost-track-page-event-status {
	display: block !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	color: #111827 !important;
	margin: 0 0 2px !important;
	line-height: 1.3 !important;
}
.auspost-track-page-event-date {
	display: block !important;
	font-size: 12px !important;
	color: #6b7280 !important;
	margin: 0 0 6px !important;
	line-height: 1.4 !important;
}
.auspost-track-page-event-description {
	display: block !important;
	font-size: 13px !important;
	color: #374151 !important;
	margin: 0 0 4px !important;
	line-height: 1.5 !important;
}
.auspost-track-page-event-location {
	display: block !important;
	font-size: 12px !important;
	color: #6b7280 !important;
	line-height: 1.4 !important;
}
.auspost-track-page-event-location-icon {
	margin-right: 4px;
}

/* Empty-state + not-found. */
.auspost-track-page-timeline-empty p {
	margin: 0 !important;
	color: #6b7280;
	font-size: 13px;
}
.auspost-track-page--not-found {
	padding: 36px 32px !important;
	text-align: center !important;
}
.auspost-track-page--not-found h3 {
	margin: 0 0 12px !important;
	color: #991b1b !important;
	font-size: 18px !important;
}
.auspost-track-page--not-found p {
	color: #6b7280 !important;
	line-height: 1.6 !important;
	max-width: 460px;
	margin: 0 auto !important;
}
.auspost-track-page--not-found code {
	background: #f3f4f6 !important;
	padding: 2px 8px !important;
	border-radius: 3px !important;
	font-family: ui-monospace, Menlo, monospace !important;
}

/* Footer — small "track another" link inside the same card. */
.auspost-track-page-footer {
	padding: 14px 28px 18px !important;
	border-top: 1px solid #f0f0f1 !important;
	text-align: center !important;
	background: #fafafa !important;
}
.auspost-track-page-footer-link {
	font-size: 13px !important;
	color: #4b5563 !important;
	text-decoration: none !important;
	font-weight: 500 !important;
}
.auspost-track-page-footer-link:hover {
	color: #111827 !important;
	text-decoration: underline !important;
}

/* Mobile — stack the headline. */
@media (max-width: 540px) {
	.auspost-track-page-headline {
		flex-direction: column !important;
		align-items: flex-start !important;
	}
	.auspost-track-page-status-block { text-align: left !important; }
	.auspost-track-page-id { font-size: 18px !important; }
}
