/* =====================================================================
   WooCommerce Shipment Tracker — Frontend Styles
   ===================================================================== */

/* ── Variables ──────────────────────────────────────────────────────── */
:root {
    --wst-primary: #0073aa;
    --wst-primary-dark: #005177;
    --wst-success: #28a745;
    --wst-warning: #fd7e14;
    --wst-muted: #6c757d;
    --wst-light: #f8f9fa;
    --wst-border: #e2e6ea;
    --wst-radius: 12px;
    --wst-shadow: 0 4px 24px rgba(0, 0, 0, .08);
    --wst-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ── Tracker Container ─────────────────────────────────────────────── */
.wst-tracker {
    max-width: 680px;
    margin: 0 auto;
    font-family: var(--wst-font);
}

/* ── Search Card ───────────────────────────────────────────────────── */
.wst-search-card {
    background: linear-gradient(135deg, var(--wst-primary), var(--wst-primary-dark));
    border-radius: var(--wst-radius);
    padding: 40px 32px 36px;
    color: #fff;
    text-align: center;
    box-shadow: var(--wst-shadow);
}

.wst-search-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.wst-search-card h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
}

.wst-search-card p {
    margin: 0 0 24px;
    font-size: 15px;
    opacity: .85;
    color: #dce9f0;
}

/* ── Input Group ───────────────────────────────────────────────────── */
.wst-input-group {
    display: flex;
    gap: 0;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}

.wst-input-group input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 15px;
    outline: none;
    color: #333;
    background: #fff;
}

.wst-input-group input::placeholder {
    color: #adb5bd;
}

.wst-input-group button {
    border: none;
    background: #222;
    color: #fff;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wst-input-group button:hover {
    background: #444;
}

/* ── Spinner ───────────────────────────────────────────────────────── */
.wst-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wst-spin .6s linear infinite;
}

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

/* ── Error Message ─────────────────────────────────────────────────── */
.wst-error {
    max-width: 680px;
    margin: 20px auto 0;
    padding: 16px 20px;
    background: #fff3f3;
    border: 1px solid #f5c2c2;
    border-left: 4px solid #dc3545;
    border-radius: 8px;
    color: #842029;
    font-size: 14px;
    font-family: var(--wst-font);
}

/* ── Results Container ─────────────────────────────────────────────── */
.wst-results {
    margin-top: 28px;
    animation: wst-fadeIn .4s ease;
}

@keyframes wst-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Timeline ──────────────────────────────────────────────────────── */
.wst-timeline {
    display: flex;
    justify-content: space-between;
    margin: 28px 0;
    padding: 0 8px;
    position: relative;
}

.wst-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.wst-step-indicator {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.wst-step-dot {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    z-index: 2;
    transition: all .3s;
    border: 3px solid var(--wst-border);
    background: #fff;
    color: var(--wst-muted);
    position: relative;
    margin: 0 auto;
}

.wst-step-line {
    position: absolute;
    top: 50%;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 3px;
    background: var(--wst-border);
    transform: translateY(-50%);
    z-index: 1;
}

/* States */
.wst-step--completed .wst-step-dot {
    background: var(--wst-success);
    border-color: var(--wst-success);
    color: #fff;
}

.wst-step--completed .wst-step-line {
    background: var(--wst-success);
}

.wst-step--active .wst-step-dot {
    background: var(--wst-primary);
    border-color: var(--wst-primary);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(0, 115, 170, .18);
}

/* Pulse animation for active step */
.wst-pulse {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: wst-pulse-anim 1.5s ease-in-out infinite;
}

@keyframes wst-pulse-anim {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.3); opacity: .7; }
}

.wst-step--pending .wst-step-dot {
    background: #fff;
}

.wst-step-label {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--wst-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .3px;
    line-height: 1.3;
}

.wst-step--completed .wst-step-label {
    color: var(--wst-success);
}

.wst-step--active .wst-step-label {
    color: var(--wst-primary);
}

/* ── Details Card ──────────────────────────────────────────────────── */
.wst-details-card,
.wst-order-tracking .wst-details-card {
    background: #fff;
    border: 1px solid var(--wst-border);
    border-radius: var(--wst-radius);
    overflow: hidden;
    box-shadow: var(--wst-shadow);
}

.wst-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--wst-border);
}

.wst-detail-row:last-child {
    border-bottom: none;
}

.wst-detail-label {
    font-size: 13px;
    color: var(--wst-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.wst-detail-value {
    font-size: 15px;
    color: #222;
    font-weight: 500;
}

.wst-tracking-number {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--wst-primary-dark);
}

/* ── Status Badge ──────────────────────────────────────────────────── */
.wst-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.wst-status--order_placed      { background: #e8f4fd; color: #0073aa; }
.wst-status--packed            { background: #fff3e0; color: #e67e22; }
.wst-status--shipped           { background: #e3f2fd; color: #1565c0; }
.wst-status--in_transit        { background: #fff8e1; color: #f57f17; }
.wst-status--out_for_delivery  { background: #fce4ec; color: #c62828; }
.wst-status--delivered         { background: #e8f5e9; color: #2e7d32; }

/* ── Track Link Button ─────────────────────────────────────────────── */
.wst-detail-action {
    justify-content: center;
    padding: 18px 24px;
    background: var(--wst-light);
}

.wst-track-link-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--wst-primary);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, transform .15s;
}

.wst-track-link-btn:hover {
    background: var(--wst-primary-dark);
    transform: translateY(-1px);
}

/* ── My Account Order Table Column ─────────────────────────────────── */
.wst-mini-tracking {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--wst-primary-dark);
    letter-spacing: .5px;
}

.wst-mini-na {
    color: #ccc;
}

/* ── Order Tracking Section ────────────────────────────────────────── */
.wst-order-tracking {
    margin: 28px 0;
    font-family: var(--wst-font);
}

.wst-order-tracking h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #222;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 640px) {

    .wst-search-card {
        padding: 28px 18px 24px;
    }

    .wst-search-card h2 {
        font-size: 21px;
    }

    .wst-input-group {
        flex-direction: column;
        border-radius: 8px;
    }

    .wst-input-group input {
        border-bottom: 1px solid #eee;
        text-align: center;
    }

    .wst-input-group button {
        justify-content: center;
        padding: 14px;
    }

    /* Timeline: vertical on mobile */
    .wst-timeline {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .wst-timeline-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 14px;
    }

    .wst-step-indicator {
        flex-direction: column;
        align-items: center;
        width: 32px;
    }

    .wst-step-dot {
        margin: 0;
    }

    .wst-step-line {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        width: 3px;
        height: 28px;
        margin: 0 auto;
    }

    .wst-step-label {
        margin-top: 6px;
        text-align: left;
        font-size: 13px;
    }

    .wst-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 14px 18px;
    }
}
