/* ==========================================================================
   WPCargo Custom Tracking Result
   ========================================================================== */

.wpccr-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 16px;
	font-family: inherit;
	color: #111827;
	-webkit-font-smoothing: antialiased;
}

.wpccr-wrap *,
.wpccr-wrap *::before,
.wpccr-wrap *::after {
	box-sizing: border-box;
}

.wpccr-wrap h3,
.wpccr-wrap h4,
.wpccr-wrap p {
	margin: 0;
	padding: 0;
}

/* Icons ------------------------------------------------------------------ */

.wpccr-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	vertical-align: middle;
	display: inline-block;
}

/* Cards ------------------------------------------------------------------ */

.wpccr-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
	margin-bottom: 24px;
	overflow: hidden;
}

.wpccr-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 19px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 8px;
}

.wpccr-title-icon {
	width: 22px;
	height: 22px;
	color: #f97316;
}

.wpccr-subtitle {
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 16px;
}

/* Top bar ----------------------------------------------------------------- */

.wpccr-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 14px 20px;
}

.wpccr-found {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #16a34a;
	font-weight: 600;
	font-size: 14px;
}

.wpccr-found .wpccr-icon {
	width: 18px;
	height: 18px;
}

.wpccr-topbar-actions {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Buttons ----------------------------------------------------------------- */

.wpccr-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
	color: #374151;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wpccr-btn:hover {
	background: #f3f4f6;
	color: #111827;
}

.wpccr-btn-blue {
	background: #dbeafe;
	border-color: #bfdbfe;
	color: #1d4ed8;
}

.wpccr-btn-blue:hover {
	background: #bfdbfe;
	color: #1e40af;
}

.wpccr-btn.wpccr-copied {
	background: #dcfce7;
	border-color: #86efac;
	color: #15803d;
}

/* Notices ----------------------------------------------------------------- */

.wpccr-notice {
	padding: 14px 18px;
	border-radius: 10px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	color: #374151;
	font-size: 14px;
	margin: 8px 0;
}

.wpccr-notice-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

.wpccr-empty {
	padding: 48px 24px;
	text-align: center;
	color: #6b7280;
	font-size: 15px;
}

.wpccr-empty-icon .wpccr-icon {
	width: 40px;
	height: 40px;
	color: #d1d5db;
	margin-bottom: 12px;
}

/* Shipment Progress timeline ---------------------------------------------- */

.wpccr-progress {
	padding: 24px;
}

.wpccr-timeline {
	position: relative;
	padding: 8px 0 0;
}

.wpccr-timeline::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 28px;
	bottom: 28px;
	width: 2px;
	background: #e5e7eb;
	z-index: 0;
}

.wpccr-tl-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 12px 0;
	position: relative;
	z-index: 1;
}

.wpccr-tl-marker {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpccr-tl-bubble {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border: 2px solid #d1d5db;
	color: #9ca3af;
	position: relative;
	transition: all 0.3s ease;
}

.wpccr-tl-bubble .wpccr-icon {
	width: 15px;
	height: 15px;
}

/* Completed: green with checkmark */
.wpccr-tl-item.completed .wpccr-tl-bubble {
	background: #22c55e;
	border-color: #22c55e;
	color: #fff;
}

/* Active: pulsing green */
.wpccr-tl-item.active .wpccr-tl-bubble {
	background: #22c55e;
	border-color: #22c55e;
	color: #fff;
}

.wpccr-tl-item.active .wpccr-tl-bubble::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.4);
	animation: wpccr-pulse 1.5s ease-in-out infinite;
	z-index: -1;
}

/* Expected Delivery: red until delivered */
.wpccr-tl-item.expected .wpccr-tl-bubble {
	background: #ef4444;
	border-color: #ef4444;
	color: #fff;
}

.wpccr-tl-item.pending.expected .wpccr-tl-bubble {
	animation: none;
}

/* Status-specific pulses on the active step */
.wpccr-tl-item.active.cancelled .wpccr-tl-bubble {
	background: #ef4444;
	border-color: #ef4444;
}

.wpccr-tl-item.active.cancelled .wpccr-tl-bubble::before {
	background: rgba(239, 68, 68, 0.4);
}

.wpccr-tl-item.active.returned .wpccr-tl-bubble {
	background: #f97316;
	border-color: #f97316;
}

.wpccr-tl-item.active.returned .wpccr-tl-bubble::before {
	background: rgba(249, 115, 22, 0.4);
}

.wpccr-tl-item.active.on-hold .wpccr-tl-bubble {
	background: #eab308;
	border-color: #eab308;
}

.wpccr-tl-item.active.on-hold .wpccr-tl-bubble::before {
	background: rgba(234, 179, 8, 0.4);
}

@keyframes wpccr-pulse {
	0% {
		transform: scale(1);
		opacity: 0.6;
	}
	50% {
		transform: scale(1.7);
		opacity: 0;
	}
	100% {
		transform: scale(1);
		opacity: 0;
	}
}

.wpccr-tl-content h4 {
	font-size: 15px;
	font-weight: 600;
	color: #111827;
	margin-bottom: 3px;
}

.wpccr-tl-item.pending .wpccr-tl-content h4 {
	color: #6b7280;
}

.wpccr-tl-location {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 2px;
}

.wpccr-tl-date {
	font-size: 12px;
	color: #9ca3af;
}

/* Info card grid ----------------------------------------------------------- */

.wpccr-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	margin-bottom: 24px;
}

.wpccr-grid .wpccr-card {
	margin-bottom: 0;
}

.wpccr-card-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
	color: #fff;
}

.wpccr-card-icon {
	width: 38px;
	height: 38px;
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.wpccr-card-icon .wpccr-icon {
	width: 18px;
	height: 18px;
}

.wpccr-card-titles {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.wpccr-card-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.wpccr-card-subtitle {
	font-size: 12px;
	opacity: 0.85;
}

.wpccr-card-body {
	padding: 4px 20px;
}

.wpccr-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 14px;
}

.wpccr-row:last-child {
	border-bottom: none;
}

.wpccr-row-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 40%;
	max-width: 40%;
	color: #6b7280;
	font-weight: 500;
}

.wpccr-row-label .wpccr-icon {
	width: 14px;
	height: 14px;
	color: #f97316;
}

.wpccr-row-value {
	flex: 1;
	min-width: 0;
	color: #111827;
	font-weight: 500;
	overflow-wrap: anywhere;
}

.wpccr-value-red {
	color: #dc2626;
	font-weight: 700;
}

.wpccr-value-green {
	color: #16a34a;
	font-weight: 700;
}

.wpccr-value-muted {
	color: #9ca3af;
}

/* Pills -------------------------------------------------------------------- */

.wpccr-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
}

.wpccr-pill .wpccr-icon {
	width: 13px;
	height: 13px;
}

.wpccr-pill-blue {
	background: #dbeafe;
	color: #1d4ed8;
}

.wpccr-pill-yellow {
	background: #fef9c3;
	color: #a16207;
}

/* Route section ------------------------------------------------------------ */

.wpccr-route-section {
	padding: 24px;
}

.wpccr-route-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.wpccr-route-card {
	flex: 1 1 220px;
	min-width: 220px;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: 10px;
	border: 1px solid #e5e7eb;
	background: #f9fafb;
}

.wpccr-route-card.origin {
	background: #f0fdf4;
	border-color: #86efac;
}

.wpccr-route-card.hub {
	background: #eff6ff;
	border-color: #93c5fd;
}

.wpccr-route-card.destination {
	background: #fef2f2;
	border-color: #fca5a5;
}

.wpccr-route-badge {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #16a34a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	flex-shrink: 0;
}

.wpccr-route-badge .wpccr-icon {
	width: 15px;
	height: 15px;
}

.wpccr-route-card.hub .wpccr-route-badge {
	background: #2563eb;
}

.wpccr-route-card.destination .wpccr-route-badge {
	background: #dc2626;
}

.wpccr-route-info {
	min-width: 0;
}

.wpccr-route-info h4 {
	font-size: 14.5px;
	font-weight: 600;
	color: #111827;
	margin-bottom: 3px;
	overflow-wrap: anywhere;
}

.wpccr-route-label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12.5px;
	color: #6b7280;
}

.wpccr-route-card.origin .wpccr-route-label {
	color: #16a34a;
}

.wpccr-route-card.hub .wpccr-route-label {
	color: #2563eb;
}

.wpccr-route-card.destination .wpccr-route-label {
	color: #dc2626;
}

.wpccr-route-label .wpccr-icon {
	width: 12px;
	height: 12px;
}

.wpccr-route-arrow {
	margin-left: auto;
	color: #9ca3af;
	display: flex;
}

/* Map ----------------------------------------------------------------------- */

.wpccr-map {
	margin: 4px 0 14px;
}

.wpccr-map iframe {
	display: block;
	width: 100%;
	height: 450px;
	border: 0;
	border-radius: 12px;
}

/* Route summary bar ----------------------------------------------------------- */

.wpccr-route-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 24px;
	padding: 12px 16px;
	background: #f9fafb;
	border-radius: 8px;
	font-size: 13.5px;
	color: #374151;
	margin-bottom: 14px;
}

.wpccr-route-summary span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.wpccr-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

.wpccr-dot-green {
	background: #22c55e;
}

.wpccr-dot-red {
	background: #ef4444;
}

.wpccr-dot-blue {
	background: #3b82f6;
}

.wpccr-dot-orange {
	background: #f97316;
}

/* Note --------------------------------------------------------------------- */

.wpccr-note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 12px 16px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	color: #1d4ed8;
	font-size: 13.5px;
}

.wpccr-note .wpccr-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

/* Tracking form ---------------------------------------------------------------- */

.wpccr-track-form-wrap {
	max-width: 640px;
}

/* When the form is embedded inside the result page, don't double the frame. */
.wpccr-wrap .wpccr-track-form-wrap {
	max-width: none;
	padding: 0;
}

.wpccr-track-form-card {
	padding: 28px 24px;
}

.wpccr-track-form-title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 21px;
	font-weight: 700;
	color: #111827;
	margin-bottom: 6px;
	text-align: center;
}

.wpccr-track-form-subtitle {
	font-size: 14px;
	color: #6b7280;
	text-align: center;
	margin-bottom: 20px;
}

.wpccr-track-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
}

.wpccr-track-input {
	flex: 1 1 260px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 14px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	color: #9ca3af;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpccr-track-input:focus-within {
	border-color: #f97316;
	box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.wpccr-track-input input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	padding: 12px 0;
	font-size: 14.5px;
	color: #111827;
	box-shadow: none;
}

.wpccr-track-input input::placeholder {
	color: #9ca3af;
}

.wpccr-track-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: 10px;
	background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
	color: #fff;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.wpccr-track-submit:hover {
	filter: brightness(1.08);
}

.wpccr-track-submit:active {
	transform: translateY(1px);
}

@media (max-width: 520px) {
	.wpccr-track-submit {
		flex: 1 1 100%;
	}
}

/* Delivery summary (standalone shortcode) ------------------------------------ */

.wpccr-delivery-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.wpccr-summary-item {
	flex: 1 1 160px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wpccr-summary-label {
	font-size: 12.5px;
	color: #6b7280;
	font-weight: 500;
}

.wpccr-summary-value {
	font-size: 20px;
	font-weight: 700;
	color: #111827;
}

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

@media (max-width: 768px) {
	.wpccr-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.wpccr-card {
		margin-bottom: 16px;
	}

	.wpccr-topbar {
		justify-content: center;
	}

	.wpccr-route-card {
		flex-basis: 100%;
	}

	.wpccr-map iframe {
		height: 320px;
	}

	.wpccr-row-label {
		flex-basis: 45%;
		max-width: 45%;
	}
}

/* Print ------------------------------------------------------------------------ */

@media print {
	header,
	footer,
	nav,
	aside,
	.site-header,
	.site-footer,
	#masthead,
	#colophon,
	#wpadminbar,
	.wpccr-no-print {
		display: none !important;
	}

	body {
		background: #fff !important;
	}

	.wpccr-wrap {
		max-width: none;
		padding: 0;
	}

	.wpccr-card {
		box-shadow: none;
		border: 1px solid #e5e7eb;
		break-inside: avoid;
	}

	.wpccr-card-header {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.wpccr-tl-item.active .wpccr-tl-bubble::before {
		display: none;
	}
}
