/* PostExpress — Tracking Widget */

/* Wrapper nema max-width — stepper se širi na punu širinu kontejnera.
   Form i timeline imaju sopstveni max-width. */
.pexwoo-tracking-wrap {
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
    line-height: 1.5;
}

/* ── Stepper wrapper — bez pozadine ─────────────────────────────────── */

.pexwoo-stepper-wrap {
    width: 100%;
    padding: 24px 0 20px;
}

/* ── Stepper row — desktop ───────────────────────────────────────────── */

.pexwoo-stepper {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.pexwoo-stepper__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    width: 90px;
}

/* Horizontalna linija između koraka */
.pexwoo-stepper__conn {
    flex: 1;
    height: 3px;
    min-width: 12px;
    background: #e0e0e0;
    border-radius: 2px;
    align-self: flex-start;
    margin-top: 23px; /* (48px ikona / 2) - (3px linija / 2) ≈ 23px */
    transition: background 0.3s;
}

.pexwoo-stepper__conn--done {
    background: #4caf50;
}

/* Ikona krug */
.pexwoo-stepper__node {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.pexwoo-stepper__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e9ecef;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.pexwoo-stepper__icon svg {
    width: 22px;
    height: 22px;
}

.pexwoo-stepper__step.is-done .pexwoo-stepper__icon {
    background: #e8f5e9;
    color: #388e3c;
}

.pexwoo-stepper__step.is-active .pexwoo-stepper__icon {
    background: #1a237e;
    color: #fff;
    box-shadow: 0 4px 16px rgba(26, 35, 126, 0.28);
}

.pexwoo-stepper__step.is-inactive .pexwoo-stepper__icon {
    background: #f1f3f5;
    color: #ced4da;
}

/* Žuti badge */
.pexwoo-stepper__badge {
    position: absolute;
    bottom: -3px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ffcb05;
    color: #002d72;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}

.pexwoo-stepper__badge--warn {
    background: #ff9800;
    color: #fff;
}

/* Label ispod ikonice */
.pexwoo-stepper__lbl {
    font-size: 11px;
    font-weight: 500;
    color: #adb5bd;
    text-align: center;
    line-height: 1.3;
    transition: color 0.25s, font-weight 0.25s;
}

.pexwoo-stepper__step.is-done   .pexwoo-stepper__lbl { color: #388e3c; }
.pexwoo-stepper__step.is-active .pexwoo-stepper__lbl { color: #1a237e; font-weight: 700; }

/* VR baner */
.pexwoo-stepper__vr {
    margin-top: 14px;
    padding: 10px 16px;
    background: #ffebee;
    border-radius: 8px;
    color: #b71c1c;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* Tracking broj ispod steppera */
.pexwoo-stepper__num {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #adb5bd;
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0.5px;
}

/* ── Form — max-width 640px ──────────────────────────────────────────── */

.pexwoo-track-form {
    max-width: 640px;
    margin: 0 auto 8px;
}

.pexwoo-track-input-wrap {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.pexwoo-track-input {
    flex: 1;
    min-width: 0;
    padding: 13px 18px !important;
    font-size: 16px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #1a1a1a !important;
    transition: border-color 0.15s !important;
    box-sizing: border-box !important;
    letter-spacing: 0.5px !important;
    height: auto !important;
    margin: 0 !important;
}

.pexwoo-track-input:focus {
    outline: none !important;
    border-color: currentColor !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08) !important;
}

.pexwoo-track-input::placeholder {
    color: #aaa;
    font-size: 14px;
    letter-spacing: 0;
}

/* Dugme nasljeđuje boje od teme */
.pexwoo-track-btn {
    padding: 13px 28px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: opacity 0.15s, transform 0.1s !important;
    border-radius: 10px !important;
    line-height: 1 !important;
    height: auto !important;
}

.pexwoo-track-btn:active   { transform: scale(0.98); }
.pexwoo-track-btn:disabled { opacity: 0.55 !important; cursor: wait !important; }

/* ── Error ───────────────────────────────────────────────────────────── */

.pexwoo-track-error {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff3f3;
    border: 1px solid #fbc4c4;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
}

/* ── Loading ─────────────────────────────────────────────────────────── */

.pexwoo-track-loading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 32px 8px;
    color: #888;
    font-size: 14px;
}

.pexwoo-track-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e8e8e8;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: pexwoo-spin 0.75s linear infinite;
    flex-shrink: 0;
}

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

/* ── Timeline — max-width 640px ──────────────────────────────────────── */

.pexwoo-track-results {
    max-width: 640px;
    margin-top: 20px;
}

.pexwoo-track-timeline {
    position: relative;
}

.pexwoo-track-step {
    display: flex;
    gap: 0;
}

.pexwoo-track-step__indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
    flex-shrink: 0;
}

.pexwoo-track-step__dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    margin-top: 3px;
    flex-shrink: 0;
}

.pexwoo-track-step--active .pexwoo-track-step__dot {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}

.pexwoo-track-step__dot--ur  { background: #4caf50; }
.pexwoo-track-step__dot--vr  { background: #f44336; }
.pexwoo-track-step__dot--np  { background: #ff9800; }
.pexwoo-track-step__dot--do  { background: #ff9800; }
.pexwoo-track-step__dot--pr  { background: #2196f3; }
.pexwoo-track-step__dot--ot  { background: #5c6bc0; }
.pexwoo-track-step__dot--ep  { background: #90a4ae; }
.pexwoo-track-step__dot--def { background: #bdbdbd; }

.pexwoo-track-step__line {
    width: 2px;
    flex: 1;
    min-height: 20px;
    background: #e8e8e8;
    margin: 4px 0;
}

.pexwoo-track-step__content {
    padding: 0 0 22px 16px;
    flex: 1;
    min-width: 0;
}

.pexwoo-track-step__label {
    font-size: 15px;
    color: #555;
    line-height: 1.4;
}

.pexwoo-track-step--active .pexwoo-track-step__label {
    font-weight: 600;
    color: #1a1a1a;
}

.pexwoo-track-step__date {
    margin-top: 4px;
    font-size: 13px;
    color: #999;
}

.pexwoo-track-step--active .pexwoo-track-step__date { color: #777; }

.pexwoo-track-step__location {
    margin-top: 3px;
    font-size: 12px;
    color: #bbb;
}

/* ── Mobile — horizontalni scroll sa peek efektom ────────────────────── */

@media (max-width: 600px) {
    .pexwoo-stepper-wrap {
        /* Sakriva overflow steppera ali dozvoljava scroll unutra */
        overflow: hidden;
        padding: 20px 0 16px;
    }

    .pexwoo-stepper {
        /* Svaki korak je fiksne širine, scroll otkriva prethodni/sledeći */
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Padding omogućava prvom i posljednjem koraku da se centriraju */
        padding-left: calc(50% - 45px);
        padding-right: calc(50% - 45px);
    }

    .pexwoo-stepper::-webkit-scrollbar {
        display: none;
    }

    .pexwoo-stepper__step {
        scroll-snap-align: center;
        flex-shrink: 0;
        width: 90px;
        gap: 8px;
    }

    /* Connector fiksne širine na mobile (ne flex:1) */
    .pexwoo-stepper__conn {
        flex: none;
        width: 20px;
        margin-top: 19px; /* (40px ikona / 2) */
    }

    .pexwoo-stepper__node,
    .pexwoo-stepper__icon {
        width: 40px;
        height: 40px;
    }

    .pexwoo-stepper__icon svg {
        width: 18px;
        height: 18px;
    }

    .pexwoo-stepper__lbl {
        font-size: 10px;
    }

    .pexwoo-track-form {
        max-width: 100%;
    }

    .pexwoo-track-input-wrap {
        flex-direction: column;
    }

    .pexwoo-track-btn {
        width: 100%;
        padding: 14px !important;
    }

    .pexwoo-track-results {
        max-width: 100%;
    }
}
