/**
 * Golden Light — Orders, Invoices & Tracking
 */

/* View order page */
.gl-view-order__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.gl-view-order__intro {
	color: var(--gl-gray);
	margin-bottom: 1.5rem;
}

.gl-view-order__details,
.gl-view-order__notes {
	margin-top: 2rem;
}

.gl-view-order__details h3,
.gl-order-timeline h3 {
	font-size: 1.125rem;
	margin-bottom: 1rem;
}

/* Tracking progress bar */
.gl-order-tracking {
	margin-bottom: 2rem;
}

.gl-order-tracking__bar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0;
	padding: 1.5rem 1rem;
	background: var(--gl-bg);
	border: 1px solid rgba(201, 169, 98, 0.15);
	border-radius: var(--gl-radius-lg);
	overflow-x: auto;
}

.gl-order-tracking__step {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 72px;
	flex: 1;
}

.gl-order-tracking__icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid rgba(201, 169, 98, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.5rem;
	background: var(--gl-white);
	transition: all 0.25s ease;
}

.gl-order-tracking__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(201, 169, 98, 0.35);
}

.gl-order-tracking__step.is-done .gl-order-tracking__icon {
	border-color: var(--gl-gold);
	background: rgba(201, 169, 98, 0.12);
}

.gl-order-tracking__step.is-done .gl-order-tracking__dot {
	background: var(--gl-gold);
}

.gl-order-tracking__step.is-active .gl-order-tracking__icon {
	border-color: var(--gl-gold);
	background: var(--gl-gold);
	box-shadow: 0 0 0 4px rgba(201, 169, 98, 0.2);
}

.gl-order-tracking__step.is-active .gl-order-tracking__dot {
	background: var(--gl-white);
}

.gl-order-tracking__label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--gl-charcoal);
	line-height: 1.4;
}

.gl-order-tracking__step:not(.is-done):not(.is-active) .gl-order-tracking__label {
	color: var(--gl-gray);
}

.gl-order-tracking__date {
	font-size: 0.6875rem;
	color: var(--gl-gray);
	margin-top: 0.25rem;
}

.gl-order-tracking__line {
	flex: 1;
	height: 2px;
	background: rgba(201, 169, 98, 0.2);
	margin-top: 18px;
	min-width: 16px;
}

.gl-order-tracking__line.is-done {
	background: var(--gl-gold);
}

.gl-order-tracking__code {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.04));
	border: 1px solid rgba(59, 130, 246, 0.2);
	border-radius: var(--gl-radius);
}

.gl-order-tracking__code code {
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #2563eb;
	background: transparent;
	padding: 0;
}

/* Timeline */
.gl-order-timeline {
	margin-bottom: 2rem;
}

.gl-order-timeline__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gl-order-timeline__item {
	display: flex;
	gap: 1rem;
	padding-bottom: 1.25rem;
	position: relative;
}

.gl-order-timeline__item:not(:last-child)::before {
	content: '';
	position: absolute;
	right: 7px;
	top: 20px;
	bottom: 0;
	width: 2px;
	background: rgba(201, 169, 98, 0.2);
}

.gl-order-timeline__dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--gl-gold);
	flex-shrink: 0;
	margin-top: 3px;
}

.gl-order-timeline__item--tracking .gl-order-timeline__dot {
	background: #2563eb;
}

.gl-order-timeline__content p {
	margin: 0 0 0.25rem;
	font-size: 0.9375rem;
}

.gl-order-timeline__content time {
	font-size: 0.8125rem;
	color: var(--gl-gray);
}

/* Orders list enhancements */
.gl-orders-table .gl-tracking-code {
	font-size: 0.875rem;
	font-weight: 600;
	color: #2563eb;
	background: rgba(59, 130, 246, 0.08);
	padding: 0.2rem 0.5rem;
	border-radius: 4px;
}

.gl-order-status--processing,
.gl-order-status--on-hold {
	background: rgba(234, 179, 8, 0.15);
	color: #a16207;
}

.gl-order-status--completed {
	background: rgba(34, 197, 94, 0.15);
	color: #15803d;
}

.gl-order-status--cancelled,
.gl-order-status--failed,
.gl-order-status--refunded {
	background: rgba(239, 68, 68, 0.12);
	color: #b91c1c;
}

/* Print styles — invoice */
@media screen {
	body.gl-print {
		background: #e5e7eb;
		padding: 2rem;
		font-family: var(--gl-font, Peyda, Tahoma, sans-serif);
	}
}

@media print {
	body.gl-print {
		padding: 0;
		background: #fff;
	}
	@page {
		margin: 12mm;
	}
}

.gl-invoice {
	max-width: 900px;
	margin: 0 auto;
	background: #fff;
	padding: 2rem;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

@media print {
	.gl-invoice {
		box-shadow: none;
		padding: 0;
		max-width: none;
	}
}

.gl-invoice__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 1.5rem;
}

.gl-invoice__logo {
	max-height: 48px;
	width: auto;
}

.gl-invoice__meta p {
	margin: 0 0 0.35rem;
	font-size: 0.875rem;
}

.gl-invoice__barcode {
	margin-top: 0.75rem;
	padding: 0.5rem 1rem;
	background: #f3f4f6;
	font-family: monospace;
	font-size: 1.25rem;
	letter-spacing: 0.15em;
	text-align: center;
	border: 1px dashed #d1d5db;
}

.gl-invoice__parties {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.gl-invoice__party {
	padding: 1rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.gl-invoice__party h3 {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	color: #374151;
}

.gl-invoice__party p {
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
	line-height: 1.6;
}

.gl-invoice__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.8125rem;
	margin-bottom: 1.5rem;
}

.gl-invoice__table th,
.gl-invoice__table td {
	border: 1px solid #e5e7eb;
	padding: 0.5rem 0.65rem;
	text-align: center;
}

.gl-invoice__table th {
	background: #f3f4f6;
	font-weight: 700;
}

.gl-invoice__table td:nth-child(3) {
	text-align: right;
}

.gl-invoice__totals {
	margin-right: auto;
	max-width: 320px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}

.gl-invoice__totals p {
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	border-bottom: 1px solid #e5e7eb;
}

.gl-invoice__totals p:last-child {
	border-bottom: none;
}

.gl-invoice__final {
	background: #f3f4f6;
	font-weight: 700;
	font-size: 1rem !important;
}

/* Shipping label */
.gl-shipping-label {
	max-width: 420px;
	margin: 0 auto;
	background: #fff;
	border: 2px solid #1f2937;
	padding: 1.25rem;
	font-family: var(--gl-font, Peyda, Tahoma, sans-serif);
}

@media print {
	.gl-shipping-label {
		max-width: none;
		border-width: 1px;
	}
}

.gl-shipping-label__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid #1f2937;
	margin-bottom: 1rem;
	font-size: 1rem;
}

.gl-shipping-label__section {
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px dashed #d1d5db;
}

.gl-shipping-label__section h4 {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	color: #6b7280;
	text-transform: uppercase;
}

.gl-shipping-label__section p {
	margin: 0 0 0.25rem;
	font-size: 0.875rem;
	line-height: 1.5;
}

.gl-shipping-label__section--recipient {
	background: #fef3c7;
	padding: 0.75rem;
	border-radius: 4px;
	border: 1px solid #fcd34d;
}

.gl-shipping-label__tracking {
	text-align: center;
	padding: 0.75rem;
	background: #eff6ff;
	border: 1px solid #93c5fd;
	border-radius: 4px;
	margin-bottom: 1rem;
}

.gl-shipping-label__tracking code {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.1em;
}

.gl-shipping-label__barcode {
	text-align: center;
	font-family: monospace;
	font-size: 1.5rem;
	letter-spacing: 0.2em;
	padding: 0.75rem;
	border: 1px dashed #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
	.gl-order-tracking__bar {
		padding: 1rem 0.5rem;
	}

	.gl-order-tracking__label {
		font-size: 0.625rem;
	}

	.gl-invoice__parties {
		grid-template-columns: 1fr;
	}

	.gl-invoice {
		padding: 1rem;
	}

	.gl-orders-table thead {
		display: none;
	}

	.gl-orders-table tr {
		display: block;
		margin-bottom: 1rem;
		border: 1px solid rgba(201, 169, 98, 0.15);
		border-radius: var(--gl-radius);
		padding: 1rem;
	}

	.gl-orders-table td {
		display: flex;
		justify-content: space-between;
		padding: 0.35rem 0;
		border: none;
	}

	.gl-orders-table td::before {
		content: attr(data-title);
		font-weight: 600;
		color: var(--gl-gray);
	}
}
