:root {
	--min-width: 800px;
	--max-content-width: 1300px;
	--top: 60px;

	--primary: #ff7c19;
	--primary-shimmer: #cf5c00;
	--secondary: #00aeef;

	--background: #e6e6e6;
	--background-secondary: #b3b3b3;
	--background-shimmer: #aaaaaa;

	--text-primary: #000000;
	--text-secondary: #141414;

	--white: #efefef;
	--black: #000000;

	--ripple: #666666;
	--good: #53bd39;
	--error: #f55442;

	/* Status colors */
	--status-pending: #ffa726;
	--status-pending-bg: #fff3e0;
	--status-pending-text: #e65100;

	--status-in-transit: #42a5f5;
	--status-in-transit-bg: #e3f2fd;
	--status-in-transit-text: #1565c0;

	--status-delivered: #66bb6a;
	--status-delivered-bg: #e8f5e8;
	--status-delivered-text: #2e7d32;

	--status-delayed: #ff7043;
	--status-delayed-bg: #fbe9e7;
	--status-delayed-text: #d84315;

	--status-cancelled: #ef5350;
	--status-cancelled-bg: #ffebee;
	--status-cancelled-text: #c62828;

	--status-hold: #ab47bc;
	--status-hold-bg: #f3e5f5;
	--status-hold-text: #7b1fa2;
}

html {
	color: var(--text-primary);
	background-color: var(--background);
	font-size: 1rem;
	font-family: sans-serif;
	scroll-behavior: smooth;
	scrollbar-color: var(--primary) transparent;
}

::-webkit-scrollbar {
	width: 3px;
	height: 3px;
}

::-webkit-scrollbar-thumb {
	background-color: var(--primary);
}

::selection {
	color: var(--black);
	background: var(--primary);
	text-shadow: none;
}

::-moz-selection {
	color: var(--black);
	background: var(--primary);
	text-shadow: none;
}

body {
	min-width: var(--min-width);
	margin: 0;
}

header {
	position: fixed;
	top: 0;
	width: calc(100% - 40px);
	min-width: calc(var(--min-width) - 80px);
	padding: 0 20px;
	color: var(--white);
	background-color: var(--primary);
	z-index: 10;
	-webkit-touch-callout: none; /* iOS Safari */
	-webkit-user-select: none; /* Safari */
	-khtml-user-select: none; /* Konqueror HTML */
	-moz-user-select: none; /* Old versions of Firefox */
	-ms-user-select: none; /* Internet Explorer/Edge */
	user-select: none; /* Non-prefixed version, currently
                                supported by Chrome, Edge, Opera and Firefox */
}

nav {
	white-space: nowrap;
}

header ul {
	display: flex;
	height: var(--top);
	align-items: center;
	column-gap: 20px;
	padding: 0;
	margin: 0 auto;
}

header li {
	display: inline-block;
}

header li[selected] a {
	background-color: var(--primary-shimmer);
}

header li a,
header li label.header {
	position: relative;
	display: block;
	height: var(--top);
	line-height: var(--top);
	padding: 0 20px;
	font-weight: 700;
	color: var(--white);
	text-decoration: none;
	z-index: 2;
	transition: background-color 0.2s;
	cursor: pointer;
}

header li a:hover,
header li label.header:hover {
	background-color: var(--primary-shimmer);
}

header li a img {
	display: block;
	height: 100%;
}

header li button {
	padding: 0;
}

header li.account {
	font-size: 0.8em;
}

header li.account button {
	position: relative;
	display: flex;
	width: 32px;
	gap: 10px;
	color: var(--white);
	font-weight: bold;
	align-items: center;
	overflow-x: hidden;
	transition: width 0.1s;
	z-index: 10001;
}

header li.account:hover button {
	width: 195px;
}

header li.account:hover ul {
	display: block;
	visibility: visible;
	opacity: 1;
	top: -6px;
}

header li.account ul {
	display: block;
	position: absolute;
	top: -100%;
	right: 10px;
	width: 220px;
	opacity: 0;
	visibility: hidden;
	padding: calc(40px + 2em) 0 0 0;
	background-color: var(--primary);
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	transition:
		top 0.3s,
		opacity 0.3s;
	z-index: 10000;
}

header li.account ul li {
	display: block;
}

header li.account ul li a {
	display: flex;
	gap: 10px;
	align-items: center;
}

header li.account ul li:last-child a {
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
}

header li.account ul li a:hover {
	background-color: var(--primary-shimmer);
}

header li.account img-container {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: var(--primary-shimmer);
}

header li.account a[type="add-profile"] img-container {
	background-image: url(/icons/add.svg);
	background-color: var(--ripple);
	background-position: center;
	background-size: 50%;
	background-repeat: no-repeat;
	border-radius: 50%;
}

header li.account img {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	opacity: 0;
}

header li.account img.show {
	opacity: 1;
}

header img[src=""],
header li.account img:not([src]) {
	display: none;
}

header li button {
	display: block;
	background-color: transparent;
	border: none;
	z-index: 2;
	cursor: pointer;
}

header li.hide {
	display: none;
}

header li button svg {
	display: block;
	width: 24px;
	height: 24px;
	fill: var(--text-primary);
}

alert {
	position: fixed;
	top: 60px;
	display: none;
	width: 100%;
	height: calc(1.6em + 10px);
	line-height: calc(1.6em + 10px);
	color: var(--background);
	background-color: var(--good);
	font-weight: bold;
	text-align: center;
	z-index: 10;
}

alert:not(:empty) {
	display: block;
}

divider {
	display: block;
	width: 100%;
	height: 1px;
	background-color: var(--primary-shimmer);
}

filler {
	flex: 1 1 1e-9px;
}

form {
	margin: 0;
}

input[type="checkbox"] {
	display: none;
}

section {
	display: block;
	position: relative;
	top: var(--top);
	width: 100%;
	min-width: var(--min-width);
	min-height: calc(100vh - var(--top));
	align-items: start;
	color: var(--text-secondary);
	line-height: 1.6rem;
}

/* Adjust section top when search bar is present */
header:has(.header-search) + section,
header:has(.header-search) ~ section {
	top: calc(var(--top) + 52px); /* 60px + 8px padding + 36px search bar + 8px padding */
	min-height: calc(100vh - calc(var(--top) + 52px));
}

footer {
	position: relative;
	display: flex;
	top: var(--top);
	width: calc(100% - 80px);
	min-width: calc(var(--min-width) - 80px);
	padding: 80px 40px 20px 40px;
	font-size: 1rem;
	background-color: var(--text-secondary);
	border-top: solid 3px var(--secondary);
	align-items: center;
	flex-direction: column;
}

/* Adjust footer top when search bar is present */
header:has(.header-search) ~ footer {
	top: calc(var(--top) + 52px);
}

footer nav {
	display: flex;
	width: 100%;
	max-width: var(--max-content-width);
	margin-bottom: 60px;
}

footer nav div {
	flex: 1;
}

footer nav > a {
	flex: 1;
}

footer nav > a img {
	width: 100%;
	height: 100px;
}

footer nav div[type="social"] {
	display: flex;
	gap: 20px;
}

footer nav div[type="social"] svg {
	display: block;
	width: 40px;
	height: 40px;
	fill: var(--background);
	transition: fill 0.3s;
}

footer nav div[type="social"] a:hover svg {
	fill: var(--primary);
}

footer title {
	display: block;
	color: var(--background);
	font-weight: bold;
	margin-bottom: 10px;
}

footer ul {
	display: block;
	padding: 0;
	margin: 0 auto;
}

footer li {
	display: block;
	padding: 2px 0;
}

footer li a {
	font-size: 0.8rem;
	color: var(--background-secondary);
	text-decoration: none;
	transition: color 0.3s;
	cursor: pointer;
}

footer li a:hover {
	color: var(--primary);
}

footer year {
	display: block;
	width: 100%;
	max-width: var(--max-content-width);
	height: 30px;
	padding-top: 20px;
	color: var(--white);
	border-top: solid 1px var(--secondary);
	line-height: 30px;
	font-size: 0.8rem;
}

footer year span {
	color: var(--primary);
}

section > svg {
	display: none;
	width: 250px;
	height: 50px;
	margin: 60px auto;
	fill: var(--background-shimmer);
}

section[loading] > svg {
	display: block;
}

.header-search {
	display: flex;
	justify-content: center;
	padding: 8px 0;
	border-top: 1px solid var(--primary-shimmer);
}

/* Remove border from search input on shipment page */
body[data-page="shipment"] .header-search,
body[data-page="tracking"] .header-search {
	border-top: none;
}

.search-container {
	position: relative;
	width: 100%;
	max-width: none;
}

.search-input-wrapper {
	display: flex;
	align-items: center;
	background-color: var(--white);
	border-radius: 20px;
	padding: 6px 15px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	height: 36px;
}

.search-icon {
	width: 18px;
	height: 18px;
	fill: var(--text-secondary);
	margin-right: 10px;
}

.search-input {
	flex: 1;
	border: none !important;
	outline: none;
	background: transparent;
	color: var(--text-primary);
	font-size: 13px;
}

.search-input:focus {
	border: none !important;
	outline: none;
	box-shadow: none;
}

.search-input::placeholder {
	color: var(--text-primary);
	opacity: 0.6;
}

.search-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background-color: var(--white);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	margin-top: 5px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s ease;
	z-index: 1000;
}

.search-dropdown.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.search-options {
	padding: 8px 0;
}

.search-option {
	padding: 10px 15px;
	cursor: pointer;
	transition: background-color 0.2s;
	color: var(--text-primary);
}

.search-option:hover {
	background-color: var(--background-secondary);
}

.search-option.selected {
	background-color: var(--primary);
	color: var(--white);
}

.search-option span {
	font-size: 14px;
}

.search-results-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background-color: var(--white);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	margin-top: 5px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px) scale(0.95);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1000;
	max-height: 300px;
	overflow: hidden;
}

.search-results-dropdown.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.search-results-content {
	max-height: 300px;
	overflow-y: auto;
	padding: 0;
}

.search-result-item {
	display: flex;
	align-items: flex-start;
	padding: 16px 15px;
	border-bottom: 1px solid var(--background-secondary);
	cursor: pointer;
	transition: background-color 0.2s;
	gap: 12px;
}

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

.search-result-item:hover {
	background-color: var(--background-secondary);
}

.search-result-item:hover .search-result-icon-wrapper {
	background-color: rgba(255, 124, 25, 0.2);
	transform: scale(1.05);
}

.search-result-item:hover .search-result-icon {
	fill: var(--primary-shimmer);
}

.search-result-item.selected {
	background-color: var(--primary);
	color: var(--white);
}

.search-result-item.selected:hover {
	background-color: var(--primary-shimmer);
}

.search-result-icon-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background-color: rgba(255, 124, 25, 0.1);
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.search-result-item.selected .search-result-icon-wrapper {
	background-color: rgba(255, 255, 255, 0.2);
}

.search-result-icon {
	width: 18px;
	height: 18px;
	fill: var(--primary);
	transition: fill 0.2s ease;
}

.search-result-item.selected .search-result-icon {
	fill: var(--white);
}

.search-result-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.search-result-title {
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-primary);
	line-height: 1.2;
}

.search-result-item.selected .search-result-title {
	color: var(--white);
}

.search-result-subtitle {
	font-size: 12px;
	color: var(--text-primary);
	opacity: 0.7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.2;
}

.search-result-item.selected .search-result-subtitle {
	color: rgba(255, 255, 255, 0.8);
}

.search-result-details {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 2px;
}

.search-result-type-badge {
	font-size: 10px;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--primary);
	background-color: rgba(255, 124, 25, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid rgba(255, 124, 25, 0.3);
	letter-spacing: 0.5px;
}

.search-result-item.selected .search-result-type-badge {
	background-color: rgba(255, 255, 255, 0.2);
	color: var(--white);
	border-color: rgba(255, 255, 255, 0.3);
}

.search-result-status {
	font-size: 10px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 12px;
	border: 1px solid;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	white-space: nowrap;
}

.search-result-item.selected .search-result-status {
	background-color: rgba(255, 255, 255, 0.2) !important;
	color: var(--white) !important;
	border-color: rgba(255, 255, 255, 0.3) !important;
}

.no-results {
	padding: 20px;
	text-align: center;
	color: var(--text-primary);
	opacity: 0.8;
	font-size: 14px;
}

.search-results-content::-webkit-scrollbar {
	width: 4px;
}

.search-results-content::-webkit-scrollbar-track {
	background: transparent;
}

.search-results-content::-webkit-scrollbar-thumb {
	background-color: var(--background-secondary);
	border-radius: 2px;
}

.search-results-content::-webkit-scrollbar-thumb:hover {
	background-color: var(--primary);
}

.print-invoice-btn {
	background: var(--primary);
	color: var(--white);
	border: none;
	border-radius: 5px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.2s ease;
}

.print-invoice-btn:hover {
	background: var(--primary-shimmer);
}

.print-invoice-btn:active {
	transform: translateY(1px);
}
