/* =============================================
   ORDER TRACKING PAGE — STYLES
   ============================================= */

.tracking-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    min-height: 60vh;
}

/* Search Section */
.tracking-search-section {
    text-align: center;
    margin-bottom: 40px;
}

.tracking-title {
    font-size: 28px;
    font-weight: 800;
    color: #111;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.tracking-subtitle {
    color: #888;
    font-size: 14px;
    margin: 0 0 24px;
}

.tracking-search-box {
    display: flex;
    gap: 10px;
    max-width: 420px;
    margin: 0 auto;
}

.tracking-search-box input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.tracking-search-box input:focus {
    border-color: #111;
}

.tracking-search-box button {
    padding: 14px 28px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.5px;
}

.tracking-search-box button:hover {
    background: #333;
}

.tracking-error {
    color: #c62828;
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* Summary Card */
.tracking-summary-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.summary-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.summary-value {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin: 4px 0 0;
    letter-spacing: 1px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.processing { background: #fff3e0; color: #e65100; }
.status-badge.shipped { background: #e3f2fd; color: #1565c0; }
.status-badge.in-transit { background: #e3f2fd; color: #1565c0; }
.status-badge.ready-to-ship { background: #f3e5f5; color: #6a1b9a; }
.status-badge.order-placed { background: #fff3e0; color: #e65100; }
.status-badge.out-for-delivery { background: #e8f5e9; color: #2e7d32; }
.status-badge.delivered { background: #e8f5e9; color: #2e7d32; }
.status-badge.cancelled { background: #fce4ec; color: #c62828; }
.status-badge.undelivered { background: #fff3e0; color: #e65100; }
.status-badge.lost { background: #fce4ec; color: #b71c1c; }
.status-badge.delayed { background: #fffde7; color: #f57f17; }
.status-badge.return-requested,
.status-badge.return-approved,
.status-badge.return-pickup-scheduled,
.status-badge.return-picked-up,
.status-badge.return-in-transit,
.status-badge.return-received,
.status-badge.refund-initiated { background: #f3e5f5; color: #6a1b9a; }
.status-badge.exchange-requested,
.status-badge.exchange-approved,
.status-badge.replacement-shipped,
.status-badge.replacement-delivered { background: #e3f2fd; color: #1565c0; }
.status-badge.return-rejected,
.status-badge.exchange-rejected { background: #fce4ec; color: #c62828; }

.summary-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.summary-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Timeline Card */
.tracking-timeline-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.timeline-title,
.items-title {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #e0e0e0;
}

.timeline-step {
    position: relative;
    padding-bottom: 24px;
}

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

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
    z-index: 1;
}

.timeline-step.completed .timeline-dot {
    background: #2e7d32;
    box-shadow: 0 0 0 2px #2e7d32;
}

.timeline-step.active .timeline-dot {
    background: #111;
    box-shadow: 0 0 0 2px #111;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px #111; }
    50% { box-shadow: 0 0 0 6px rgba(17, 17, 17, 0.2); }
}

.timeline-content h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.timeline-content p {
    margin: 0;
    font-size: 12px;
    color: #999;
}

.timeline-timestamp {
    display: block;
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

.timeline-icon {
    font-size: 11px;
    line-height: 20px;
    text-align: center;
}

.timeline-step.pending .timeline-content h4 {
    color: #ccc;
}

/* Flow Labels */
.tracker-flow-label {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.tracker-flow-return { background: #f3e5f5; color: #6a1b9a; }
.tracker-flow-exchange { background: #e3f2fd; color: #1565c0; }

/* Edge Case Banners */
.tracker-edge-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 22px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.tracker-edge-banner strong {
    display: block;
    margin-bottom: 3px;
    font-size: 15px;
}

.tracker-edge-icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.tracker-edge-rejected {
    background: #fce4ec;
    border: 1px solid #ef9a9a;
    color: #c62828;
    margin-top: 18px;
}

/* Return Flow Color Overrides */
.tracker-flow-return ~ .timeline .timeline-step.completed .timeline-dot {
    background: #7b1fa2;
    box-shadow: 0 0 0 2px #7b1fa2;
}

.tracker-flow-return ~ .timeline .timeline-step.active .timeline-dot {
    background: #7b1fa2;
    box-shadow: 0 0 0 2px #7b1fa2;
    animation: pulse-dot-return 1.5s infinite;
}

@keyframes pulse-dot-return {
    0%, 100% { box-shadow: 0 0 0 2px #7b1fa2; }
    50% { box-shadow: 0 0 0 6px rgba(123, 31, 162, 0.2); }
}

/* AWB Card */
.tracking-awb-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 18px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.awb-details-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 36px;
}

.awb-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.awb-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.awb-detail strong {
    font-size: 14px;
    color: #111;
    font-weight: 700;
}

.track-ext-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #111;
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    margin-left: auto;
}

.track-ext-btn:hover {
    background: #2a2a2a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.track-ext-btn:active {
    transform: translateY(0);
}

.track-ext-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .tracking-awb-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 18px;
    }
    .awb-details-group {
        width: 100%;
        gap: 16px 24px;
    }
    .track-ext-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}


/* Items Card */
.tracking-items-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tracking-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
}

.tracking-item-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
}

.tracking-item-info {
    flex: 1;
}

.tracking-item-info h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.tracking-item-info span {
    font-size: 12px;
    color: #888;
}

.tracking-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

/* Loader */
.tracking-loader {
    text-align: center;
    padding: 40px 0;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top: 3px solid #111;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tracking-loader p {
    color: #888;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .tracking-container {
        padding: 24px 16px 60px;
    }

    .tracking-title {
        font-size: 22px;
    }

    .tracking-search-box {
        flex-direction: column;
    }

    .tracking-search-box button {
        width: 100%;
    }

    .summary-header {
        flex-direction: column;
        gap: 12px;
    }

    .tracking-summary-card,
    .tracking-timeline-card,
    .tracking-items-card {
        padding: 18px 20px;
    }
}
