/* FreightXO HTS Lookup — styled to match the FreightXO tool brand system */

.fxo-hts {
	--fxo-ink: #0B0B0F;
	--fxo-white: #FFFFFF;
	--fxo-blue: #1858D8;
	--fxo-blue-dark: #14294D;
	--fxo-blue-light: #A8CBEC;
	--fxo-grey: #6B6B76;
	--fxo-red: #C0392B;

	--fxo-font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
	--fxo-font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--fxo-font-mono: 'IBM Plex Mono', 'Courier New', monospace;

	max-width: 900px;
	margin: 0 auto;
	padding: 32px 20px 64px;
	color: var(--fxo-ink);
	font-family: var(--fxo-font-body);
	box-sizing: border-box;
}

.fxo-hts *,
.fxo-hts *::before,
.fxo-hts *::after {
	box-sizing: inherit;
}

/* ---------- Header ---------- */

.fxo-hts-header {
	margin-bottom: 32px;
}

.fxo-hts-header h1 {
	font-family: var(--fxo-font-display);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	font-size: clamp(32px, 6vw, 52px);
	line-height: 0.98;
	margin: 0 0 12px;
	color: var(--fxo-ink);
}

.fxo-hts-header h1 .fxo-hts-accent {
	color: var(--fxo-blue);
}

.fxo-hts-sub {
	font-size: 16px;
	color: var(--fxo-grey);
	max-width: 60ch;
	margin: 0;
	line-height: 1.5;
}

/* ---------- Country toggle (matches the brand's existing .toggle pattern) ---------- */

.fxo-hts .toggle {
	display: flex;
	border: 2px solid var(--fxo-ink);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 24px;
	width: fit-content;
}

.fxo-hts .toggle button {
	background: var(--fxo-white);
	color: var(--fxo-ink);
	border: none;
	padding: 7px 20px;
	font-family: var(--fxo-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	cursor: pointer;
	flex: 1;
}

.fxo-hts .toggle button.active {
	background: var(--fxo-blue);
	color: var(--fxo-white);
}

.fxo-hts .toggle button:first-child {
	border-right: 2px solid var(--fxo-ink);
}

.fxo-hts .toggle button:focus-visible {
	outline: 3px solid var(--fxo-blue);
	outline-offset: 2px;
}

/* ---------- Explainer ---------- */

.fxo-hts-explainer {
	margin-bottom: 32px;
}

.fxo-hts-explainer h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--fxo-font-display);
	font-weight: 700;
	text-transform: uppercase;
	font-size: 22px;
	margin: 0 0 16px;
}

.fxo-hts-marker {
	display: inline-block;
	width: 14px;
	height: 14px;
	background: var(--fxo-blue);
	flex-shrink: 0;
}

.fxo-hts-explainer-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.fxo-hts-explainer-col {
	border: 3px solid var(--fxo-ink);
	background: var(--fxo-white);
	padding: 16px;
}

.fxo-hts-tag {
	display: inline-block;
	font-family: var(--fxo-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: 2px solid var(--fxo-ink);
	padding: 3px 8px;
	margin-bottom: 10px;
}

.fxo-hts-explainer-col p {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--fxo-ink);
}

.fxo-hts-explainer-note {
	font-family: var(--fxo-font-mono);
	font-size: 12.5px;
	color: var(--fxo-grey);
	margin: 12px 2px 0;
}

/* ---------- Panels (shared) ---------- */

.fxo-hts .panel {
	border: 3px solid var(--fxo-ink);
	background: var(--fxo-white);
	box-shadow: 6px 6px 0 var(--fxo-ink);
}

/* ---------- Search ---------- */

.fxo-hts-search {
	padding: 20px;
	margin-bottom: 40px;
}

.fxo-hts-search label {
	display: block;
	font-family: var(--fxo-font-mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fxo-grey);
	margin-bottom: 10px;
}

.fxo-hts-search-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.fxo-hts-search-row input[type="text"] {
	flex: 1 1 260px;
	font-family: var(--fxo-font-mono);
	font-size: 16px;
	padding: 12px 14px;
	border: 2px solid var(--fxo-ink);
	background: var(--fxo-white);
	color: var(--fxo-ink);
	outline: none;
}

.fxo-hts-search-row input[type="text"]:focus-visible {
	outline: 3px solid var(--fxo-blue);
	outline-offset: 2px;
}

.fxo-hts-search-row button {
	font-family: var(--fxo-font-display);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 16px;
	padding: 12px 26px;
	background: var(--fxo-blue);
	color: var(--fxo-white);
	border: 2px solid var(--fxo-ink);
	cursor: pointer;
	transition: transform 0.08s ease;
}

.fxo-hts-search-row button:hover {
	background: var(--fxo-blue-dark);
}

.fxo-hts-search-row button:active {
	transform: translateY(1px);
}

.fxo-hts-search-row button:focus-visible {
	outline: 3px solid var(--fxo-ink);
	outline-offset: 2px;
}

.fxo-hts-search-row button[disabled] {
	opacity: 0.6;
	cursor: default;
}

.fxo-hts-examples {
	margin-top: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.fxo-hts-examples-label {
	font-family: var(--fxo-font-mono);
	font-size: 12px;
	color: var(--fxo-grey);
	margin-right: 2px;
}

.fxo-hts-chip {
	font-family: var(--fxo-font-mono);
	font-size: 12.5px;
	background: var(--fxo-white);
	border: 2px solid var(--fxo-ink);
	padding: 5px 10px;
	cursor: pointer;
	color: var(--fxo-ink);
}

.fxo-hts-chip:hover {
	background: var(--fxo-blue-light);
}

.fxo-hts-chip:focus-visible {
	outline: 3px solid var(--fxo-blue);
	outline-offset: 2px;
}

/* ---------- Status / loading / errors ---------- */

.fxo-hts-status {
	font-family: var(--fxo-font-mono);
	font-size: 14px;
	color: var(--fxo-grey);
	min-height: 0;
	margin-bottom: 12px;
}

.fxo-hts-status.is-loading {
	color: var(--fxo-blue-dark);
}

.fxo-hts-status.is-error {
	color: var(--fxo-red);
	font-weight: 600;
}

/* ---------- Results ---------- */

.fxo-hts-results {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.fxo-hts-result {
	border: 3px solid var(--fxo-ink);
	background: var(--fxo-white);
	box-shadow: 6px 6px 0 var(--fxo-ink);
	padding: 16px 18px;
}

.fxo-hts-result-top {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 8px;
}

.fxo-hts-code {
	font-family: var(--fxo-font-mono);
	font-weight: 600;
	font-size: 19px;
	color: var(--fxo-blue-dark);
	background: var(--fxo-blue-light);
	padding: 2px 8px;
}

.fxo-hts-hs-root {
	font-family: var(--fxo-font-mono);
	font-size: 12.5px;
	color: var(--fxo-grey);
}

.fxo-hts-copy {
	margin-left: auto;
	font-family: var(--fxo-font-mono);
	font-size: 11.5px;
	background: none;
	border: 2px solid var(--fxo-ink);
	padding: 3px 8px;
	cursor: pointer;
	color: var(--fxo-ink);
}

.fxo-hts-copy:hover {
	background: var(--fxo-blue-light);
}

.fxo-hts-description {
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 12px;
}

.fxo-hts-units {
	font-family: var(--fxo-font-mono);
	font-size: 12px;
	color: var(--fxo-grey);
	margin: 0 0 12px;
}

.fxo-hts-rates {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
}

.fxo-hts-rate {
	border: 2px solid var(--fxo-ink);
	padding: 8px 10px;
}

.fxo-hts-rate-label {
	display: flex;
	align-items: center;
	gap: 4px;
	font-family: var(--fxo-font-mono);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fxo-grey);
	margin-bottom: 4px;
}

/* ---------- Tooltip (hover "i") ---------- */

.fxo-hts-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 13px;
	height: 13px;
	margin-left: 5px;
	border-radius: 50%;
	border: 1.5px solid var(--fxo-grey);
	color: var(--fxo-grey);
	font-family: var(--fxo-font-mono);
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	cursor: help;
	flex-shrink: 0;
	vertical-align: middle;
}

.fxo-hts-tip::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 130%;
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: 220px;
	white-space: normal;
	background: var(--fxo-ink);
	color: var(--fxo-white);
	font-family: var(--fxo-font-body);
	font-size: 11.5px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.4;
	padding: 8px 10px;
	border-radius: 3px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
	z-index: 5;
	pointer-events: none;
}

.fxo-hts-tip:hover::after,
.fxo-hts-tip:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

.fxo-hts-tip:focus-visible {
	outline: 2px solid var(--fxo-blue);
	outline-offset: 2px;
}

.fxo-hts-rate-value {
	display: block;
	font-family: var(--fxo-font-mono);
	font-size: 13.5px;
	color: var(--fxo-ink);
	word-break: break-word;
}

.fxo-hts-rate-value.is-empty {
	color: var(--fxo-grey);
}

.fxo-hts-footnotes {
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--fxo-blue-light);
	font-size: 12.5px;
	color: var(--fxo-grey);
	line-height: 1.5;
}

/* Category heading rows (no rate of their own — group context only) */

.fxo-hts-result.is-heading {
	box-shadow: none;
	border: 1px solid var(--fxo-blue-light);
	background: transparent;
	padding: 10px 14px;
}

.fxo-hts-result.is-heading .fxo-hts-code {
	background: transparent;
	color: var(--fxo-grey);
	font-size: 13.5px;
	padding: 0;
}

.fxo-hts-result.is-heading .fxo-hts-description {
	font-size: 13.5px;
	color: var(--fxo-grey);
	margin: 4px 0 0;
	font-style: italic;
}

/* ---------- U.S. fee strip (MPF/HMF — shown once per search, not per result) ---------- */

.fxo-hts-fee-strip {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	border: 2px solid var(--fxo-ink);
	background: var(--fxo-blue-light);
	padding: 8px 12px;
	margin-bottom: 14px;
	font-family: var(--fxo-font-mono);
	font-size: 11px;
	letter-spacing: 0.03em;
	color: var(--fxo-blue-dark);
}

.fxo-hts-fee-label {
	font-weight: 700;
	text-transform: uppercase;
}

.fxo-hts-fee-item {
	display: flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}

.fxo-hts-fee-strip .fxo-hts-tip {
	border-color: var(--fxo-blue-dark);
	color: var(--fxo-blue-dark);
}

/* ---------- Empty / no results ---------- */

.fxo-hts-empty {
	font-family: var(--fxo-font-mono);
	font-size: 14px;
	color: var(--fxo-grey);
	padding: 20px 0;
}

/* ---------- Disclaimer (matches the site-wide .foot pattern) ---------- */

.fxo-hts-foot {
	margin-top: 28px;
	margin-bottom: 0;
	font-size: 11px;
	color: var(--fxo-grey);
	font-family: var(--fxo-font-mono);
	letter-spacing: 1px;
	text-align: center;
}

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

@media (max-width: 640px) {
	.fxo-hts-explainer-grid {
		grid-template-columns: 1fr;
	}

	.fxo-hts-rates {
		grid-template-columns: 1fr;
	}

	.fxo-hts-search-row button {
		flex: 1 1 100%;
	}

	.fxo-hts-copy {
		margin-left: 0;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.fxo-hts * {
		transition: none !important;
	}
}
