/* ================================================================
   Order timeline — My Account → View Order and the tracking form.

   The markup comes from Core's trackOrderStatus() and
   Webexpert_Shipping_Log (or Order Tracking's generated copy of them on
   shops without Core). Everything here is scoped to .webexpert-ot-timeline
   and inherits the theme's colours and type: these shops run any theme,
   and Core's icon font and variables are not there.
   ================================================================ */

.webexpert-ot-timeline {
    margin: 0 0 2em;
}
.webexpert-ot-timeline__title {
    margin-bottom: 0.5em;
}
.webexpert-ot-timeline__voucher {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25em 1em;
    margin: 0 0 1.25em;
}
.webexpert-ot-timeline__voucher span {
    opacity: 0.75;
    overflow-wrap: anywhere;
}

/* trackOrderStatus() wraps its steps in Bootstrap grid classes; undo whatever the theme gives them. */
.webexpert-ot-timeline .container,
.webexpert-ot-timeline .row,
.webexpert-ot-timeline .col-12 {
    display: block;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    flex: none;
}

/* ---- Steps: one vertical rail at every width ---- */
.webexpert-ot-timeline .track-icons-results {
    display: flex;
    flex-direction: column;
    margin: 0;
}
.webexpert-ot-timeline .track-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 0 18px 30px;
    opacity: 0.5;
}
.webexpert-ot-timeline .track-item.success,
.webexpert-ot-timeline .track-item.terminal {
    opacity: 1;
}
/* Core's icon font is not loaded here; the dot marks the step. */
.webexpert-ot-timeline .track-item > span[class*="wcicon-"] {
    display: none;
}
.webexpert-ot-timeline .track-content {
    flex: 1 1 auto;
    min-width: 0;
}
.webexpert-ot-timeline .track-item h4 {
    margin: 0;
    font-size: 1em;
    line-height: 1.4;
}
.webexpert-ot-timeline .track-item .track-subtitle {
    display: block;
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 0.75;
}
.webexpert-ot-timeline .track-item strong {
    font-size: 0.8em;
    font-weight: normal;
    line-height: 1.75;
    opacity: 0.75;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.webexpert-ot-timeline .track-item::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.3em;
    width: 13px;
    height: 13px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;
}
.webexpert-ot-timeline .track-item.success::after {
    background: currentColor;
}
.webexpert-ot-timeline .track-item::before {
    content: "";
    position: absolute;
    left: 10px;
    top: calc(0.3em + 13px);
    bottom: 0;
    border-left: 1px dashed currentColor;
    opacity: 0.4;
}
.webexpert-ot-timeline .track-item:last-child::before {
    display: none;
}
@media (max-width: 480px) {
    .webexpert-ot-timeline .track-item {
        flex-wrap: wrap;
        row-gap: 0;
    }
    .webexpert-ot-timeline .track-item strong {
        flex-basis: 100%;
    }
}

/* ---- Shipping history card ---- */
.webexpert-ot-timeline .we-shiplog {
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 6px;
}
.webexpert-ot-timeline .we-shiplog-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.webexpert-ot-timeline .we-shiplog-head span {
    font-size: 0.85em;
    opacity: 0.7;
    white-space: nowrap;
}
.webexpert-ot-timeline .we-shiplog-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    font-size: 0.9em;
}
.webexpert-ot-timeline .we-shiplog-table td {
    padding: 8px 6px;
    border: 0;
    border-bottom: 1px solid rgba(127, 127, 127, 0.2);
    background: none;
    vertical-align: top;
}
.webexpert-ot-timeline .we-shiplog-table tr:last-child td {
    border-bottom: 0;
}
/* Themes stripe table rows (Storefront: table:not(.has-background) tbody tr:nth-child(2n) td);
   the card's rows are separated by lines, not stripes. Three classes outrank that selector. */
.webexpert-ot-timeline .we-shiplog .we-shiplog-table tbody tr td {
    background: none;
}
.webexpert-ot-timeline .we-shiplog-when {
    width: 1%;
    white-space: nowrap;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}
.webexpert-ot-timeline .we-shiplog-where {
    text-align: right;
    white-space: nowrap;
    opacity: 0.7;
}
.webexpert-ot-timeline .we-shiplog-loading {
    margin: 4px 0 0;
    font-size: 0.9em;
    opacity: 0.7;
}
@media (max-width: 767px) {
    .webexpert-ot-timeline .we-shiplog-where { display: none; }
    .webexpert-ot-timeline .we-shiplog-when .we-shiplog-sep { display: none; }
    .webexpert-ot-timeline .we-shiplog-when .we-shiplog-date,
    .webexpert-ot-timeline .we-shiplog-when .we-shiplog-time { display: block; }
}
