/* Track Order Page */

.track-lookup-form {
    background: var(--white);
    border-radius: 0;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

/* Status Timeline */
.track-timeline {
    background: var(--white);
    border-radius: 0;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.track-timeline-steps {
    position: relative;
    padding-left: 2rem;
}

/* Vertical line connecting steps */
.track-timeline-steps::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--gray-200);
}

.track-step {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 1rem;
}

.track-step:last-child {
    padding-bottom: 0;
}

/* Step circle */
.track-step-circle {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    background: var(--white);
    border: 2px solid var(--gray-300);
    color: transparent;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

/* Completed step */
.track-step.completed .track-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Current step - pulsing ring */
.track-step.current .track-step-circle {
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    animation: trackPulse 2s ease-in-out infinite;
}

.track-step.current .track-step-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
}

/* Future step */
.track-step.future .track-step-circle {
    background: var(--white);
    border-color: var(--gray-300);
}

@keyframes trackPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1); }
}

.track-step-content {
    min-height: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.track-step-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.track-step.future .track-step-label {
    color: var(--gray-400);
}

.track-step-date {
    font-size: 0.78rem;
    color: var(--gray-400);
    white-space: nowrap;
    margin-top: 2px;
}

.track-step.completed .track-step-date {
    color: var(--gray-500);
}

/* Late Shipment Banner */
.track-late-banner {
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #e9ecfb, #d9def9);
    border: 1px solid #b9c3f6;
    border-radius: 0;
    font-size: 0.8rem;
    color: #0d1a73;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
}

/* Order Summary */
.track-order-summary {
    background: var(--white);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.track-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.track-order-id {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 1px;
}

.track-order-date {
    font-size: 0.78rem;
    color: var(--gray-400);
}

.track-items-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.track-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
    color: var(--gray-700);
}

.track-items-list li:last-child {
    border-bottom: none;
}

.track-item-name {
    flex: 1;
    font-weight: 500;
}

.track-item-qty {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-left: 8px;
    white-space: nowrap;
}

.track-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 2px solid var(--gray-200);
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
}

/* Cancelled Banner */
.track-cancelled-banner {
    background: linear-gradient(135deg, #f6ebe9, #f2d7d4);
    border: 1px solid #ecc7c3;
    border-radius: 0;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.track-cancelled-banner .track-cancelled-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--error-red);
}

.track-cancelled-banner h2 {
    color: #8c1a12;
    margin-bottom: 0.5rem;
}

.track-cancelled-banner p {
    color: #a21e16;
    font-size: 0.9rem;
}

/* Contact Section */
.track-contact-section {
    margin-top: 0;
    padding: 16px;
    background: #e9ecfb;
    border: 1px solid #d9def9;
    border-radius: 0;
}

.track-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    color: white;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.track-contact-btn:hover {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 640px) {
    .track-lookup-form,
    .track-timeline,
    .track-order-summary,
    .track-cancelled-banner {
        padding: 1.25rem;
    }

    .track-step-content {
        flex-direction: column;
        gap: 2px;
    }

    .track-step-date {
        font-size: 0.72rem;
    }

    .track-order-id {
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .track-lookup-form,
    .track-timeline,
    .track-order-summary {
        padding: 1rem;
    }

    .track-step {
        padding-left: 0.75rem;
    }

}

/* ===== Mobile Optimisation (Jul 2026) ===== */
/* Additive, media-query-scoped only — desktop rendering unchanged. */

@media (max-width: 640px) {
    /* Contact buttons: full-width stacked, 48px touch height */
    .track-contact-btn {
        display: flex;
        width: 100%;
        justify-content: center;
        min-height: 48px;
        margin-bottom: 8px;
    }

    /* Long order ids / tracking numbers never overflow their card */
    .track-order-summary,
    .track-timeline,
    .track-order-id {
        overflow-wrap: break-word;
        word-break: break-word;
        min-width: 0;
    }

    /* Timeline step labels: slightly larger, comfortable line-height */
    .track-step-content {
        line-height: 1.45;
    }
}
