/* ============================================================
   TRACK ORDER STYLES
   ============================================================ */

.m-track-order-page {
    background: #F4F6FB;
    min-height: 100vh;
    padding-bottom: 90px; /* Space for bottom nav */
}

/* TOP BAR */
.m-track-top-bar {
    height: 52px;
    background: white;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #F3F4F6;
}
.m-track-top-bar .back-btn {
    color: #111827;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.m-track-top-bar .back-btn svg {
    width: 22px;
    height: 22px;
}
.m-track-top-bar .title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

/* BODY */
.m-track-body {
    padding-top: 64px;
}

/* ORDER INFO CARD */
.info-card {
    margin: 16px;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.info-card .order-id {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
}
.info-card .est-delivery {
    font-size: 13px;
    color: #6B7280;
    margin-top: 4px;
}

/* PROGRESS TRACKER */
.progress-card {
    margin: 0 16px 16px;
    background: white;
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.tracker-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.step-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
}
.step-unit .circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 2;
}
.circle.completed {
    width: 32px; height: 32px;
    background: #10B981;
    color: white;
}
.circle.active {
    width: 36px; height: 36px;
    background: white;
    border: 3px solid var(--m-primary-purple);
    color: var(--m-primary-purple);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
    margin-top: -2px; /* optical alignment because it's larger */
}
.circle.inactive {
    width: 32px; height: 32px;
    background: #E5E7EB;
}
.step-unit .label {
    font-size: 10px;
    color: #374151;
    text-align: center;
    margin-top: 8px;
    line-height: 1.2;
}
.active-unit .label {
    font-weight: 700;
    color: #111827;
}
.active-unit .sub-label {
    font-size: 9px;
    color: #6B7280;
    font-weight: 500;
    display: block;
    max-width: 70px;
    margin: 2px auto 0;
}

.tracker-row .line {
    flex: 1;
    height: 3px;
    margin-top: 14px;
    z-index: 1;
}
.line.completed-line {
    background: var(--m-primary-purple);
}
.line.pending-line {
    background: #E5E7EB;
}

/* MAP VISUALIZATION */
.map-container {
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background: #EDE9FE;
    position: relative;
}
.map-grid {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.truck-wrapper {
    position: absolute;
    top: 135px; /* Aligned with the slanted route line */
    left: 40px;
    width: 32px;
    height: 32px;
    animation: driveRoute 4s linear infinite;
    transform-origin: center;
}
.truck-icon {
    width: 100%;
    height: 100%;
}

.dest-pin {
    position: absolute;
    right: 55px; /* End of route line */
    top: 55px;
    width: 28px;
    height: 28px;
    transform: translateY(0);
    animation: bouncePin 2s ease-in-out infinite;
}

/* Animations */
@keyframes driveRoute {
    0% {
        transform: translate(0, 0) rotate(-15deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(250px, -75px) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes bouncePin {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.route-line {
    stroke-dasharray: 8 6;
    animation: dashScroll 1s linear infinite reverse;
}
@keyframes dashScroll {
    to { stroke-dashoffset: 14; }
}

/* ACTION BUTTONS */
.action-buttons {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.btn-support {
    height: 52px;
    width: 100%;
    border-radius: 50px;
    background: var(--m-primary-purple);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
}
.btn-call {
    height: 52px;
    width: 100%;
    border-radius: 50px;
    background: transparent;
    border: 2px solid var(--m-primary-purple);
    color: var(--m-primary-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}
.action-buttons svg {
    width: 18px;
    height: 18px;
}
