/* ETC Fastco — shared tracking timeline / stepper styles (admin modal + storefront) */

.etc-track { font-size: 13px; color: #2c3e50; }
.etc-track-empty { color: #7f8c8d; padding: 16px 0; }

/* Header */
.etc-track-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
    margin-bottom: 18px;
}
.etc-track-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #95a5a6; }
.etc-track-awb { display: block; font-size: 22px; font-weight: 700; color: #2c3e50; }
.etc-track-courier { display: block; font-size: 12px; color: #7f8c8d; margin-top: 2px; }
.etc-track-head-status { text-align: end; }
.etc-track-badge { font-size: 13px; padding: 4px 10px; border-radius: 4px; }
.etc-track-latest { display: block; margin-top: 8px; font-size: 12px; color: #2c3e50; max-width: 280px; }

/* Stepper */
.etc-stepper { margin: 6px 0 22px; }
.etc-stepper-ends {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #2c3e50;
    margin-bottom: 10px;
}
.etc-stepper-end em { display: block; font-style: normal; font-size: 11px; color: #95a5a6; }
.etc-stepper-end-to { text-align: end; }

.etc-steps { display: flex; list-style: none; margin: 0; padding: 0; }
.etc-step {
    flex: 1 1 0;
    text-align: center;
    position: relative;
    padding-top: 30px;
    font-size: 12px;
    color: #95a5a6;
}
.etc-step-dot {
    position: absolute;
    top: 0;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #cfd8dc;
    z-index: 2;
    box-sizing: border-box;
}
.etc-step::before {
    content: "";
    position: absolute;
    top: 11px;
    inset-inline-start: -50%;
    width: 100%;
    height: 3px;
    background: #cfd8dc;
    z-index: 1;
}
.etc-step:first-child::before { display: none; }

.etc-step.is-done .etc-step-dot,
.etc-step.is-current .etc-step-dot { background: #3498db; border-color: #3498db; }
.etc-step.is-done .etc-step-dot::after,
.etc-step.is-current .etc-step-dot::after {
    content: "✓";
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    display: block;
    text-align: center;
}
.etc-step.is-done::before,
.etc-step.is-current::before { background: #3498db; }
.etc-step.is-current .etc-step-dot { box-shadow: 0 0 0 4px rgba(52, 152, 219, .2); }
.etc-step.is-done, .etc-step.is-current { color: #2c3e50; font-weight: 600; }

.etc-step.is-delivered .etc-step-dot { background: #2ecc71; border-color: #2ecc71; box-shadow: 0 0 0 4px rgba(46, 204, 113, .2); }

/* Exception (failed / returned / cancelled) turns the active node red */
.etc-stepper.is-exception .etc-step.is-current .etc-step-dot { background: #e74c3c; border-color: #e74c3c; box-shadow: 0 0 0 4px rgba(231, 76, 60, .2); }
.etc-stepper.is-exception .etc-step.is-current::before { background: #e74c3c; }

/* History (Date / Location / Activity) */
.etc-history { margin-top: 8px; }
.etc-history-head {
    display: grid;
    grid-template-columns: 150px 1.2fr 2fr;
    gap: 12px;
    padding: 10px 12px 10px 28px;
    background: #f4f6f8;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    border-radius: 6px 6px 0 0;
}
.etc-history-list { list-style: none; margin: 0; padding: 0; position: relative; }
.etc-history-list::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    inset-inline-start: 13px;
    width: 2px;
    background: #e3e8ec;
}
.etc-history-row {
    position: relative;
    display: grid;
    grid-template-columns: 150px 1.2fr 2fr;
    gap: 12px;
    align-items: start;
    padding: 12px 12px 12px 28px;
    border-bottom: 1px solid #f1f1f1;
}
.etc-history-row:nth-child(even) { background: #fafbfc; }
.etc-history-dot {
    position: absolute;
    inset-inline-start: 8px;
    top: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cfd8dc;
}
.etc-history-row:first-child .etc-history-dot { background: #2ecc71; }
.etc-history-date { font-size: 12px; color: #2c3e50; }
.etc-history-loc { font-size: 13px; font-weight: 600; color: #2c3e50; }
.etc-history-act { font-size: 13px; color: #555; line-height: 1.5; }
.etc-history-code { color: #95a5a6; font-style: normal; }

/* Raw payload (admin only) */
.etc-timeline-raw { margin-top: 16px; }
.etc-timeline-raw summary { cursor: pointer; color: #3498db; font-weight: 600; }
.etc-timeline-raw pre {
    background: #2c3e50; color: #ecf0f1; padding: 10px; border-radius: 4px;
    overflow-x: auto; margin-top: 8px; direction: ltr; text-align: left; font-size: 12px;
}

/* Order-details popup (eye icon) */
.etc-od-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.etc-od-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #95a5a6; }
.etc-od-val { display: block; font-size: 13px; color: #2c3e50; font-weight: 600; }
.etc-od-address { margin-bottom: 14px; }
.etc-od-address address { font-style: normal; font-size: 13px; color: #2c3e50; }
.etc-od-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.etc-od-items th, .etc-od-items td { border: 1px solid #eee; padding: 6px 8px; text-align: start; }
.etc-od-items thead th { background: #f4f6f8; }
.etc-od-items tfoot th { background: #fafbfc; }
.etc-od-totals { width: 100%; max-width: 340px; margin-inline-start: auto; margin-top: 10px; border-collapse: collapse; font-size: 13px; }
.etc-od-totals th { text-align: start; font-weight: 600; color: #555; padding: 5px 8px; }
.etc-od-totals td { text-align: end; padding: 5px 8px; color: #2c3e50; }
.etc-od-totals tr:last-child th, .etc-od-totals tr:last-child td { border-top: 1px solid #ddd; font-weight: 700; font-size: 14px; }

/* Eye icon button */
.etc-icon-btn { line-height: 1; }

/* Wide modal for the rich tracking/order views (admin) */
.etc-modal.is-wide .etc-modal-inner { width: 760px; max-width: 94%; }

/* Storefront wrapper */
.etc-track-frontend {
    margin: 28px 0;
    padding: 22px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
}
.etc-track-frontend > h2 { margin: 0 0 16px; font-size: 18px; }

/* Badge fallbacks so the storefront view is self-contained (admin.css not loaded there) */
.etc-track-frontend .etc-badge { color: #fff; padding: 3px 8px; border-radius: 3px; font-size: 12px; display: inline-block; }
.etc-track-frontend .etc-badge-green { background: #2ecc71; }
.etc-track-frontend .etc-badge-orange { background: #f39c12; }
.etc-track-frontend .etc-badge-red { background: #e74c3c; }
.etc-track-frontend .etc-badge-grey { background: #95a5a6; }
.etc-track-frontend .etc-badge-blue { background: #3498db; }
.etc-track-frontend .etc-badge-purple { background: #9b59b6; }
.etc-ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

@media screen and (max-width: 600px) {
    .etc-history-head { display: none; }
    .etc-history-row { grid-template-columns: 1fr; gap: 2px; padding-inline-start: 28px; }
    .etc-step-label { font-size: 10px; }
}
