/* Track & Trace Pro — Frontend Styles
   Palette: ink navy #0B1D33, slate #16324F, paper #F7F9FC, brass #E8A33D, success #2E9E6C
   Type: display 'Space Grotesk', body 'Inter', data 'JetBrains Mono'
*/
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

.ttp-wrap {
	--ttp-ink: #0B1D33;
	--ttp-slate: #16324F;
	--ttp-paper: #F7F9FC;
	--ttp-brass: #E8A33D;
	--ttp-success: #2E9E6C;
	--ttp-danger: #D65F5F;
	--ttp-muted: #5B6B7C;
	--ttp-border: #E1E7EF;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--ttp-ink);
	max-width: 900px;
	margin: 0 auto;
}

.ttp-wrap * { box-sizing: border-box; }

/* ---------- Search Card ---------- */
.ttp-search-card {
	background: linear-gradient(135deg, var(--ttp-ink) 0%, var(--ttp-slate) 100%);
	border-radius: 16px;
	padding: 40px 36px;
	text-align: center;
	position: relative;
	overflow: hidden;
}
.ttp-search-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 90% 10%, rgba(232,163,61,0.18), transparent 45%),
		radial-gradient(circle at 5% 90%, rgba(255,255,255,0.06), transparent 40%);
	pointer-events: none;
}
.ttp-search-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 28px;
	font-weight: 700;
	color: #fff;
	margin: 0 0 8px;
	letter-spacing: -0.01em;
}
.ttp-search-sub {
	color: rgba(255,255,255,0.7);
	margin: 0 0 26px;
	font-size: 15px;
}
.ttp-search-form {
	display: flex;
	gap: 10px;
	max-width: 480px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}
#ttp-tracking-input {
	flex: 1;
	padding: 15px 18px;
	border-radius: 10px;
	border: 1px solid rgba(255,255,255,0.15);
	background: rgba(255,255,255,0.08);
	color: #fff;
	font-family: 'JetBrains Mono', monospace;
	font-size: 15px;
	letter-spacing: 0.03em;
	outline: none;
	transition: border-color .15s, background .15s;
}
#ttp-tracking-input::placeholder { color: rgba(255,255,255,0.4); }
#ttp-tracking-input:focus {
	border-color: var(--ttp-brass);
	background: rgba(255,255,255,0.12);
}
.ttp-track-btn {
	background: var(--ttp-brass);
	color: var(--ttp-ink);
	border: none;
	border-radius: 10px;
	padding: 0 26px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: filter .15s, transform .15s;
}
.ttp-track-btn:hover { filter: brightness(1.08); }
.ttp-track-btn:active { transform: scale(0.98); }
.ttp-track-btn:focus-visible, #ttp-tracking-input:focus-visible {
	outline: 2px solid var(--ttp-brass);
	outline-offset: 2px;
}

.ttp-message {
	max-width: 480px;
	margin: 16px auto 0;
	padding: 12px 16px;
	border-radius: 8px;
	background: rgba(214,95,95,0.15);
	color: #ffd7d7;
	font-size: 14px;
	position: relative;
	z-index: 1;
}
.ttp-message.is-loading {
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.85);
}

/* ---------- Result Card ---------- */
.ttp-result { margin-top: 24px; }

.ttp-card {
	background: #fff;
	border: 1px solid var(--ttp-border);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(11,29,51,0.06);
}

/* Manifest-style perforated status header */
.ttp-status-header {
	background: var(--ttp-ink);
	color: #fff;
	padding: 22px 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	position: relative;
}
.ttp-status-header::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -1px;
	height: 12px;
	background-image: radial-gradient(circle at center, transparent 5px, var(--ttp-ink) 5.5px);
	background-size: 20px 20px;
	background-position: 0 -8px;
}
.ttp-status-header-left { display: flex; align-items: center; gap: 12px; }
.ttp-status-dot {
	width: 12px; height: 12px; border-radius: 50%;
	background: var(--ttp-brass);
	box-shadow: 0 0 0 4px rgba(232,163,61,0.25);
	flex-shrink: 0;
}
.ttp-status-out_for_delivery .ttp-status-dot,
.ttp-status-in_transit .ttp-status-dot { background: var(--ttp-brass); box-shadow: 0 0 0 4px rgba(232,163,61,0.25); }
.ttp-status-delivered .ttp-status-dot { background: var(--ttp-success); box-shadow: 0 0 0 4px rgba(46,158,108,0.25); }
.ttp-status-exception .ttp-status-dot { background: var(--ttp-danger); box-shadow: 0 0 0 4px rgba(214,95,95,0.25); }

.ttp-status-label {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 19px;
	letter-spacing: -0.01em;
}
.ttp-status-number {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12.5px;
	color: rgba(255,255,255,0.6);
	margin-top: 2px;
	letter-spacing: 0.03em;
}
.ttp-eta-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.55); text-align: right; }
.ttp-eta-value { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; text-align: right; color: var(--ttp-brass); }

.ttp-print-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.25);
	color: #fff;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
	white-space: nowrap;
}
.ttp-print-btn:hover { background: rgba(255,255,255,0.18); }
.ttp-print-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.ttp-print-btn:focus-visible { outline: 2px solid var(--ttp-brass); outline-offset: 2px; }

.ttp-receipt-template { display: none; }

/* Progress steps */
.ttp-progress-track {
	display: flex;
	padding: 26px 28px 20px;
	gap: 4px;
}
.ttp-progress-step {
	flex: 1;
	text-align: center;
	position: relative;
}
.ttp-progress-step::before {
	content: "";
	position: absolute;
	top: 15px;
	left: -50%;
	width: 100%;
	height: 2px;
	background: var(--ttp-border);
	z-index: 0;
}
.ttp-progress-step:first-child::before { display: none; }
.ttp-progress-step.is-done::before { background: var(--ttp-brass); }
.ttp-progress-dot {
	width: 30px; height: 30px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ttp-border);
	color: var(--ttp-muted);
	display: flex; align-items: center; justify-content: center;
	margin: 0 auto 8px;
	font-size: 13px; font-weight: 600;
	position: relative; z-index: 1;
	font-family: 'Space Grotesk', sans-serif;
}
.ttp-progress-step.is-done .ttp-progress-dot {
	background: var(--ttp-brass);
	border-color: var(--ttp-brass);
	color: var(--ttp-ink);
}
.ttp-progress-label { font-size: 12px; color: var(--ttp-muted); font-weight: 500; }
.ttp-progress-step.is-done .ttp-progress-label { color: var(--ttp-ink); font-weight: 600; }

/* Map */
.ttp-map {
	height: 340px;
	margin: 4px 28px 24px;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--ttp-border);
	z-index: 0;
}
.ttp-leaflet-pulse {
	width: 18px; height: 18px;
	border-radius: 50%;
	background: var(--ttp-brass);
	box-shadow: 0 0 0 0 rgba(232,163,61,0.6);
	animation: ttp-pulse 2s infinite;
	border: 2px solid #fff;
}
@keyframes ttp-pulse {
	0% { box-shadow: 0 0 0 0 rgba(232,163,61,0.55); }
	70% { box-shadow: 0 0 0 14px rgba(232,163,61,0); }
	100% { box-shadow: 0 0 0 0 rgba(232,163,61,0); }
}
@media (prefers-reduced-motion: reduce) {
	.ttp-leaflet-pulse { animation: none; }
}

/* Info grid */
.ttp-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	background: var(--ttp-border);
	margin: 0 28px 24px;
	border: 1px solid var(--ttp-border);
	border-radius: 12px;
	overflow: hidden;
}
.ttp-panel { background: var(--ttp-paper); padding: 18px 20px; }
.ttp-panel h4 {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ttp-muted);
	margin: 0 0 12px;
}
.ttp-detail-list { list-style: none; margin: 0; padding: 0; }
.ttp-detail-list li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 7px 0;
	border-bottom: 1px dashed var(--ttp-border);
	font-size: 13.5px;
}
.ttp-detail-list li:last-child { border-bottom: none; }
.ttp-detail-list span { color: var(--ttp-muted); font-size: 11.5px; }
.ttp-detail-list strong { color: var(--ttp-ink); font-weight: 600; word-break: break-word; }

.ttp-comments {
	margin: 0 28px 24px;
	padding: 14px 18px;
	background: #FFF8EA;
	border-left: 3px solid var(--ttp-brass);
	border-radius: 8px;
	font-size: 13.5px;
	color: var(--ttp-ink);
}

/* Timeline */
.ttp-timeline { padding: 4px 28px 30px; }
.ttp-timeline h4 {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ttp-muted);
	margin: 0 0 16px;
}
.ttp-timeline-list { list-style: none; margin: 0; padding: 0; }
.ttp-timeline-item {
	position: relative;
	padding-left: 26px;
	padding-bottom: 22px;
	border-left: 2px solid var(--ttp-border);
	margin-left: 5px;
}
.ttp-timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.ttp-timeline-marker {
	position: absolute;
	left: -7px; top: 2px;
	width: 12px; height: 12px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--ttp-muted);
}
.ttp-timeline-item.is-latest .ttp-timeline-marker {
	background: var(--ttp-brass);
	border-color: var(--ttp-brass);
	box-shadow: 0 0 0 4px rgba(232,163,61,0.2);
}
.ttp-timeline-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ttp-timeline-top strong { font-size: 14px; }
.ttp-timeline-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ttp-muted); }
.ttp-timeline-location { font-size: 13px; color: var(--ttp-muted); margin-top: 2px; }
.ttp-timeline-note { font-size: 13px; color: var(--ttp-ink); margin-top: 4px; }

@media (max-width: 720px) {
	.ttp-grid { grid-template-columns: 1fr; }
	.ttp-search-card { padding: 30px 20px; }
	.ttp-search-form { flex-direction: column; }
	.ttp-progress-label { font-size: 10.5px; }
	.ttp-status-header { padding: 18px 20px; }
	.ttp-map { margin: 4px 16px 20px; height: 280px; }
	.ttp-grid, .ttp-comments, .ttp-timeline { margin-left: 16px; margin-right: 16px; }
}
