* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #f5a623;
    --primary-dark: #e6951a;
    --secondary: #2d8a4e;
    --dark: #1a1a2e;
    --white: #ffffff;
    --gray: #666;
    --light-gray: #f8f9fa;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    min-height: 100vh;
    padding-bottom: 3rem;
}

.hidden { display: none !important; }

/* Header */
.track-header {
    background: var(--white);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo .logo-img {
    height: 32px;
    width: auto;
}

.track-badge {
    background: var(--light-gray);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
}

/* Search */
.track-search {
    text-align: center;
    padding: 3rem 2rem 2rem;
}

.track-search h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.track-search p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.search-input-group input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
}

.search-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--secondary);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Results */
.track-results {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Order Card */
.track-order-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow);
}

.track-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.track-order-number {
    font-weight: 700;
    font-size: 1.1rem;
}

.track-order-date {
    font-size: 0.8rem;
    color: #aaa;
}

/* Status Timeline */
.status-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    position: relative;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #eee;
    z-index: 0;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    flex: 1;
}

.status-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    transition: all 0.3s;
}

.status-step.active .status-dot {
    background: var(--secondary);
    color: var(--white);
}

.status-step.completed .status-dot {
    background: var(--secondary);
    color: var(--white);
}

.status-step.cancelled .status-dot {
    background: #e74c3c;
    color: var(--white);
}

.status-label {
    font-size: 0.65rem;
    color: #aaa;
    text-align: center;
    font-weight: 500;
}

.status-step.active .status-label,
.status-step.completed .status-label {
    color: var(--secondary);
    font-weight: 600;
}

/* Order Details */
.track-order-items {
    border-top: 1px solid #f0f0f0;
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.track-item {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.track-item.addon {
    padding-left: 1rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.track-item.addon::before {
    content: '+ ';
    color: var(--primary);
}

.track-order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.8rem;
    border-top: 2px solid var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.track-order-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
}

.meta-delivery { background: #e8f4fd; color: #2980b9; }
.meta-pickup { background: #e8f8f0; color: #27ae60; }
.meta-payment { background: #fef3e2; color: var(--primary-dark); }

/* Empty & Loading */
.track-empty, .track-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.track-empty p {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.track-loading p {
    margin-top: 1rem;
    color: var(--gray);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .track-search h1 {
        font-size: 1.4rem;
    }

    .search-input-group {
        flex-direction: column;
    }

    .status-label {
        font-size: 0.6rem;
    }

    .status-dot {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
}

.meta-tracking {
    background: #fff3e0;
    color: #e65100;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.meta-tracking:hover {
    background: #ffe0b2;
}

/* Rider Tracking Link */
.track-rider-link {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border: 2px solid #ffcc80;
    border-radius: 10px;
    text-align: center;
}

.track-rider-link p {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e65100;
    margin-bottom: 0.5rem;
}

.track-rider-link a {
    font-size: 0.8rem;
    color: #1565c0;
    word-break: break-all;
}

.delivery-fee-row {
    color: var(--primary-dark);
    font-weight: 500;
    padding-top: 0.5rem;
    margin-top: 0.3rem;
    border-top: 1px dashed #eee;
}
