/**
 * In Madra - Track Order Side Drawer Styles
 * Matches luxury monochrome design system with smooth slide-over from right
 */

/* ==========================================================================
   1. DRAWER OVERLAY & SLIDE-OVER CONTAINER
   ========================================================================== */

.im-track-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.48);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 99999;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	justify-content: flex-end;
}

.im-track-drawer-overlay.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

.im-track-drawer-panel {
	width: 100%;
	max-width: 440px;
	height: 100%;
	background: #FFFFFF;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: -6px 0 28px rgba(0, 0, 0, 0.12);
	position: relative;
	overflow: hidden;
}

.im-track-drawer-overlay.is-open .im-track-drawer-panel {
	transform: translateX(0);
}

/* ==========================================================================
   2. DRAWER HEADER
   ========================================================================== */

.im-track-drawer-header {
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #EAE7E0;
	background: #FFFFFF;
	flex-shrink: 0;
}

.im-track-header-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.im-track-header-label {
	font-family: var(--im-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	color: #8C887E;
	text-transform: uppercase;
}

.im-track-header-title {
	font-family: var(--im-font-heading, "Playfair Display", Georgia, serif);
	font-size: 1.15rem;
	font-weight: 600;
	color: #1C1B18;
	margin: 0;
	letter-spacing: 0.02em;
}

.im-track-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.im-track-refresh-btn,
.im-track-drawer-close {
	background: #F7F5F0;
	border: 1px solid #EAE7E0;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #1C1B18;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	padding: 0;
}

.im-track-refresh-btn:hover,
.im-track-drawer-close:hover {
	background: #EAE7E0;
	border-color: #D6D2C4;
}

.im-track-refresh-btn.is-spinning svg {
	animation: im-spin 0.8s linear infinite;
}

@keyframes im-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   3. DRAWER BODY & SCROLL
   ========================================================================== */

.im-track-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	background: #FCFBF9;
}

/* Custom Scrollbar */
.im-track-drawer-body::-webkit-scrollbar {
	width: 5px;
}
.im-track-drawer-body::-webkit-scrollbar-thumb {
	background: #D8D4C8;
	border-radius: 4px;
}

/* ==========================================================================
   4. SUMMARY CARD (COURIER, WAYBILL, ESTIMATE)
   ========================================================================== */

.im-track-card-summary {
	background: #FFFFFF;
	border: 1px solid #E6E2DA;
	border-radius: 6px;
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.im-track-summary-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #F0EEEA;
}

.im-track-courier-badge {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-family: var(--im-font-sans, sans-serif);
	font-size: 0.85rem;
	font-weight: 700;
	color: #1C1B18;
	letter-spacing: 0.02em;
}

.im-track-courier-badge svg {
	color: #1C1B18;
}

.im-track-status-pill {
	font-family: var(--im-font-sans, sans-serif);
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.25rem 0.65rem;
	border-radius: 20px;
	background: #F3F4F6;
	color: #374151;
}

.im-track-status-pill.is-shipping {
	background: #EFF6FF;
	color: #1D4ED8;
	border: 1px solid #BFDBFE;
}

.im-track-status-pill.is-delivered {
	background: #F0FDF4;
	color: #15803D;
	border: 1px solid #BBF7D0;
}

.im-track-status-pill.is-confirmed {
	background: #FEF3C7;
	color: #B45309;
	border: 1px solid #FDE68A;
}

.im-track-status-pill.is-waiting {
	background: #FFFBEB;
	color: #D97706;
	border: 1px solid #FCD34D;
}

.im-track-status-pill.is-cancelled {
	background: #FEF2F2;
	color: #B91C1C;
	border: 1px solid #FECACA;
}

/* Waybill row */
.im-track-waybill-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #F8F7F4;
	padding: 0.55rem 0.75rem;
	border-radius: 4px;
	border: 1px solid #EAE7E0;
}

.im-track-waybill-info {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.im-track-label {
	font-size: 0.72rem;
	color: #76746F;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.im-track-waybill-text {
	font-family: monospace;
	font-size: 0.92rem;
	color: #1C1B18;
	letter-spacing: 0.05em;
	font-weight: 700;
}

.im-track-copy-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	color: #57534E;
	padding: 0.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: color 0.15s ease;
}

.im-track-copy-btn:hover {
	color: #1C1B18;
}

.im-track-copy-tooltip {
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	background: #1C1B18;
	color: #FFFFFF;
	font-size: 0.65rem;
	font-weight: 600;
	padding: 0.2rem 0.45rem;
	border-radius: 3px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
}

.im-track-copy-btn.is-copied .im-track-copy-tooltip {
	opacity: 1;
	visibility: visible;
}

/* Meta Grid */
.im-track-meta-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	padding-top: 0.25rem;
}

.im-track-meta-item {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.im-track-meta-item .im-track-val {
	font-size: 0.82rem;
	font-weight: 600;
	color: #1C1B18;
}

/* Warehouse Notice Box */
.im-track-preparing-box {
	background: #FFFBEB;
	border: 1px solid #FDE68A;
	border-radius: 6px;
	padding: 0.85rem 1rem;
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
}

.im-preparing-icon {
	flex-shrink: 0;
	margin-top: 0.1rem;
}

.im-preparing-text {
	font-size: 0.78rem;
	color: #92400E;
	line-height: 1.45;
}

/* ==========================================================================
   5. PROGRESS STEPPER (4 STEPS)
   ========================================================================== */

.im-track-stepper-wrap {
	background: #FFFFFF;
	border: 1px solid #E6E2DA;
	border-radius: 6px;
	padding: 1.25rem 1rem;
	position: relative;
}

.im-track-stepper-line {
	position: absolute;
	top: 2rem;
	left: 12%;
	right: 12%;
	height: 2px;
	background: #EAE7E0;
	z-index: 1;
}

.im-track-stepper-progress-bar {
	height: 100%;
	background: #1C1B18;
	transition: width 0.4s ease;
}

.im-track-steps-row {
	display: flex;
	justify-content: space-between;
	position: relative;
	z-index: 2;
}

.im-track-step-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	width: 25%;
}

.im-step-bullet {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #FFFFFF;
	border: 2px solid #D1CDC4;
	display: flex;
	align-items: center;
	justify-content: center;
	color: transparent;
	transition: all 0.25s ease;
}

.im-track-step-node.is-active .im-step-bullet {
	background: #1C1B18;
	border-color: #1C1B18;
	color: #FFFFFF;
}

.im-track-step-node.is-current .im-step-bullet {
	box-shadow: 0 0 0 4px rgba(28, 27, 24, 0.15);
}

.im-step-label {
	font-size: 0.68rem;
	font-weight: 600;
	color: #8C887E;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.im-track-step-node.is-active .im-step-label {
	color: #1C1B18;
	font-weight: 700;
}

/* ==========================================================================
   6. LIVE TIMELINE CHECKPOINTS
   ========================================================================== */

.im-track-history-section {
	background: #FFFFFF;
	border: 1px solid #E6E2DA;
	border-radius: 6px;
	padding: 1.25rem;
}

.im-track-history-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid #F0EEEA;
	margin-bottom: 1.15rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #8C887E;
}

.im-track-history-count {
	font-size: 0.68rem;
	color: #76746F;
	background: #F3F1EC;
	padding: 0.15rem 0.5rem;
	border-radius: 10px;
}

.im-track-timeline {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.im-track-timeline::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 6px;
	width: 2px;
	background: #EAE7E0;
}

.im-timeline-item {
	position: relative;
	padding-left: 1.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.im-timeline-item-marker {
	position: absolute;
	top: 3px;
	left: 1px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #FFFFFF;
	border: 2px solid #8C887E;
	z-index: 2;
}

.im-timeline-item.is-latest .im-timeline-item-marker {
	background: #16A34A;
	border-color: #16A34A;
	box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.im-timeline-item-datetime {
	font-size: 0.72rem;
	color: #8C887E;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.im-timeline-item-status {
	font-size: 0.85rem;
	font-weight: 700;
	color: #1C1B18;
}

.im-timeline-item.is-latest .im-timeline-item-status {
	color: #15803D;
}

.im-timeline-item-note {
	font-size: 0.78rem;
	color: #57534E;
	line-height: 1.45;
}

/* ==========================================================================
   7. EXTERNAL TRACKING BUTTON
   ========================================================================== */

.im-track-btn-external {
	width: 100%;
	padding: 0.75rem 1rem;
	background: #FFFFFF;
	border: 1px solid #1C1B18;
	color: #1C1B18;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	text-decoration: none;
	transition: all 0.2s ease;
}

.im-track-btn-external:hover {
	background: #1C1B18;
	color: #FFFFFF;
}

/* ==========================================================================
   8. FOOTER SUPPORT
   ========================================================================== */

.im-track-drawer-footer {
	padding: 1.15rem 1.5rem;
	border-top: 1px solid #EAE7E0;
	background: #FFFFFF;
	flex-shrink: 0;
}

.im-track-footer-support {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.78rem;
	color: #76746F;
}

.im-track-footer-support a {
	color: #1C1B18;
	font-weight: 600;
	text-decoration: none;
}

.im-track-footer-support a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   9. LOADING SKELETON & ERROR STATES
   ========================================================================== */

.im-track-loading-state {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.im-track-skeleton-card,
.im-track-skeleton-stepper,
.im-track-skeleton-timeline {
	background: #FFFFFF;
	border: 1px solid #EAE7E0;
	border-radius: 6px;
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.im-skeleton-line {
	height: 12px;
	background: linear-gradient(90deg, #EAE7E0 25%, #F5F3ED 50%, #EAE7E0 75%);
	background-size: 200% 100%;
	border-radius: 4px;
	animation: im-skeleton-shimmer 1.4s infinite;
}

.im-skeleton-w20 { width: 20%; }
.im-skeleton-w30 { width: 30%; }
.im-skeleton-w40 { width: 40%; }
.im-skeleton-w50 { width: 50%; }
.im-skeleton-w60 { width: 60%; }
.im-skeleton-w70 { width: 70%; }
.im-skeleton-w80 { width: 80%; }

.im-skeleton-circle {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #EAE7E0;
	animation: im-skeleton-shimmer 1.4s infinite;
}

.im-track-skeleton-stepper {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}

.im-skeleton-checkpoint {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
}

.im-skeleton-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #EAE7E0;
	margin-top: 4px;
	flex-shrink: 0;
}

.im-skeleton-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

@keyframes im-skeleton-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.im-track-error-state {
	background: #FFFFFF;
	border: 1px solid #FCA5A5;
	border-radius: 6px;
	padding: 2rem 1.5rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.65rem;
}

.im-track-error-title {
	font-size: 0.95rem;
	font-weight: 700;
	color: #991B1B;
	margin: 0;
}

.im-track-error-desc {
	font-size: 0.8rem;
	color: #6B7280;
	line-height: 1.45;
	margin: 0;
}

.im-track-retry-btn {
	margin-top: 0.5rem;
	padding: 0.55rem 1.25rem;
	background: #1C1B18;
	color: #FFFFFF;
	border: none;
	border-radius: 4px;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.im-track-retry-btn:hover {
	background: #383632;
}

/* ==========================================================================
   10. BUTTON TRIGGER STYLING (FOR THANK YOU & VIEW ORDER PAGES)
   ========================================================================== */

.im-status-btn-track {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	background: #1C1B18;
	color: #FFFFFF;
	border: 1px solid #1C1B18;
	border-radius: 4px;
	padding: 0.65rem 1.25rem;
	font-family: var(--im-font-sans, sans-serif);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
}

.im-status-btn-track:hover {
	background: #33312D;
	color: #FFFFFF;
	border-color: #33312D;
}

.im-status-btn-track.is-outline {
	background: transparent;
	color: #1C1B18;
	border-color: #1C1B18;
}

.im-status-btn-track.is-outline:hover {
	background: #1C1B18;
	color: #FFFFFF;
}

.im-view-order-track-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	background: #1C1B18;
	color: #FFFFFF;
	border: 1px solid #1C1B18;
	padding: 0.5rem 1rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.im-view-order-track-btn:hover {
	background: #383632;
}

/* Mobile Responsiveness */
@media (max-width: 767px) {
	.im-track-drawer-panel {
		max-width: 100%;
	}
	.im-track-drawer-body {
		padding: 1.15rem;
	}
}
