:root {
	--bg: #0d1117;
	--bg-card: #161b22;
	--bg-elevated: #21262d;
	--fg: #f0f6fc;
	--fg-muted: #8b949e;
	--fg-subtle: #6e7681;
	--accent: #3b82f6;
	--accent-glow: rgba(59, 130, 246, 0.25);
	--accent-hover: #2563eb;
	--border: #30363d;
	--border-light: #484f58;
	--google-blue: #4285F4;
	--google-green: #34A853;
	--google-yellow: #FBBC05;
	--google-red: #EA4335;
	--usps-blue: #004B87;
	--fedex-purple: #4D148C;
	--dhl-yellow: #FFCC00;
	--success: #238636;
	--success-bg: rgba(35, 134, 54, 0.15);
	--danger: #f85149;
	--danger-bg: rgba(248, 81, 73, 0.15);
	--radius-sm: 6px;
	--radius: 12px;
	--radius-lg: 16px;
	--radius-full: 9999px;
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space: 1rem;
	--space-md: 1.5rem;
	--space-lg: 2rem;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	--shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f6f8fa;
		--bg-card: #ffffff;
		--bg-elevated: #f0f3f6;
		--fg: #1f2328;
		--fg-muted: #59636e;
		--fg-subtle: #8c959f;
		--accent: #0969da;
		--accent-glow: rgba(9, 105, 218, 0.15);
		--accent-hover: #0854ad;
		--border: #d0d7de;
		--border-light: #e1e4e8;
		--shadow-sm: 0 1px 3px rgba(31, 35, 40, 0.1);
		--shadow: 0 4px 12px rgba(31, 35, 40, 0.12);
		--shadow-lg: 0 12px 28px rgba(31, 35, 40, 0.18);
	}
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* Base Utility Classes */
.shell {
	max-width: 78rem;
	margin: 0 auto;
	padding: 0 var(--space);
}

.stack {
	display: flex;
	flex-direction: column;
	gap: var(--space);
}

.row {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	flex-wrap: wrap;
}

.grid {
	display: grid;
	gap: var(--space);
	grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
}

/* Button & Controls */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.6rem 1.1rem;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: #ffffff;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease-in-out;
	text-decoration: none;
	user-select: none;
}

.btn:hover {
	background: var(--accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px var(--accent-glow);
}

.btn:active {
	transform: translateY(0);
}

.btn-secondary {
	background: var(--bg-elevated);
	color: var(--fg);
	border-color: var(--border);
}

.btn-secondary:hover {
	background: var(--border);
	border-color: var(--border-light);
	box-shadow: none;
}

.btn-outline {
	background: transparent;
	color: var(--accent);
	border-color: var(--accent);
}

.btn-outline:hover {
	background: var(--accent-glow);
}

.btn-success {
	background: var(--success);
	color: #fff;
}
.btn-success:hover {
	background: #2ea043;
}

.btn-sm {
	padding: 0.35rem 0.65rem;
	font-size: 0.8rem;
}

.btn-lg {
	padding: 0.8rem 1.5rem;
	font-size: 1rem;
	border-radius: var(--radius);
}

.btn-icon {
	padding: 0.5rem;
	border-radius: var(--radius-sm);
}

.input, .select, .textarea {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-card);
	color: var(--fg);
	font-family: inherit;
	font-size: 0.925rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .select:focus, .textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-glow);
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--fg-muted);
}

.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-md);
	box-shadow: var(--shadow-sm);
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.6rem;
	border-radius: var(--radius-full);
	font-size: 0.775rem;
	font-weight: 600;
	line-height: 1.2;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	color: var(--fg-muted);
}

.badge-blue {
	background: rgba(66, 133, 244, 0.15);
	color: #60a5fa;
	border-color: rgba(66, 133, 244, 0.3);
}

.badge-green {
	background: var(--success-bg);
	color: #34d399;
	border-color: rgba(52, 211, 153, 0.3);
}

.badge-yellow {
	background: rgba(251, 188, 5, 0.15);
	color: #fbbf24;
	border-color: rgba(251, 188, 5, 0.3);
}

.badge-purple {
	background: rgba(168, 85, 247, 0.15);
	color: #c084fc;
	border-color: rgba(168, 85, 247, 0.3);
}

/* Header & Navigation */
.header-bar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(22, 27, 34, 0.85);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	padding: 0.75rem 0;
}

@media (prefers-color-scheme: light) {
	.header-bar {
		background: rgba(255, 255, 255, 0.88);
	}
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space);
}

.brand-logo {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	text-decoration: none;
	color: var(--fg);
	font-weight: 800;
	font-size: 1.25rem;
	letter-spacing: -0.02em;
	cursor: pointer;
}

.brand-icon {
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: linear-gradient(135deg, #3b82f6, #8b5cf6);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.nav-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.8rem;
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--fg-muted);
	border: 1px solid transparent;
	background: transparent;
	cursor: pointer;
	transition: all 0.15s;
}

.nav-tab:hover {
	color: var(--fg);
	background: var(--bg-elevated);
}

.nav-tab.active {
	color: var(--accent);
	background: var(--accent-glow);
	border-color: rgba(59, 130, 246, 0.3);
	font-weight: 600;
}

/* Hero Section */
.hero-section {
	background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15), transparent 70%), var(--bg);
	border-bottom: 1px solid var(--border);
	padding: 2.5rem 0 2rem;
	text-align: center;
}

.hero-title {
	font-size: clamp(2rem, 4.5vw, 3.2rem);
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: -0.03em;
	margin: 0 0 0.8rem;
	background: linear-gradient(135deg, #ffffff 40%, #93c5fd 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

@media (prefers-color-scheme: light) {
	.hero-title {
		background: linear-gradient(135deg, #111827 40%, #2563eb 100%);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
	}
}

.hero-subtitle {
	font-size: 1.1rem;
	color: var(--fg-muted);
	max-width: 44rem;
	margin: 0 auto 1.5rem;
}

.trust-badges {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.2rem;
	flex-wrap: wrap;
}

.trust-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.35rem 0.85rem;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-full);
	font-size: 0.825rem;
	font-weight: 500;
}

/* Product Card */
.product-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
	transform: translateY(-4px);
	border-color: var(--accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.product-image-container {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: var(--bg-elevated);
	overflow: hidden;
}

.product-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.product-card:hover .product-image {
	transform: scale(1.05);
}

.product-source-badge {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	background: rgba(13, 17, 23, 0.85);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	padding: 0.25rem 0.55rem;
	border-radius: var(--radius-full);
	font-size: 0.725rem;
	font-weight: 600;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.product-body {
	padding: 1rem;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.6rem;
}

.product-title {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.product-desc {
	font-size: 0.85rem;
	color: var(--fg-muted);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.45;
}

.price-row {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin-top: auto;
}

.current-price {
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--fg);
}

.original-price {
	font-size: 0.9rem;
	color: var(--fg-subtle);
	text-decoration: line-through;
}

/* Google Address Box & Verification */
.google-verified-box {
	background: rgba(52, 168, 83, 0.08);
	border: 1px solid rgba(52, 168, 83, 0.3);
	border-radius: var(--radius);
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.google-logo-text {
	font-weight: 800;
	letter-spacing: -0.02em;
}

.autocomplete-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 40;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-top: 4px;
	box-shadow: var(--shadow-lg);
	max-height: 240px;
	overflow-y: auto;
}

.autocomplete-item {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	transition: background 0.12s;
}

.autocomplete-item:last-child {
	border-bottom: none;
}

.autocomplete-item:hover {
	background: var(--bg-elevated);
}

/* Postal Rate Options */
.postal-rate-card {
	background: var(--bg-card);
	border: 2px solid var(--border);
	border-radius: var(--radius);
	padding: 0.9rem 1rem;
	cursor: pointer;
	transition: all 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.postal-rate-card:hover {
	border-color: var(--border-light);
	background: var(--bg-elevated);
}

.postal-rate-card.selected {
	border-color: var(--accent);
	background: var(--accent-glow);
}

/* Shipping Label Simulator */
.shipping-label-preview {
	background: #ffffff;
	color: #000000;
	border: 2px dashed #000000;
	border-radius: 8px;
	padding: 1.25rem;
	font-family: 'Courier New', Courier, monospace;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
	max-width: 28rem;
	margin: 0 auto;
}

/* Modal Overlay */
.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	overflow-y: auto;
}

.modal-content {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	width: 100%;
	max-width: 44rem;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: var(--shadow-lg);
	padding: 1.5rem;
	position: relative;
}

/* Tracking Timeline */
.timeline {
	position: relative;
	padding-left: 2rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.timeline::before {
	content: '';
	position: absolute;
	top: 0.5rem;
	bottom: 0.5rem;
	left: 0.6rem;
	width: 2px;
	background: var(--border);
}

.timeline-step {
	position: relative;
}

.timeline-dot {
	position: absolute;
	left: -2rem;
	top: 0.15rem;
	width: 1.3rem;
	height: 1.3rem;
	border-radius: 50%;
	background: var(--bg-card);
	border: 2px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
}

.timeline-step.completed .timeline-dot {
	background: var(--success);
	border-color: var(--success);
	color: #fff;
}

.timeline-step.active .timeline-dot {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
	box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Alert & Utility */
.alert {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
}

.alert-error {
	background: var(--danger-bg);
	border-color: rgba(248, 81, 73, 0.4);
	color: var(--danger);
}

.alert-success {
	background: var(--success-bg);
	border-color: rgba(35, 134, 54, 0.4);
	color: #3fb950;
}

.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 2rem;
	color: var(--fg-muted);
}

.spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.empty {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--fg-muted);
}

.empty-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--fg);
	margin-bottom: 0.4rem;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
	.header-container {
		flex-direction: column;
		align-items: stretch;
	}
	.nav-links {
		overflow-x: auto;
		padding-bottom: 0.25rem;
	}
	.hero-title {
		font-size: 1.85rem;
	}
	.modal-content {
		padding: 1rem;
	}
}
