﻿/* ==========================================================================
   orders.css  -  orders.aspx  (also loaded by myorderdetail.aspx because
   the .oc-* pill / tracker / button / status-colour styles are shared)
   ========================================================================== */

:root {
    --oc-brand: var(--red-primary, #c8102e);
    --oc-brand-soft: #fdecee; /* fallback */
    --oc-brand-soft: color-mix(in srgb, var(--oc-brand) 10%, #fff);
}

/* Status colours (status pill / cancel note) */
.oc-processing {
    --oc-accent: #e0932b;
    --oc-accent-soft: #fff3de;
}

.oc-shipped {
    --oc-accent: #2f7de1;
    --oc-accent-soft: #e5f0ff;
}

.oc-delivered {
    --oc-accent: #22a45d;
    --oc-accent-soft: #e2f7ea;
}

.oc-cancelled {
    --oc-accent: #6b6b6b;
    --oc-accent-soft: #efefef;
}

/* ----- Toolbar / filters / pager ----- */
.orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

    .orders-toolbar .form-control {
        max-width: 220px;
    }

.orders-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

    .orders-filters .form-control {
        width: auto;
        min-width: 150px;
    }

.orders-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}

    .orders-pager button {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        border: 1px solid var(--border, #ddd);
        background: #fff;
        border-radius: 6px;
        cursor: pointer;
    }

        .orders-pager button.active {
            background: #111;
            color: #fff;
            border-color: #111;
        }

        .orders-pager button:disabled {
            opacity: .45;
            cursor: default;
        }

    .orders-pager .pg-gap {
        align-self: center;
        padding: 0 4px;
    }

.orders-empty {
    text-align: center;
    padding: 80px 20px;
}

    .orders-empty .empty-icon {
        color: var(--line);
        margin-bottom: 20px;
    }

    .orders-empty h2 {
        font-family: var(--serif);
        font-size: 24px;
        margin-bottom: 10px;
    }

    .orders-empty p {
        color: var(--muted);
        font-size: 14px;
        margin-bottom: 24px;
    }

/* ----- List cards ----- */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.oc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 22px 20px 26px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20, 20, 20, .04);
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

    .oc-card::before {
        content: '';
        position: absolute;
        inset: 0 auto 0 0;
        width: 6px;
        background: var(--oc-brand);
    }

    .oc-card:hover, .oc-card:focus-visible {
        transform: translateY(-4px);
        box-shadow: 0 14px 34px rgba(20, 20, 20, .10);
        border-color: var(--oc-brand);
        outline: none;
    }

.oc-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oc-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--oc-brand);
    background: var(--oc-brand-soft);
}

.oc-id {
    flex: 1;
    min-width: 0;
}

.oc-no {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-date {
    font-size: 12.5px;
    color: var(--muted, #8a8a8a);
    margin-top: 2px;
}

.oc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    color: var(--oc-accent);
    background: var(--oc-accent-soft);
    border-radius: 999px;
    white-space: nowrap;
}

    .oc-pill i {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--oc-accent);
    }

/* Tracker (shared by list + detail) */
.oc-tracker {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px 0;
}

.oc-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: #a7a7a7;
}

    .oc-step + .oc-step::before {
        content: '';
        position: absolute;
        top: 9px;
        right: 50%;
        width: 100%;
        height: 2px;
        background: #e6e6e6;
        z-index: 0;
    }

    .oc-step.done + .oc-step::before, .oc-step.active::before {
        background: var(--oc-brand);
    }

.oc-dot {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #dcdcdc;
    color: #fff;
}

.oc-step.done .oc-dot {
    background: var(--oc-brand);
    border-color: var(--oc-brand);
}

.oc-step.active .oc-dot {
    border-color: var(--oc-brand);
    box-shadow: 0 0 0 4px var(--oc-brand-soft);
}

    .oc-step.active .oc-dot::after {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--oc-brand);
    }

.oc-step.done .oc-step-label, .oc-step.active .oc-step-label {
    color: #333;
    font-weight: 600;
}

.oc-cancel-note {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--oc-accent);
    background: var(--oc-accent-soft);
    border-radius: 10px;
    text-align: center;
}

.oc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.oc-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    background: #f8f8f8;
    border-radius: 10px;
    min-width: 0;
}

    .oc-stat span {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .6px;
        color: var(--muted, #8a8a8a);
    }

    .oc-stat strong {
        font-size: 13.5px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.oc-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, .07);
}

.oc-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .oc-total span {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .6px;
        color: var(--muted, #8a8a8a);
    }

    .oc-total strong {
        font-size: 22px;
        font-weight: 700;
        line-height: 1.1;
    }

.oc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.oc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 15px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
}

.oc-btn-ghost {
    color: #333;
    background: #fff;
    border-color: rgba(0, 0, 0, .15);
}

    .oc-btn-ghost:hover {
        border-color: var(--oc-brand);
        color: var(--oc-brand);
    }

.oc-btn-solid {
    color: #fff;
    background: var(--oc-brand);
}

    .oc-card:hover .oc-btn-solid, .oc-btn-solid:hover {
        filter: brightness(1.08);
        color: #fff;
    }

.oc-none {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted, #8a8a8a);
    padding: 30px 0;
}

/* Loading skeleton */
.oc-skeleton {
    min-height: 250px;
    gap: 14px;
    cursor: default;
}

    .oc-skeleton:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(20, 20, 20, .04);
        border-color: rgba(0, 0, 0, .07);
    }

    .oc-skeleton .sk {
        border-radius: 10px;
        background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 37%, #f0f0f0 63%);
        background-size: 400% 100%;
        animation: oc-shimmer 1.4s ease infinite;
    }

.sk-a {
    height: 44px;
}

.sk-b {
    height: 28px;
}

.sk-c {
    height: 50px;
}

.sk-d {
    height: 34px;
    width: 55%;
}

@keyframes oc-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

/* ============ Responsive ============ */
@media (max-width: 480px) {
    .orders-grid {
        grid-template-columns: 1fr;
    }

    .oc-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .oc-actions .oc-btn {
        flex: 1;
    }
}
/* ==========================================================================
   Order detail (myorderdetail.aspx)
   ========================================================================== */
.od-back {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3, #555);
    text-decoration: none;
}

    .od-back:hover {
        color: var(--oc-brand);
    }

.od-state {
    text-align: center;
    color: var(--muted, #8a8a8a);
    padding: 40px 0;
}

.od-notfound {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20, 20, 20, .04);
    padding: 48px 24px;
}

    .od-notfound h2 {
        margin: 0 0 8px;
        color: var(--ink, #1a1a1a);
    }

    .od-notfound p {
        margin: 0 0 20px;
    }

.od-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.od-main, .od-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.od-card {
    position: relative;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(20, 20, 20, .04);
    overflow: hidden;
}

    .od-card.t-header-card {
        padding-left: 30px;
    }

        .od-card.t-header-card::before {
            content: '';
            position: absolute;
            inset: 0 auto 0 0;
            width: 6px;
            background: var(--oc-accent, var(--oc-brand));
        }

.od-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.od-no {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--ink, #1a1a1a);
}

.od-date {
    font-size: 13px;
    color: var(--muted, #8a8a8a);
    margin-top: 3px;
}

.od-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--ink, #1a1a1a);
}

/* Items */
.od-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--line, #e6e6e6);
}

    .od-item:first-child {
        border-top: 0;
        padding-top: 0;
    }

.od-item-img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-3, #f4f4f4);
    display: grid;
    place-items: center;
    color: var(--muted, #8a8a8a);
}

    .od-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.od-item-info {
    flex: 1;
    min-width: 0;
}

.od-item-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ink, #1a1a1a);
}

.od-item-sku, .od-item-qty {
    font-size: 12.5px;
    color: var(--muted, #8a8a8a);
    margin-top: 3px;
}

.od-item-total {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

/* Summary + info rows */
.od-sum-row, .od-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-3, #555);
}

    .od-info-row strong {
        color: var(--ink, #1a1a1a);
        text-align: right;
        word-break: break-word;
    }

    .od-sum-row.od-neg {
        color: #22a45d;
    }

    .od-sum-row.od-grand {
        margin-top: 6px;
        padding-top: 14px;
        border-top: 1px solid var(--line, #e6e6e6);
        font-size: 17px;
        font-weight: 700;
        color: var(--ink, #1a1a1a);
    }

    .od-sum-row.od-muted {
        font-size: 13px;
        color: var(--muted, #8a8a8a);
    }

.od-track {
    width: 100%;
    margin-top: 12px;
}

.od-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-3, #555);
}

@media (max-width: 900px) {
    .od-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .od-card {
        padding: 18px 16px;
    }

    .od-item-img {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }
}